librenms/librenms

View on GitHub
LibreNMS/OS/Panos.php

Summary

Maintainability
F
6 days
Test Coverage

Method pollOS has 272 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function pollOS(DataStorageInterface $datastore): void
    {
        $data = snmp_get_multi($this->getDeviceArray(), [
            'panSessionActive.0',
            'panSessionActiveTcp.0',
Severity: Major
Found in LibreNMS/OS/Panos.php - About 1 day to fix

    Function pollOS has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        public function pollOS(DataStorageInterface $datastore): void
        {
            $data = snmp_get_multi($this->getDeviceArray(), [
                'panSessionActive.0',
                'panSessionActiveTcp.0',
    Severity: Minor
    Found in LibreNMS/OS/Panos.php - About 3 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    File Panos.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*
     * Panos.php
     *
     * -Description-
    Severity: Minor
    Found in LibreNMS/OS/Panos.php - About 3 hrs to fix

      The method pollOS() has 363 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

          public function pollOS(DataStorageInterface $datastore): void
          {
              $data = snmp_get_multi($this->getDeviceArray(), [
                  'panSessionActive.0',
                  'panSessionActiveTcp.0',
      Severity: Minor
      Found in LibreNMS/OS/Panos.php by phpmd

      The method pollOS() has an NPath complexity of 134217728. The configured NPath complexity threshold is 200.
      Open

          public function pollOS(DataStorageInterface $datastore): void
          {
              $data = snmp_get_multi($this->getDeviceArray(), [
                  'panSessionActive.0',
                  'panSessionActiveTcp.0',
      Severity: Minor
      Found in LibreNMS/OS/Panos.php by phpmd

      NPathComplexity

      Since: 0.1

      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

      Example

      class Foo {
          function bar() {
              // lots of complicated code
          }
      }

      Source https://phpmd.org/rules/codesize.html#npathcomplexity

      The method pollOS() has a Cyclomatic Complexity of 28. The configured cyclomatic complexity threshold is 10.
      Open

          public function pollOS(DataStorageInterface $datastore): void
          {
              $data = snmp_get_multi($this->getDeviceArray(), [
                  'panSessionActive.0',
                  'panSessionActiveTcp.0',
      Severity: Minor
      Found in LibreNMS/OS/Panos.php by phpmd

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panSessionActiveTcp'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('sessions_tcp', 'GAUGE', 0, 3000000);
      
                  $fields = [
                      'sessions_tcp' => $data[0]['panSessionActiveTcp'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 6 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 72..83
      LibreNMS/OS/Panos.php on lines 98..109
      LibreNMS/OS/Panos.php on lines 111..122
      LibreNMS/OS/Panos.php on lines 124..135
      LibreNMS/OS/Panos.php on lines 137..148
      LibreNMS/OS/Panos.php on lines 150..161

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 111.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panSessionSslProxyUtilization'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('sessions_sslutil', 'GAUGE', 0, 3000000);
      
                  $fields = [
                      'sessions_sslutil' => $data[0]['panSessionSslProxyUtilization'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 6 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 72..83
      LibreNMS/OS/Panos.php on lines 85..96
      LibreNMS/OS/Panos.php on lines 98..109
      LibreNMS/OS/Panos.php on lines 111..122
      LibreNMS/OS/Panos.php on lines 124..135
      LibreNMS/OS/Panos.php on lines 150..161

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 111.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panSessionActiveUdp'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('sessions_udp', 'GAUGE', 0, 3000000);
      
                  $fields = [
                      'sessions_udp' => $data[0]['panSessionActiveUdp'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 6 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 72..83
      LibreNMS/OS/Panos.php on lines 85..96
      LibreNMS/OS/Panos.php on lines 111..122
      LibreNMS/OS/Panos.php on lines 124..135
      LibreNMS/OS/Panos.php on lines 137..148
      LibreNMS/OS/Panos.php on lines 150..161

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 111.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panSessionActiveSslProxy'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('sessions_ssl', 'GAUGE', 0, 3000000);
      
                  $fields = [
                      'sessions_ssl' => $data[0]['panSessionActiveSslProxy'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 6 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 72..83
      LibreNMS/OS/Panos.php on lines 85..96
      LibreNMS/OS/Panos.php on lines 98..109
      LibreNMS/OS/Panos.php on lines 111..122
      LibreNMS/OS/Panos.php on lines 137..148
      LibreNMS/OS/Panos.php on lines 150..161

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 111.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panGPGWUtilizationActiveTunnels'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('activetunnels', 'GAUGE', 0, 3000000);
      
                  $fields = [
                      'activetunnels' => $data[0]['panGPGWUtilizationActiveTunnels'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 6 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 72..83
      LibreNMS/OS/Panos.php on lines 85..96
      LibreNMS/OS/Panos.php on lines 98..109
      LibreNMS/OS/Panos.php on lines 111..122
      LibreNMS/OS/Panos.php on lines 124..135
      LibreNMS/OS/Panos.php on lines 137..148

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 111.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panSessionActive'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('sessions', 'GAUGE', 0, 3000000);
      
                  $fields = [
                      'sessions' => $data[0]['panSessionActive'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 6 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 85..96
      LibreNMS/OS/Panos.php on lines 98..109
      LibreNMS/OS/Panos.php on lines 111..122
      LibreNMS/OS/Panos.php on lines 124..135
      LibreNMS/OS/Panos.php on lines 137..148
      LibreNMS/OS/Panos.php on lines 150..161

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 111.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 7 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panSessionActiveICMP'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('sessions_icmp', 'GAUGE', 0, 3000000);
      
                  $fields = [
                      'sessions_icmp' => $data[0]['panSessionActiveICMP'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 6 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 72..83
      LibreNMS/OS/Panos.php on lines 85..96
      LibreNMS/OS/Panos.php on lines 98..109
      LibreNMS/OS/Panos.php on lines 124..135
      LibreNMS/OS/Panos.php on lines 137..148
      LibreNMS/OS/Panos.php on lines 150..161

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 111.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowMeterVsysThrottle'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowMeterVsysThrottle', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowMeterVsysThrottle' => $data[0]['panFlowMeterVsysThrottle'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosBlkNumEntries'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosBlkNumEntries', 'GAUGE', 0);
      
                  $fields = [
                      'panFlowDosBlkNumEntries' => $data[0]['panFlowDosBlkNumEntries'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosRedIcmp'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosRedIcmp', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosRedIcmp' => $data[0]['panFlowDosRedIcmp'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosRedIcmp6'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosRedIcmp6', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosRedIcmp6' => $data[0]['panFlowDosRedIcmp6'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosRuleDeny'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosRuleDeny', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosRuleDeny' => $data[0]['panFlowDosRuleDeny'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosZoneRedMax'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosZoneRedMax', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosZoneRedMax' => $data[0]['panFlowDosZoneRedMax'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosDropIpBlocked'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosDropIpBlocked', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosDropIpBlocked' => $data[0]['panFlowDosDropIpBlocked'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosRedUdp'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosRedUdp', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosRedUdp' => $data[0]['panFlowDosRedUdp'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowPolicyDeny'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowPolicyDeny', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowPolicyDeny' => $data[0]['panFlowPolicyDeny'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowPolicyNat'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowPolicyNat', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowPolicyNat' => $data[0]['panFlowPolicyNat'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowScanDrop'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowScanDrop', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowScanDrop' => $data[0]['panFlowScanDrop'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosSyncookieNotTcpSyn'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosSyncookieNotTcpSyn', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosSyncookieNotTcpSyn' => $data[0]['panFlowDosSyncookieNotTcpSyn'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosPbpDrop'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosPbpDrop', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosPbpDrop' => $data[0]['panFlowDosPbpDrop'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosZoneRedAct'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosZoneRedAct', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosZoneRedAct' => $data[0]['panFlowDosZoneRedAct'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosBlkSwEntries'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosBlkSwEntries', 'GAUGE', 0);
      
                  $fields = [
                      'panFlowDosBlkSwEntries' => $data[0]['panFlowDosBlkSwEntries'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosSyncookieNotTcpSynAck'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosSyncookieNotTcpSynAck', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosSyncookieNotTcpSynAck' => $data[0]['panFlowDosSyncookieNotTcpSynAck'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosRedTcp'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosRedTcp', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosRedTcp' => $data[0]['panFlowDosRedTcp'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosRuleDrop'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosRuleDrop', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosRuleDrop' => $data[0]['panFlowDosRuleDrop'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosRedIp'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosRedIp', 'COUNTER', 0);
      
                  $fields = [
                      'panFlowDosRedIp' => $data[0]['panFlowDosRedIp'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389
      LibreNMS/OS/Panos.php on lines 390..401

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 20 locations. Consider refactoring.
      Open

              if (is_numeric($data[0]['panFlowDosBlkHwEntries'])) {
                  $rrd_def = RrdDefinition::make()->addDataset('panFlowDosBlkHwEntries', 'GAUGE', 0);
      
                  $fields = [
                      'panFlowDosBlkHwEntries' => $data[0]['panFlowDosBlkHwEntries'],
      Severity: Major
      Found in LibreNMS/OS/Panos.php and 19 other locations - About 1 hr to fix
      LibreNMS/OS/Panos.php on lines 162..173
      LibreNMS/OS/Panos.php on lines 174..185
      LibreNMS/OS/Panos.php on lines 186..197
      LibreNMS/OS/Panos.php on lines 198..209
      LibreNMS/OS/Panos.php on lines 210..221
      LibreNMS/OS/Panos.php on lines 222..233
      LibreNMS/OS/Panos.php on lines 234..245
      LibreNMS/OS/Panos.php on lines 246..257
      LibreNMS/OS/Panos.php on lines 258..269
      LibreNMS/OS/Panos.php on lines 270..281
      LibreNMS/OS/Panos.php on lines 282..293
      LibreNMS/OS/Panos.php on lines 294..305
      LibreNMS/OS/Panos.php on lines 306..317
      LibreNMS/OS/Panos.php on lines 318..329
      LibreNMS/OS/Panos.php on lines 330..341
      LibreNMS/OS/Panos.php on lines 342..353
      LibreNMS/OS/Panos.php on lines 354..365
      LibreNMS/OS/Panos.php on lines 366..377
      LibreNMS/OS/Panos.php on lines 378..389

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 108.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status