XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/includes/ups/class.snmpups.inc.php

Summary

Maintainability
F
4 days
Test Coverage

The method __construct() contains an eval expression.
Open

                        $upss = eval(PSI_UPS_SNMPUPS_LIST);

EvalExpression

Since: 0.2

An eval-expression is untestable, a security risk and bad practice. Therefore it should be avoided. Consider to replace the eval-expression with regular code.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            eval('$param = 23;');
        }
    }
}

Source https://phpmd.org/rules/design.html#evalexpression

The method __construct() contains an eval expression.
Open

                        $upss = eval(PSI_UPS_SNMPUPS_LIST);

EvalExpression

Since: 0.2

An eval-expression is untestable, a security risk and bad practice. Therefore it should be avoided. Consider to replace the eval-expression with regular code.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            eval('$param = 23;');
        }
    }
}

Source https://phpmd.org/rules/design.html#evalexpression

Function __construct has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        parent::__construct();
        switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
        case 'command':
Severity: Minor
Found in phpsysinfo/includes/ups/class.snmpups.inc.php - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

Function _info has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
Open

    private function _info()
    {
        if (empty($this->_output)) {
            return;
        }
Severity: Minor
Found in phpsysinfo/includes/ups/class.snmpups.inc.php - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

Method _info has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function _info()
    {
        if (empty($this->_output)) {
            return;
        }
Severity: Major
Found in phpsysinfo/includes/ups/class.snmpups.inc.php - About 4 hrs to fix

    Method __construct has 90 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct()
        {
            parent::__construct();
            switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
            case 'command':
    Severity: Major
    Found in phpsysinfo/includes/ups/class.snmpups.inc.php - About 3 hrs to fix

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

      class SNMPups extends UPS
      {
          /**
           * internal storage for all gathered data
           *

      Avoid deeply nested control flow statements.
      Open

                                  if (! empty($bufferarr3)) {
                                      foreach ($bufferarr3 as $id=>$string) {
                                          $buffer .= $id." = ".$string."\n";
                                      }
                                  }                            }
      Severity: Major
      Found in phpsysinfo/includes/ups/class.snmpups.inc.php - About 45 mins to fix

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

            public function __construct()
            {
                parent::__construct();
                switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
                case 'command':

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

            private function _info()
            {
                if (empty($this->_output)) {
                    return;
                }

        The method __construct() has an NPath complexity of 5423. The configured NPath complexity threshold is 200.
        Open

            public function __construct()
            {
                parent::__construct();
                switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
                case 'command':

        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 _info() has an NPath complexity of 84913922. The configured NPath complexity threshold is 200.
        Open

            private function _info()
            {
                if (empty($this->_output)) {
                    return;
                }

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

            private function _info()
            {
                if (empty($this->_output)) {
                    return;
                }

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

            public function __construct()
            {
                parent::__construct();
                switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
                case 'command':

        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

        Missing class import via use statement (line '153', column '24').
        Open

                    $dev = new UPSDevice();

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

                                CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.1", $buffer, PSI_DEBUG);

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.4", $buffer, PSI_DEBUG);

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                            } else {
                                $upss = array(PSI_UPS_SNMPUPS_LIST);
                            }

        ElseExpression

        Since: 1.4.0

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

        Example

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

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

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

                            } else {
                                $status = $batstat;
                            }

        ElseExpression

        Since: 1.4.0

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

        Example

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

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

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

                            } else {
                                $status = $batstat;
                            }

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

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.3", $buffer, PSI_DEBUG);

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                            } else {
                                $upss = array(PSI_UPS_SNMPUPS_LIST);
                            }

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

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.2", $buffer, PSI_DEBUG);

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

        Avoid unused local variables such as '$status3'.
        Open

                    $status3 = "";

        UnusedLocalVariable

        Since: 0.2

        Detects when a local variable is declared and/or assigned, but not used.

        Example

        class Foo {
            public function doSomething()
            {
                $i = 5; // Unused
            }
        }

        Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

        Avoid unused local variables such as '$status2'.
        Open

                    $status2 = "";

        UnusedLocalVariable

        Since: 0.2

        Detects when a local variable is declared and/or assigned, but not used.

        Example

        class Foo {
            public function doSomething()
            {
                $i = 5; // Unused
            }
        }

        Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

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

        class SNMPups extends UPS

        The property $_output is not named in camelCase.
        Open

        class SNMPups extends UPS
        {
            /**
             * internal storage for all gathered data
             *

        CamelCasePropertyName

        Since: 0.2

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

        Example

        class ClassName {
            protected $property_name;
        }

        Source

        The CASE body must start on the line following the statement
        Open

                            case 3: $status = "On Battery";

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

                                    break;

        Property name "$_output" should not be prefixed with an underscore to indicate visibility
        Open

            private $_output = array();

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

                                    break;

        The CASE body must start on the line following the statement
        Open

                            case 1: break;

        Terminating statement must be on a line by itself
        Open

                            case 1: break;

        The CASE body must start on the line following the statement
        Open

                            case 5: $status = "Timed Sleeping";

        The CASE body must start on the line following the statement
        Open

                            case 6: $status = "Software Bypass";

        Terminating statement must be on a line by itself
        Open

                            case 2: break;

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

                                    break;

        Expected 1 space before "=>"; 0 found
        Open

                                        foreach ($bufferarr2 as $id=>$string) {

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

            private function _info()

        Expected 1 space before "=>"; 0 found
        Open

                                    foreach ($bufferarr as $id=>$string) {

        The DEFAULT body must start on the line following the statement
        Open

                           default: $batstat = "Battery Unknown (".trim($data[1]).")";

        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;

        The CASE body must start on the line following the statement
        Open

                            case 7: $status = "Off";

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

                                    break;

        Expected 1 space after "=>"; 0 found
        Open

                                        foreach ($bufferarr3 as $id=>$string) {

        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;

        The CASE body must start on the line following the statement
        Open

                            case 12:$status = "On Smart Trim";

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

                                    break;

        The DEFAULT body must start on the line following the statement
        Open

                           default: $batstat = "Replace Battery (".trim($data[1]).")";

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

                                    break;

        The CASE body must start on the line following the statement
        Open

                            case 11:$status = "Sleeping Until Power Returns";

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

                                    break;

        The CASE body must start on the line following the statement
        Open

                            case 2: break;

        The CASE body must start on the line following the statement
        Open

                            case 2: $batstat = "Replace Battery";

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

                                    break;

        The CASE body must start on the line following the statement
        Open

                            case 8: $status = "Rebooting";

        Expected 1 space after "=>"; 0 found
        Open

                                        foreach ($bufferarr2 as $id=>$string) {

        Expected 1 space before "=>"; 0 found
        Open

                                        foreach ($bufferarr4 as $id=>$string) {

        The CASE body must start on the line following the statement
        Open

                            case 4: $status = "On Smart Boost";

        Expected 1 space before "=>"; 0 found
        Open

                                        foreach ($bufferarr3 as $id=>$string) {

        Expected 1 space after "=>"; 0 found
        Open

                                        foreach ($bufferarr4 as $id=>$string) {

        The CASE body must start on the line following the statement
        Open

                            case 1: $status = "Unknown";

        The CASE body must start on the line following the statement
        Open

                            case 9: $status = "Switched Bypass";

        The CASE body must start on the line following the statement
        Open

                            case 1: $batstat = "Battery Unknown";

        The CASE body must start on the line following the statement
        Open

                            case 2: $status = "On Line";

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

                                    break;

        The CASE body must start on the line following the statement
        Open

                            case 10:$status = "Hardware Failure Bypass";

        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;

        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;

        The CASE body must start on the line following the statement
        Open

                            case 3: $batstat = "Battery Low";

        Expected 1 space after "=>"; 0 found
        Open

                                    foreach ($bufferarr as $id=>$string) {

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

                                    break;

        The DEFAULT body must start on the line following the statement
        Open

                           default: $status = "Unknown state (".trim($data[1]).")";

        Line exceeds 120 characters; contains 203 characters
        Open

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.3", $buffer, PSI_DEBUG);

        Line exceeds 120 characters; contains 149 characters
        Open

                                    $bufferarr3=snmprealwalk($ups, "public", ".1.3.6.1.4.1.318.1.1.1.3", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        Line exceeds 120 characters; contains 203 characters
        Open

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.2", $buffer, PSI_DEBUG);

        Line exceeds 120 characters; contains 121 characters
        Open

                    if (preg_match('/^\.1\.3\.6\.1\.4\.1\.318\.1\.1\.1\.2\.2\.3\.0 = Timeticks:\s\((\d*)\)/m', $result, $data)) {

        Line exceeds 120 characters; contains 132 characters
        Open

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

        Line exceeds 120 characters; contains 149 characters
        Open

                                    $bufferarr4=snmprealwalk($ups, "public", ".1.3.6.1.4.1.318.1.1.1.4", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        Line exceeds 120 characters; contains 199 characters
        Open

                                CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.1", $buffer, PSI_DEBUG);

        Line exceeds 120 characters; contains 144 characters
        Open

                            $this->error->addError("Requirements error", "SNMPups plugin requires the snmp extension to php in order to work properly");

        Line exceeds 120 characters; contains 203 characters
        Open

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$ups." .1.3.6.1.4.1.318.1.1.1.4", $buffer, PSI_DEBUG);

        Line exceeds 120 characters; contains 144 characters
        Open

                                $bufferarr=snmprealwalk($ups, "public", ".1.3.6.1.4.1.318.1.1.1.1", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        Line exceeds 120 characters; contains 149 characters
        Open

                                    $bufferarr2=snmprealwalk($ups, "public", ".1.3.6.1.4.1.318.1.1.1.2", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        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 32 spaces, found 28
        Open

                                    if (! empty($bufferarr3)) {

        Line indented incorrectly; expected 20 spaces, found 19
        Open

                           default: $batstat = "Replace Battery (".trim($data[1]).")";

        Line indented incorrectly; expected 36 spaces, found 32
        Open

                                        foreach ($bufferarr3 as $id=>$string) {

        Line indented incorrectly; expected at least 40 spaces, found 36
        Open

                                            $buffer .= $id." = ".$string."\n";

        Line indented incorrectly; expected 32 spaces, found 28
        Open

                                    }                            }

        Line indented incorrectly; expected 12 spaces, found 8
        Open

                case 'php-snmp':

        Line indented incorrectly; expected 36 spaces, found 32
        Open

                                        }

        Line indented incorrectly; expected 20 spaces, found 19
        Open

                           default: $batstat = "Battery Unknown (".trim($data[1]).")";

        Closing brace must be on a line by itself
        Open

                            case 1: break;

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

                       $dev->setStatus(trim($status));

        Closing brace must be on a line by itself
        Open

                                    }                            }

        Line indented incorrectly; expected 12 spaces, found 8
        Open

                case 'command':

        Line indented incorrectly; expected 20 spaces, found 19
        Open

                           default: $status = "Unknown state (".trim($data[1]).")";

        Closing brace must be on a line by itself
        Open

                            case 2: break;

        The variable $old_err_rep is not named in camelCase.
        Open

            public function __construct()
            {
                parent::__construct();
                switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
                case 'command':

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

            public function __construct()
            {
                parent::__construct();
                switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
                case 'command':

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

            public function __construct()
            {
                parent::__construct();
                switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
                case 'command':

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

            public function __construct()
            {
                parent::__construct();
                switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
                case 'command':

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

            private function _info()
            {
                if (empty($this->_output)) {
                    return;
                }

        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