XoopsModules25x/xoopsinfo

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

Summary

Maintainability
F
4 days
Test Coverage

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

class HPUX extends OS
{
    /**
     * Virtual Host Name
     *

File class.HPUX.inc.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

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

        private function _cpuinfo()
        {
            if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
                $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
                foreach ($processors as $processor) {
    Severity: Minor
    Found in phpsysinfo/includes/os/class.HPUX.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 _ide has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _ide()
        {
            $bufd = CommonFunctions::gdc('/proc/ide', false);
            foreach ($bufd as $file) {
                if (preg_match('/^hd/', $file)) {
    Severity: Minor
    Found in phpsysinfo/includes/os/class.HPUX.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 _usb has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _usb()
        {
            if (CommonFunctions::rfts('/proc/bus/usb/devices', $bufr, 0, 4096, false)) {
                $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                $devnum = -1;
    Severity: Minor
    Found in phpsysinfo/includes/os/class.HPUX.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

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

        private function _memory()
        {
            if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                foreach ($bufe as $buf) {
    Severity: Minor
    Found in phpsysinfo/includes/os/class.HPUX.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 _cpuinfo has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function _cpuinfo()
        {
            if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
                $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
                foreach ($processors as $processor) {
    Severity: Minor
    Found in phpsysinfo/includes/os/class.HPUX.inc.php - About 1 hr to fix

      Function _filesystems has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          private function _filesystems()
          {
              if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                  $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                  if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
      Severity: Minor
      Found in phpsysinfo/includes/os/class.HPUX.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 _memory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function _memory()
          {
              if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                  $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                  foreach ($bufe as $buf) {
      Severity: Minor
      Found in phpsysinfo/includes/os/class.HPUX.inc.php - About 1 hr to fix

        Function _scsi has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
        Severity: Minor
        Found in phpsysinfo/includes/os/class.HPUX.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

        Function _pci has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _pci()
            {
                if (CommonFunctions::rfts('/proc/pci', $bufr)) {
                    $device = false;
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
        Severity: Minor
        Found in phpsysinfo/includes/os/class.HPUX.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

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

            private function _network()
            {
                if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
                    $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($lines as $line) {
        Severity: Minor
        Found in phpsysinfo/includes/os/class.HPUX.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 _hostname has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _hostname()
            {
                if (PSI_USE_VHOST === true) {
                    if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
                } else {
        Severity: Minor
        Found in phpsysinfo/includes/os/class.HPUX.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

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

            public function build()
            {
                if (!$this->blockname || $this->blockname==='vitals') {
                    $this->_distro();
                    $this->_hostname();
        Severity: Minor
        Found in phpsysinfo/includes/os/class.HPUX.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 build() has an NPath complexity of 243. The configured NPath complexity threshold is 200.
        Open

            public function build()
            {
                if (!$this->blockname || $this->blockname==='vitals') {
                    $this->_distro();
                    $this->_hostname();

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

            private function _cpuinfo()
            {
                if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
                    $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
                    foreach ($processors as $processor) {

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

            public function build()
            {
                if (!$this->blockname || $this->blockname==='vitals') {
                    $this->_distro();
                    $this->_hostname();

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

                    $processors = preg_split('/\s?\n\s?\n/', trim($bufr));

        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::rfts('/proc/scsi/scsi', $bufr, 0, 4096, 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

                if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {

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

                        if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && CommonFunctions::rfts("/proc/ide/".$file."/media", $buf, 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 '$hnm' which will lead to PHP notices.
        Open

                    if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);

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

                            if (trim($buf) == 'disk') {

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

                    if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);

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

                    $this->sys->setKernel($ret);

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

                    if (CommonFunctions::executeProgram('hostname', '', $ret)) {

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

                                    $dev->setCapacity(trim($buf) * 512);

        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::rfts('/proc/bus/usb/devices', $bufr, 0, 4096, false)) {

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

                    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_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 '$buf' which will lead to PHP notices.
        Open

                                if (CommonFunctions::rfts("/proc/ide/".$file."/capacity", $buf, 1, 4096, false)) {

        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::rfts('/proc/meminfo', $bufr)) {

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

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

                        $this->sys->setHostname($ret);

        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::rfts('/proc/pci', $bufr)) {

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

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

                            $fsdev[$a[0]] = $a[4];

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

                        if (CommonFunctions::rfts('/proc/swaps', $swaps)) {

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

                    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_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

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

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

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

                if (CommonFunctions::executeProgram('uname', '-srvm', $ret)) {

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

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

                            $dev->setFsType($fsdev[$ar_buf[0]]);

        UndefinedVariable

        Since: 2.8.0

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

        Example

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

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

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

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

                if (CommonFunctions::executeProgram('uptime', '', $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::rfts('/proc/cpuinfo', $bufr)) {

        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

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

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

                        if (isset($fsdev[$ar_buf[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 '$df' which will lead to PHP notices.
        Open

                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {

        UndefinedVariable

        Since: 2.8.0

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

        Example

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

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

        Missing class import via use statement (line '179', 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 '243', 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 '152', 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 '101', column '28').
        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 '263', 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 '299', column '36').
        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

        Missing class import via use statement (line '331', 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

        Missing class import via use statement (line '210', 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

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

                if (CommonFunctions::rfts('/proc/bus/usb/devices', $bufr, 0, 4096, false)) {

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

                if (CommonFunctions::executeProgram('uname', '-srvm', $ret)) {

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

                    if (CommonFunctions::executeProgram('hostname', '', $ret)) {

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

                if (CommonFunctions::executeProgram('df', '-kP', $df, 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 '_hostname'.
        Open

                    if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);

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

                } else {
                    if (CommonFunctions::executeProgram('hostname', '', $ret)) {
                        $this->sys->setHostname($ret);
                    }
                }

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

                    if (CommonFunctions::executeProgram('mount', '-v', $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 '_loadavg'.
        Open

                if (CommonFunctions::executeProgram('uptime', '', $buf)) {

        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::rfts('/proc/swaps', $swaps)) {

        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', '-ni | tail -n +2', $netstat)) {

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

                        if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && CommonFunctions::rfts("/proc/ide/".$file."/media", $buf, 1)) {

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

                if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {

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

                                if (CommonFunctions::rfts("/proc/ide/".$file."/capacity", $buf, 1, 4096, false)) {

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

                if (CommonFunctions::executeProgram('uptime', '', $buf)) {

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

                $bufd = CommonFunctions::gdc('/proc/ide', false);

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

                if (CommonFunctions::rfts('/proc/pci', $bufr)) {

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

                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, 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::rfts('/proc/meminfo', $bufr)) {

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

            private function _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
        Severity: Major
        Found in phpsysinfo/includes/os/class.HPUX.inc.php and 1 other location - About 1 day to fix
        phpsysinfo/includes/os/class.AIX.inc.php on lines 274..299

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

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

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

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

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

        Refactorings

        Further Reading

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

                if (CommonFunctions::rfts('/proc/pci', $bufr)) {
                    $device = false;
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $buf) {
                        if (preg_match('/^\s*Bus\s/', $buf)) {
        Severity: Major
        Found in phpsysinfo/includes/os/class.HPUX.inc.php and 1 other location - About 2 hrs to fix
        phpsysinfo/includes/os/class.Linux.inc.php on lines 605..628

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

        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

            private function _uptime()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
                        $min = $ar_buf[3];
        Severity: Major
        Found in phpsysinfo/includes/os/class.HPUX.inc.php and 1 other location - About 1 hr to fix
        phpsysinfo/includes/os/class.AIX.inc.php on lines 65..75

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

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

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

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

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

        Refactorings

        Further Reading

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

                        if (! empty($ar_buf[0]) && ! empty($ar_buf[3])) {
                            $dev = new NetDevice();
                            $dev->setName($ar_buf[0]);
                            $dev->setRxBytes($ar_buf[4]);
                            $dev->setTxBytes($ar_buf[6]);
        Severity: Minor
        Found in phpsysinfo/includes/os/class.HPUX.inc.php and 1 other location - About 45 mins to fix
        phpsysinfo/includes/os/class.DragonFly.inc.php on lines 69..77

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

        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 HPUX extends OS

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

                            $a = preg_split('/ /', $line, -1, PREG_SPLIT_NO_EMPTY);

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

            private function _distro()

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

            private function _loadavg()

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

            private function _hostname()

        Terminating statement must be indented to the same level as the CASE body
        Open

                                    break;

        Terminating statement must be indented to the same level as the CASE body
        Open

                                    break;

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

            private function _network()

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

            private function _cpuinfo()

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

            private function _uptime()

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

            private function _filesystems()

        Terminating statement must be indented to the same level as the CASE body
        Open

                                    break;

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

            private function _ide()

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

            private function _memory()

        Terminating statement must be indented to the same level as the CASE body
        Open

                                    break;

        Terminating statement must be indented to the same level as the CASE body
        Open

                                    break;

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

            private function _pci()

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

            private function _scsi()

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

            private function _usb()

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

            private function _kernel()

        Terminating statement must be indented to the same level as the CASE body
        Open

                                    break;

        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 (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);

        Line exceeds 120 characters; contains 145 characters
        Open

                        if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS && CommonFunctions::rfts("/proc/ide/".$file."/media", $buf, 1)) {

        Line exceeds 120 characters; contains 132 characters
        Open

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

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

                                    $dev->setBogomips($arrBuff[1]);

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'model name':

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'clock':

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'cache size':

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

                                    $dev->setCpuSpeed($arrBuff[1]);

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'cpu0clktck':

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'cycle frequency [hz]':

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'cpu0bogo':

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

                                    $dev->setCpuSpeed($arrBuff[1] / 1000000);

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

                                    $dev->setCpuSpeed(hexdec($arrBuff[1]) / 1000000); // Linux sparc64

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

                                    $dev->setModel($arrBuff[1]);

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'cpu':

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'cpu mhz':

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'l2 cache':

        Line indented incorrectly; expected 28 spaces, found 24
        Open

                                case 'bogomips':

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

                                    $dev->setCache(preg_replace("/[a-zA-Z]/", "", $arrBuff[1]) * 1024);

        The variable $dev_type is not named in camelCase.
        Open

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

        CamelCaseVariableName

        Since: 0.2

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

        Example

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

        Source

        The variable $ar_buf is not named in camelCase.
        Open

            private function _network()
            {
                if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
                    $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', '-ni | tail -n +2', $netstat)) {
                    $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

        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', '-ni | tail -n +2', $netstat)) {
                    $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', '-ni | tail -n +2', $netstat)) {
                    $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

        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 _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

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

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

        CamelCaseVariableName

        Since: 0.2

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

        Example

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

        Source

        The variable $ar_buf is not named in camelCase.
        Open

            private function _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _uptime()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
                        $min = $ar_buf[3];

        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', '-ni | tail -n +2', $netstat)) {
                    $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', '-ni | tail -n +2', $netstat)) {
                    $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 _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

        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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

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

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

        CamelCaseVariableName

        Since: 0.2

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

        Example

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

        Source

        The variable $ar_buf is not named in camelCase.
        Open

            private function _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

        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 _uptime()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
                        $min = $ar_buf[3];

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

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

        CamelCaseVariableName

        Since: 0.2

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

        Example

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

        Source

        The variable $ar_buf is not named in camelCase.
        Open

            private function _network()
            {
                if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
                    $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 _uptime()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
                        $min = $ar_buf[3];

        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 _loadavg()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
                        $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);

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

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -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 $get_type is not named in camelCase.
        Open

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

        CamelCaseVariableName

        Since: 0.2

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

        Example

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

        Source

        The variable $ar_buf is not named in camelCase.
        Open

            private function _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _loadavg()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
                        $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);

        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 _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

        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 _loadavg()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
                        $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);

        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 _loadavg()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
                        $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);

        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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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', '-ni | tail -n +2', $netstat)) {
                    $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', '-ni | tail -n +2', $netstat)) {
                    $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 _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

        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 _uptime()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
                        $min = $ar_buf[3];

        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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $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 method _uptime is not named in camelCase.
        Open

            private function _uptime()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
                        $min = $ar_buf[3];

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

            private function _hostname()
            {
                if (PSI_USE_VHOST === true) {
                    if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
                } else {

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

            private function _scsi()
            {
                $get_type = false;
                if (CommonFunctions::rfts('/proc/scsi/scsi', $bufr, 0, 4096, PSI_DEBUG)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

        CamelCaseMethodName

        Since: 0.2

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

        Example

        class ClassName {
            public function get_name() {
            }
        }

        Source

        The method _pci is not named in camelCase.
        Open

            private function _pci()
            {
                if (CommonFunctions::rfts('/proc/pci', $bufr)) {
                    $device = false;
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);

        CamelCaseMethodName

        Since: 0.2

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

        Example

        class ClassName {
            public function get_name() {
            }
        }

        Source

        The method _memory is not named in camelCase.
        Open

            private function _memory()
            {
                if (CommonFunctions::rfts('/proc/meminfo', $bufr)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    foreach ($bufe as $buf) {

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

            private function _filesystems()
            {
                if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                    $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                    if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {

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

            private function _loadavg()
            {
                if (CommonFunctions::executeProgram('uptime', '', $buf)) {
                    if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
                        $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);

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

            private function _ide()
            {
                $bufd = CommonFunctions::gdc('/proc/ide', false);
                foreach ($bufd as $file) {
                    if (preg_match('/^hd/', $file)) {

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

            private function _usb()
            {
                if (CommonFunctions::rfts('/proc/bus/usb/devices', $bufr, 0, 4096, false)) {
                    $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    $devnum = -1;

        CamelCaseMethodName

        Since: 0.2

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

        Example

        class ClassName {
            public function get_name() {
            }
        }

        Source

        The method _network is not named in camelCase.
        Open

            private function _network()
            {
                if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
                    $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 _kernel is not named in camelCase.
        Open

            private function _kernel()
            {
                if (CommonFunctions::executeProgram('uname', '-srvm', $ret)) {
                    $this->sys->setKernel($ret);
                }

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

            private function _cpuinfo()
            {
                if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
                    $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
                    foreach ($processors as $processor) {

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

            private function _distro()
            {
                $this->sys->setDistribution('HP-UX');
                $this->sys->setDistributionIcon('HPUX.png');
            }

        CamelCaseMethodName

        Since: 0.2

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

        Example

        class ClassName {
            public function get_name() {
            }
        }

        Source

        There are no issues that match your filters.

        Category
        Status