XoopsModules25x/xoopsinfo

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

Summary

Maintainability
F
1 wk
Test Coverage

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

    private function _network()
    {
        if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
            $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($lines as $line) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Darwin.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

Function cpuinfo has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    protected function cpuinfo()
    {
        $dev = new CpuDevice();
        if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
            $dev->setModel(preg_replace('/Processor type: /', '', $buf));
Severity: Minor
Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 4 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

Function memory has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    protected function memory()
    {
        $s = $this->grabkey('hw.memsize');
        if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
            // calculate free memory from page sizes (each page = 4096)
Severity: Minor
Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 4 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 class.Darwin.inc.php has 348 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Darwin System Class
 *
 * PHP version 5
Severity: Minor
Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 4 hrs to fix

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

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

    Function _processes has a Cognitive Complexity of 19 (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.Darwin.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

    Function distro has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function distro()
        {
            $this->sys->setDistributionIcon('Darwin.png');
            if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) {
                parent::distro();
    Severity: Minor
    Found in phpsysinfo/includes/os/class.Darwin.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 memory has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function memory()
        {
            $s = $this->grabkey('hw.memsize');
            if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                // calculate free memory from page sizes (each page = 4096)
    Severity: Major
    Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 2 hrs to fix

      Method cpuinfo has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function cpuinfo()
          {
              $dev = new CpuDevice();
              if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                  $dev->setModel(preg_replace('/Processor type: /', '', $buf));
      Severity: Minor
      Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 2 hrs to fix

        Function usb has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function usb()
            {
                $s = $this->_grabioreg('IOUSBDevice');
                $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                foreach ($lines as $line) {
        Severity: Minor
        Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 1 hr 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 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function _network()
            {
                if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                    $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {
        Severity: Minor
        Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 1 hr to fix

          Function pci has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function pci()
              {
                  if (!$arrResults = Parser::lspci(false)) { //no lspci port
                      $s = $this->_grabioreg('IOPCIDevice');
                      $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
          Severity: Minor
          Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 1 hr 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

          Avoid deeply nested control flow statements.
          Open

                                          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.Darwin.inc.php - About 45 mins to fix

            Function _grabioreg has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function _grabioreg($key)
                {
                    if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s, PSI_DEBUG)) {
                        /* delete newlines */
                        $s = preg_replace("/\s+/", " ", $s);
            Severity: Minor
            Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 35 mins 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

            Function ide has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function ide()
                {
                    $s = $this->_grabioreg('IOATABlockStorageDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {
            Severity: Minor
            Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 25 mins 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 method cpuinfo() has an NPath complexity of 21744. The configured NPath complexity threshold is 200.
            Open

                protected function cpuinfo()
                {
                    $dev = new CpuDevice();
                    if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                        $dev->setModel(preg_replace('/Processor type: /', '', $buf));

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

                protected function usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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

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

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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

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

                private function _network()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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

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

                protected function cpuinfo()
                {
                    $dev = new CpuDevice();
                    if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                        $dev->setModel(preg_replace('/Processor type: /', '', $buf));

            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 '$pstat' which will lead to PHP notices.
            Open

                               && preg_match('/^Pages wired down:\s+(\S+)/m', $pstat, $wire_buf)

            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 '$pstat' which will lead to PHP notices.
            Open

                                if (preg_match('/^Pages inactive:\s+(\S+)/m', $pstat, $inactive_buf)) {

            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 '$a' which will lead to PHP notices.
            Open

                    if (CommonFunctions::executeProgram('sysctl', '-n kern.boottime', $a, 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 '$pstat' which will lead to PHP notices.
            Open

                                if (preg_match('/^Pages active:\s+(\S+)/m', $pstat, $active_buf)) {

            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 '$pstat' which will lead to PHP notices.
            Open

                            $lines = preg_split("/\n/", $pstat, -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 '$a' which will lead to PHP notices.
            Open

                          $this->sys->setUptime(time() - $a);

            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 '$buffer' which will lead to PHP notices.
            Open

                    if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, 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 '$pstat' which will lead to PHP notices.
            Open

                            if (preg_match('/^Anonymous pages:\s+(\S+)/m', $pstat, $anon_buf)

            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 '$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 '$a' which will lead to PHP notices.
            Open

                        $tmp = explode(" ", $a);

            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 '$pstat' which will lead to PHP notices.
            Open

                                    if (preg_match('/^Pages occupied by compressor:\s+(\S+)/m', $pstat, $compr_buf)) {

            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', '-nbdi | cut -c1-24,42- | grep Link', $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 '$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 '$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 '$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

                                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

            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 '$pstat' which will lead to PHP notices.
            Open

                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, 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 '$pstat' which will lead to PHP notices.
            Open

                        if (preg_match('/^Pages free:\s+(\S+)/m', $pstat, $free_buf)) {

            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 '$swapBuff' which will lead to PHP notices.
            Open

                        if (CommonFunctions::executeProgram('sysctl', 'vm.swapusage | colrm 1 22', $swapBuff, 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 '$pstat' which will lead to PHP notices.
            Open

                                if (preg_match('/^Pages speculative:\s+(\S+)/m', $pstat, $spec_buf)) {

            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 '$pstat' which will lead to PHP notices.
            Open

                                if (preg_match('/^Pages wired down:\s+(\S+)/m', $pstat, $wire_buf)) {

            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 '$swapBuff' which will lead to PHP notices.
            Open

                            $swap1 = preg_split('/M/', $swapBuff);

            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 '$pstat' which will lead to PHP notices.
            Open

                               && preg_match('/^File-backed pages:\s+(\S+)/m', $pstat, $fileb_buf)) {

            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 '$buffer' which will lead to PHP notices.
            Open

                        $arrBuff = preg_split("/\n/", $buffer, -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['*'] = 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

            Missing class import via use statement (line '219', column '32').
            Open

                                $dev = new HWDevice();

            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

            Missing class import via use statement (line '181', column '28').
            Open

                            $dev = new HWDevice();

            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

            Missing class import via use statement (line '370', column '32').
            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

            Missing class import via use statement (line '209', column '32').
            Open

                                $dev = new HWDevice();

            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

            Missing class import via use statement (line '237', column '32').
            Open

                                $dev = new HWDevice();

            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

            Remove error control operator '@' on line 428.
            Open

                protected function distro()
                {
                    $this->sys->setDistributionIcon('Darwin.png');
                    if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) {
                        parent::distro();

            ErrorControlOperator

            Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

            Example

            function foo($filePath) {
                $file = @fopen($filPath); // hides exceptions
                $key = @$array[$notExistingKey]; // assigns null to $key
            }

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

            Missing class import via use statement (line '267', column '32').
            Open

                                $dev = new HWDevice();

            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

            Missing class import via use statement (line '350', column '32').
            Open

                                $dev = new HWDevice();

            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

            Missing class import via use statement (line '118', column '20').
            Open

                    $dev = new CpuDevice();

            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

            Missing class import via use statement (line '328', column '28').
            Open

                            $dev = new DiskDevice();

            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

            Avoid assigning values to variables in if clauses and the like (line '177', column '14').
            Open

                protected function pci()
                {
                    if (!$arrResults = Parser::lspci(false)) { //no lspci port
                        $s = $this->_grabioreg('IOPCIDevice');
                        $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);

            IfStatementAssignment

            Since: 2.7.0

            Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

            Example

            class Foo
            {
                public function bar($flag)
                {
                    if ($foo = 'bar') { // possible typo
                        // ...
                    }
                    if ($baz = 0) { // always false
                        // ...
                    }
                }
            }

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

            Avoid assigning values to variables in if clauses and the like (line '428', column '33').
            Open

                protected function distro()
                {
                    $this->sys->setDistributionIcon('Darwin.png');
                    if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG)) {
                        parent::distro();

            IfStatementAssignment

            Since: 2.7.0

            Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

            Example

            class Foo
            {
                public function bar($flag)
                {
                    if ($foo = 'bar') { // possible typo
                        // ...
                    }
                    if ($baz = 0) { // always false
                        // ...
                    }
                }
            }

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

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

                            } else {
                                if (preg_match('/^Pages speculative:\s+(\S+)/m', $pstat, $spec_buf)) {
                                    $this->sys->setMemFree(($free_buf[1]+$spec_buf[1]) * 4 * 1024);
                                } else {
                                    $this->sys->setMemFree($free_buf[1] * 4 * 1024);

            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 memory uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                                } else {
                                    $this->sys->setMemFree($free_buf[1] * 4 * 1024);
                                }

            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 '_uptime'.
            Open

                    if (CommonFunctions::executeProgram('sysctl', '-n kern.boottime', $a, 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

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

                            } else {
                                $dev->setName(trim($ar_buf[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

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

                    } else {
                        foreach ($arrResults as $dev) {
                            $this->sys->setPciDevices($dev);
                        }
                    }

            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 'cpuinfo'.
            Open

                    if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, 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 'memory'.
            Open

                        if (CommonFunctions::executeProgram('sysctl', 'vm.swapusage | colrm 1 22', $swapBuff, 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 'distro'.
            Open

                    if (!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, 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

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

                    } else {
                        return '';
                    }

            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 distro uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
            Open

                    } else {
                        $arrBuff = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($arrBuff as $line) {
                            $arrLine = preg_split("/:/", $line, -1, PREG_SPLIT_NO_EMPTY);
                            if (trim($arrLine[0]) === "System Version") {

            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 'grabkey'.
            Open

                    if (CommonFunctions::executeProgram('sysctl', $key, $s, 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 'Parser' in method 'pci'.
            Open

                    if (!$arrResults = Parser::lspci(false)) { //no lspci port

            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

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

                        } else {
                            $lines = preg_split("/\n/", $pstat, -1, PREG_SPLIT_NO_EMPTY);
                            $ar_buf = preg_split("/\s+/", $lines[1], 19);
                            $this->sys->setMemFree($ar_buf[2] * 4 * 1024);
                        }

            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 (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

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

                        } else { /* kern.boottime= 1096732600 */
                          $this->sys->setUptime(time() - $a);
                        }

            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 '_grabioreg'.
            Open

                    if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s, 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 (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $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

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

                    } else {
                        return '';
                    }

            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 'cpuinfo'.
            Open

                            if (CommonFunctions::rfts(PSI_APP_ROOT.'/data/ModelTranslation.txt', $buffer)) {

            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 'memory'.
            Open

                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, 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

            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

            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.Darwin.inc.php and 1 other location - About 2 days to fix
            phpsysinfo/includes/os/class.FreeBSD.inc.php on lines 98..121

            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 2 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.Darwin.inc.php and 1 other location - About 6 hrs to fix
            phpsysinfo/includes/os/class.SunOS.inc.php on lines 425..448

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

            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

                protected function scsi()
                {
                    $s = $this->_grabioreg('IOBlockStorageServices');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {
            Severity: Major
            Found in phpsysinfo/includes/os/class.Darwin.inc.php and 1 other location - About 2 hrs to fix
            phpsysinfo/includes/os/class.Darwin.inc.php on lines 345..356

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

            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

                protected function _tb()
                {
                    $s = $this->_grabioreg('IOThunderboltPort');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {
            Severity: Major
            Found in phpsysinfo/includes/os/class.Darwin.inc.php and 1 other location - About 2 hrs to fix
            phpsysinfo/includes/os/class.Darwin.inc.php on lines 262..273

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

            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 Darwin extends BSDCommon

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

                    $s = $this->_grabioreg('IOThunderboltPort');

            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 $s. Configured minimum length is 3.
            Open

                        $s = $this->_grabioreg('IOPCIDevice');

            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 $s. Configured minimum length is 3.
            Open

                    $s = $this->_grabioreg('IOUSBDevice');

            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 $s. Configured minimum length is 3.
            Open

                    $s = $this->_grabioreg('IOBlockStorageServices');

            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 $s. Configured minimum length is 3.
            Open

                    $s = $this->grabkey('hw.memsize');

            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 $s. Configured minimum length is 3.
            Open

                    $s = $this->_grabioreg('IOATABlockStorageDevice');

            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 "_grabioreg" should not be prefixed with an underscore to indicate visibility
            Open

                private function _grabioreg($key)

            Space found before second semicolon of FOR loop
            Open

                    for ($ncpu ; $ncpu > 0 ; $ncpu--) {

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

                private function _uptime()

            Space found before first semicolon of FOR loop
            Open

                    for ($ncpu ; $ncpu > 0 ; $ncpu--) {

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

                protected function _tb()

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

                private function _network()

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

                protected function _processes()

            Line exceeds 120 characters; contains 138 characters
            Open

                                    if (preg_match('/(^Mac OS X Server|^Mac OS X|^OS X Server|^OS X|^macOS Server|^macOS) (\d+\.\d+)/', $distro, $ver)

            Inline control structures are not allowed
            Open

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

            Inline control structures are not allowed
            Open

                                if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))

            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

                    if (is_null($ncpu) || (trim($ncpu) == "") || (!($ncpu >= 1)))

            Inline control structures are not allowed
            Open

                                            else

            Inline control structures are not allowed
            Open

                                elseif ($state == 'D') $state = 'd'; //invalid

            Inline control structures are not allowed
            Open

                                if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))

            Inline control structures are not allowed
            Open

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

            Inline control structures are not allowed
            Open

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

            Inline control structures are not allowed
            Open

                                if (!preg_match('/"Description" = "([^"]*)"/', $line, $ar_buf))

            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

                                if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))

            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 135 characters
            Open

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

            Line exceeds 120 characters; contains 141 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 (!preg_match('/"USB Product Name" = "([^"]*)"/', $line, $ar_buf))

            Line exceeds 120 characters; contains 126 characters
            Open

                    $this->error->addWarning("The Darwin version of phpSysInfo is a work in progress, some things currently don't work!");

            Line exceeds 120 characters; contains 209 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 exceeds 120 characters; contains 183 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 indented incorrectly; expected at least 16 spaces, found 14
            Open

                          $this->sys->setUptime(time() - $a);

            Line indented incorrectly; expected 12 spaces, found 20
            Open

                                }

            Line indented incorrectly; expected 16 spaces, found 24
            Open

                                    }

            Line indented incorrectly; expected 16 spaces, found 24
            Open

                                    }

            Line indented incorrectly; expected at least 16 spaces, found 14
            Open

                          $this->sys->setUptime(time() - $data);

            Line indented incorrectly; expected at least 16 spaces, found 14
            Open

                          $data = trim($tmp[3], ",");

            Expected 1 space after ELSE keyword; newline found
            Open

                                            else

            Line indented incorrectly; expected 16 spaces, found 24
            Open

                                    if (preg_match('/"USB Vendor Name" = "([^"]*)"/', $line, $ar_buf)) {

            Line indented incorrectly; expected 16 spaces, found 24
            Open

                                    if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL

            Line indented incorrectly; expected 16 spaces, found 24
            Open

                                    }

            Line indented incorrectly; expected 12 spaces, found 20
            Open

                                if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {

            Line indented incorrectly; expected 16 spaces, found 24
            Open

                                    if (preg_match('/"USB Product Name" = "([^"]*)"/', $line, $ar_buf)) {

            Line indented incorrectly; expected 20 spaces, found 24
            Open

                                    if (preg_match('/^Pages occupied by compressor:\s+(\S+)/m', $pstat, $compr_buf)) {

            Line indented incorrectly; expected 20 spaces, found 24
            Open

                                    }

            The variable $ar_buf is not named in camelCase.
            Open

                protected function ide()
                {
                    $s = $this->_grabioreg('IOATABlockStorageDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 ide()
                {
                    $s = $this->_grabioreg('IOATABlockStorageDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $compr_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $compr_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 _tb()
                {
                    $s = $this->_grabioreg('IOThunderboltPort');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 pci()
                {
                    if (!$arrResults = Parser::lspci(false)) { //no lspci port
                        $s = $this->_grabioreg('IOPCIDevice');
                        $lines = preg_split("/\n/", $s, -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 ide()
                {
                    $s = $this->_grabioreg('IOATABlockStorageDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $wire_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 ide()
                {
                    $s = $this->_grabioreg('IOATABlockStorageDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $anon_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 cpuinfo()
                {
                    $dev = new CpuDevice();
                    if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                        $dev->setModel(preg_replace('/Processor type: /', '', $buf));

            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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 scsi()
                {
                    $s = $this->_grabioreg('IOBlockStorageServices');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $inactive_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 ide()
                {
                    $s = $this->_grabioreg('IOATABlockStorageDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 _tb()
                {
                    $s = $this->_grabioreg('IOThunderboltPort');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 $free_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $free_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 cpuinfo()
                {
                    $dev = new CpuDevice();
                    if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                        $dev->setModel(preg_replace('/Processor type: /', '', $buf));

            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 cpuinfo()
                {
                    $dev = new CpuDevice();
                    if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                        $dev->setModel(preg_replace('/Processor type: /', '', $buf));

            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 pci()
                {
                    if (!$arrResults = Parser::lspci(false)) { //no lspci port
                        $s = $this->_grabioreg('IOPCIDevice');
                        $lines = preg_split("/\n/", $s, -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

                protected function pci()
                {
                    if (!$arrResults = Parser::lspci(false)) { //no lspci port
                        $s = $this->_grabioreg('IOPCIDevice');
                        $lines = preg_split("/\n/", $s, -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 $free_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $fileb_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $inactive_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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

                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

                protected function usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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

                protected function pci()
                {
                    if (!$arrResults = Parser::lspci(false)) { //no lspci port
                        $s = $this->_grabioreg('IOPCIDevice');
                        $lines = preg_split("/\n/", $s, -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 pci()
                {
                    if (!$arrResults = Parser::lspci(false)) { //no lspci port
                        $s = $this->_grabioreg('IOPCIDevice');
                        $lines = preg_split("/\n/", $s, -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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $active_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $active_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 $anon_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $wire_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $spec_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 ide()
                {
                    $s = $this->_grabioreg('IOATABlockStorageDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 pci()
                {
                    if (!$arrResults = Parser::lspci(false)) { //no lspci port
                        $s = $this->_grabioreg('IOPCIDevice');
                        $lines = preg_split("/\n/", $s, -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 $fileb_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 usb()
                {
                    $s = $this->_grabioreg('IOUSBDevice');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $wire_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 _tb()
                {
                    $s = $this->_grabioreg('IOThunderboltPort');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 cpuinfo()
                {
                    $dev = new CpuDevice();
                    if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                        $dev->setModel(preg_replace('/Processor type: /', '', $buf));

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 scsi()
                {
                    $s = $this->_grabioreg('IOBlockStorageServices');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 scsi()
                {
                    $s = $this->_grabioreg('IOBlockStorageServices');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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 $wire_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $free_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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 $spec_buf is not named in camelCase.
            Open

                protected function memory()
                {
                    $s = $this->grabkey('hw.memsize');
                    if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
                        // calculate free memory from page sizes (each page = 4096)

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 _network is not named in camelCase.
            Open

                private function _network()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {

            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 _tb is not named in camelCase.
            Open

                protected function _tb()
                {
                    $s = $this->_grabioreg('IOThunderboltPort');
                    $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {

            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()
                {
                    if (CommonFunctions::executeProgram('sysctl', '-n kern.boottime', $a, PSI_DEBUG)) {
                        $tmp = explode(" ", $a);
                        if ($tmp[0]=="{") { /* kern.boottime= { sec = 1096732600, usec = 885425 } Sat Oct 2 10:56:40 2004 */

            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

            The method _grabioreg is not named in camelCase.
            Open

                private function _grabioreg($key)
                {
                    if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s, PSI_DEBUG)) {
                        /* delete newlines */
                        $s = preg_replace("/\s+/", " ", $s);

            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