XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/includes/os/class.FreeBSD.inc.php

Summary

Maintainability
F
6 days
Test Coverage

Function _network has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

    private function _network()
    {
        $dev = null;
        if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
            $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
Severity: Minor
Found in phpsysinfo/includes/os/class.FreeBSD.inc.php - About 1 day 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

The class FreeBSD has an overall complexity of 55 which is very high. The configured complexity threshold is 50.
Open

class FreeBSD extends BSDCommon
{
    /**
     * define the regexp for log parser
     */

Function _processes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _processes()
    {
        if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
            $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
            $processes['*'] = 0;
Severity: Minor
Found in phpsysinfo/includes/os/class.FreeBSD.inc.php - About 2 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

Method _network has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function _network()
    {
        $dev = null;
        if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
            $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
Severity: Major
Found in phpsysinfo/includes/os/class.FreeBSD.inc.php - About 2 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                                    if (preg_match('/^\s+ether\s+(\S+)/i', $buf2, $ar_buf2)) {
                                        if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-', strtoupper($ar_buf2[1])));
                                    } elseif (preg_match('/^\s+inet\s+(\S+)\s+netmask/i', $buf2, $ar_buf2)) {
                                        $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
                                    } elseif ((preg_match('/^\s+inet6\s+([^\s%]+)\s+prefixlen/i', $buf2, $ar_buf2)
    Severity: Major
    Found in phpsysinfo/includes/os/class.FreeBSD.inc.php - About 45 mins to fix

      The method _network() has an NPath complexity of 207. The configured NPath complexity threshold is 200.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      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 _network() has a Cyclomatic Complexity of 33. The configured cyclomatic complexity threshold is 10.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      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

      Avoid using undefined variables such as '$version' which will lead to PHP notices.
      Open

              if (extension_loaded('pfSense') && CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (trim($version) != '')) { // pfSense detection

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$netstat' which will lead to PHP notices.
      Open

                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$bufr' which will lead to PHP notices.
      Open

              if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$processes' which will lead to PHP notices.
      Open

                  $processes['*'] = 0;

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$netstat' which will lead to PHP notices.
      Open

              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$processes' which will lead to PHP notices.
      Open

                      $this->sys->setProcesses($processes);

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$bufr2' which will lead to PHP notices.
      Open

                                  $bufe2 = preg_split("/\n/", $bufr2, -1, PREG_SPLIT_NO_EMPTY);

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$processes' which will lead to PHP notices.
      Open

                          $processes['*']++;

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$processes' which will lead to PHP notices.
      Open

                              $processes[$state]++;

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$processes' which will lead to PHP notices.
      Open

                              $processes[$state] = 1;

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$version' which will lead to PHP notices.
      Open

                  $this->sys->setDistribution('pfSense '. trim($version));

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$processes' which will lead to PHP notices.
      Open

                  if ($processes['*'] > 0) {

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$bufr' which will lead to PHP notices.
      Open

                  $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$version' which will lead to PHP notices.
      Open

              if (extension_loaded('pfSense') && CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (trim($version) != '')) { // pfSense detection

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$processes' which will lead to PHP notices.
      Open

                          if (isset($processes[$state])) {

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Avoid using undefined variables such as '$bufr2' which will lead to PHP notices.
      Open

                              if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig', $ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

      Source https://phpmd.org/rules/cleancode.html#undefinedvariable

      Missing class import via use statement (line '71', column '36').
      Open

                              $dev = new NetDevice();

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      The method __construct has a boolean flag argument $blockname, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public function __construct($blockname = false)

      BooleanArgumentFlag

      Since: 1.4.0

      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

      Example

      class Foo {
          public function bar($flag = true) {
          }
      }

      Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

      The method _network uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                                  } else {
                                    $dev->setTxBytes($ar_buf[8]);
                                    $dev->setRxBytes($ar_buf[5]);
                                    $dev->setErrors($ar_buf[4] + $ar_buf[7]);
                                    $dev->setDrops($ar_buf[10]);

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      The method _network uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                              } else {
                                  if (isset($ar_buf[12]) && (trim($ar_buf[12]) != '')) { /* Idrop column exist*/
                                    $dev->setTxBytes($ar_buf[10]);
                                    $dev->setRxBytes($ar_buf[7]);
                                    $dev->setErrors($ar_buf[5] + $ar_buf[9]);

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      The method _network uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                                          } else {
                                              $unit = "M";
                                          }

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      The method _distroicon uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $this->sys->setDistributionIcon('FreeBSD.png');
              }

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      The method _network uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                                  } else {
                                    $dev->setTxBytes($ar_buf[9]);
                                    $dev->setRxBytes($ar_buf[6]);
                                    $dev->setErrors($ar_buf[5] + $ar_buf[8]);
                                    $dev->setDrops($ar_buf[11]);

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Avoid using static access to class 'CommonFunctions' in method '_processes'.
      Open

              if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class 'CommonFunctions' in method '_distroicon'.
      Open

              if (extension_loaded('pfSense') && CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (trim($version) != '')) { // pfSense detection

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      The method _processes uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                          } else {
                              $processes[$state] = 1;
                          }

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

      Source https://phpmd.org/rules/cleancode.html#elseexpression

      Avoid using static access to class 'CommonFunctions' in method '_network'.
      Open

              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class 'CommonFunctions' in method '_network'.
      Open

                              if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig', $ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

                              if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig', $ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {
                                  $bufe2 = preg_split("/\n/", $bufr2, -1, PREG_SPLIT_NO_EMPTY);
                                  foreach ($bufe2 as $buf2) {
                                      if (preg_match('/^\s+ether\s+(\S+)/i', $buf2, $ar_buf2)) {
                                          if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-', strtoupper($ar_buf2[1])));
      Severity: Major
      Found in phpsysinfo/includes/os/class.FreeBSD.inc.php and 1 other location - About 2 days to fix
      phpsysinfo/includes/os/class.Darwin.inc.php on lines 378..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 530.

      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 3 locations. Consider refactoring.
      Open

          protected function _processes()
          {
              if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                  $processes['*'] = 0;
      Severity: Major
      Found in phpsysinfo/includes/os/class.FreeBSD.inc.php and 2 other locations - About 5 hrs to fix
      phpsysinfo/includes/os/class.Minix.inc.php on lines 304..326
      phpsysinfo/includes/os/class.NetBSD.inc.php on lines 165..187

      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 200.

      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 2 locations. Consider refactoring.
      Open

                              } else {
                                  if (isset($ar_buf[12]) && (trim($ar_buf[12]) != '')) { /* Idrop column exist*/
                                    $dev->setTxBytes($ar_buf[10]);
                                    $dev->setRxBytes($ar_buf[7]);
                                    $dev->setErrors($ar_buf[5] + $ar_buf[9]);
      Severity: Major
      Found in phpsysinfo/includes/os/class.FreeBSD.inc.php and 1 other location - About 4 hrs to fix
      phpsysinfo/includes/os/class.FreeBSD.inc.php on lines 73..97

      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 162.

      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 2 locations. Consider refactoring.
      Open

                              if ((strlen($ar_buf[3]) < 17) && ($ar_buf[0] != $ar_buf[3])) { /* no MAC or dev name*/
                                  if (isset($ar_buf[11]) && (trim($ar_buf[11]) != '')) { /* Idrop column exist*/
                                    $dev->setTxBytes($ar_buf[9]);
                                    $dev->setRxBytes($ar_buf[6]);
                                    $dev->setErrors($ar_buf[4] + $ar_buf[8]);
      Severity: Major
      Found in phpsysinfo/includes/os/class.FreeBSD.inc.php and 1 other location - About 4 hrs to fix
      phpsysinfo/includes/os/class.FreeBSD.inc.php on lines 85..97

      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 162.

      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

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class FreeBSD extends BSDCommon

      Avoid variables with short names like $s. Configured minimum length is 3.
      Open

              $s = preg_split('/ /', $this->grabkey('kern.boottime'));

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $a. Configured minimum length is 3.
      Open

              $a = preg_replace('/,/', '', $s[3]);

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Method name "_network" should not be prefixed with an underscore to indicate visibility
      Open

          private function _network()

      Method name "_uptime" should not be prefixed with an underscore to indicate visibility
      Open

          private function _uptime()

      Method name "_memoryadditional" should not be prefixed with an underscore to indicate visibility
      Open

          private function _memoryadditional()

      Method name "_distroicon" should not be prefixed with an underscore to indicate visibility
      Open

          private function _distroicon()

      Method name "_processes" should not be prefixed with an underscore to indicate visibility
      Open

          protected function _processes()

      Line exceeds 120 characters; contains 145 characters
      Open

                                              $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1].$unit.'b/s '.strtolower($ar_buf3[1]));

      Inline control structures are not allowed
      Open

                                          if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-', strtoupper($ar_buf2[1])));

      Line exceeds 120 characters; contains 143 characters
      Open

              $this->sys->setMemApplication(($this->grabkey("vm.stats.vm.v_active_count") + $this->grabkey("vm.stats.vm.v_wire_count")) * $pagesize);

      Line exceeds 120 characters; contains 132 characters
      Open

       * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version

      Inline control structures are not allowed
      Open

                                          else

      Inline control structures are not allowed
      Open

                          if ($state == 'L') $state = 'D'; //linux format

      Line exceeds 120 characters; contains 132 characters
      Open

       * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version

      Line exceeds 120 characters; contains 139 characters
      Open

                                      } elseif (preg_match('/^\s+media:\s+/i', $buf2) && preg_match('/[\(\s](\d+)(G*)base/i', $buf2, $ar_buf2)) {

      Inline control structures are not allowed
      Open

                          elseif ($state == 'I') $state = 'S';

      Inline control structures are not allowed
      Open

                                          if (preg_match('/[<\s]([^\s<]+)-duplex/i', $buf2, $ar_buf3))

      Line exceeds 120 characters; contains 121 characters
      Open

              $this->sys->setMemBuffer($this->sys->getMemUsed() - $this->sys->getMemApplication() - $this->sys->getMemCache());

      Line exceeds 120 characters; contains 187 characters
      Open

                              if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig', $ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {

      Line exceeds 120 characters; contains 213 characters
      Open

                                          if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-', strtoupper($ar_buf2[1])));

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setDrops($ar_buf[12] + $ar_buf[6]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setErrors($ar_buf[5] + $ar_buf[9]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setTxBytes($ar_buf[9]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setTxBytes($ar_buf[10]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setErrors($ar_buf[4] + $ar_buf[8]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setRxBytes($ar_buf[6]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setTxBytes($ar_buf[8]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setRxBytes($ar_buf[5]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setDrops($ar_buf[10]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setTxBytes($ar_buf[9]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setRxBytes($ar_buf[6]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setDrops($ar_buf[11] + $ar_buf[5]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setErrors($ar_buf[4] + $ar_buf[7]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setRxBytes($ar_buf[7]);

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setDrops($ar_buf[11]);

      Expected 1 space after ELSE keyword; newline found
      Open

                                          else

      Line indented incorrectly; expected at least 32 spaces, found 30
      Open

                                    $dev->setErrors($ar_buf[5] + $ar_buf[8]);

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          protected function _processes()
          {
              if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                  $processes['*'] = 0;

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf3 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          protected function _processes()
          {
              if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                  $processes['*'] = 0;

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf3 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf2 is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The variable $ar_buf is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseVariableName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name variables.

      Example

      class ClassName {
          public function doSomething() {
              $data_module = new DataModule();
          }
      }

      Source

      The method _distroicon is not named in camelCase.
      Open

          private function _distroicon()
          {
              if (extension_loaded('pfSense') && CommonFunctions::rfts('/etc/version', $version, 1, 4096, false) && (trim($version) != '')) { // pfSense detection
                  $this->sys->setDistribution('pfSense '. trim($version));
                  $this->sys->setDistributionIcon('pfSense.png');

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method _network is not named in camelCase.
      Open

          private function _network()
          {
              $dev = null;
              if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method _uptime is not named in camelCase.
      Open

          private function _uptime()
          {
              $s = preg_split('/ /', $this->grabkey('kern.boottime'));
              $a = preg_replace('/,/', '', $s[3]);
              $this->sys->setUptime(time() - $a);

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method _memoryadditional is not named in camelCase.
      Open

          private function _memoryadditional()
          {
              $pagesize = $this->grabkey("hw.pagesize");
              $this->sys->setMemCache($this->grabkey("vm.stats.vm.v_cache_count") * $pagesize);
              $this->sys->setMemApplication(($this->grabkey("vm.stats.vm.v_active_count") + $this->grabkey("vm.stats.vm.v_wire_count")) * $pagesize);

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      The method _processes is not named in camelCase.
      Open

          protected function _processes()
          {
              if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
                  $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                  $processes['*'] = 0;

      CamelCaseMethodName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name methods.

      Example

      class ClassName {
          public function get_name() {
          }
      }

      Source

      There are no issues that match your filters.

      Category
      Status