XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php

Summary

Maintainability
F
4 days
Test Coverage

The method __construct() contains an eval expression.
Open

                        $printers = eval(PSI_PLUGIN_SNMPPINFO_DEVICES);

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

                        $printers = eval(PSI_PLUGIN_SNMPPINFO_DEVICES);

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

                        $printers = eval(PSI_PLUGIN_SNMPPINFO_DEVICES);

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 105 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($enc)
    {
        parent::__construct(__CLASS__, $enc);
        switch (strtolower(PSI_PLUGIN_SNMPPINFO_ACCESS)) {
        case 'command':
Severity: Minor
Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 2 days 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 execute has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        if (empty($this->_filecontent)) {
            return;
        }
Severity: Minor
Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 4 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function xml has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function xml()
    {
        foreach ($this->_result as $printer=>$markersupplies_item) {
            $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
            $xmlsnmppinfo_printer->addAttribute("Device", $printer);
Severity: Minor
Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 4 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function __construct($enc)
    {
        parent::__construct(__CLASS__, $enc);
        switch (strtolower(PSI_PLUGIN_SNMPPINFO_ACCESS)) {
        case 'command':
Severity: Major
Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 4 hrs to fix

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

    class SNMPPInfo extends PSI_Plugin
    {
        /**
         * variable, which holds the content of the command
         * @var array

    Method execute has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function execute()
        {
            if (empty($this->_filecontent)) {
                return;
            }
    Severity: Minor
    Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 1 hr to fix

      Method xml has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function xml()
          {
              foreach ($this->_result as $printer=>$markersupplies_item) {
                  $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                  $xmlsnmppinfo_printer->addAttribute("Device", $printer);
      Severity: Minor
      Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 1 hr to fix

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

            public function __construct($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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 __construct() has 138 lines of code. Current threshold is set to 100. Avoid really long methods.
        Open

            public function __construct($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_ACCESS)) {
                case 'command':

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

            public function __construct($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function execute()
            {
                if (empty($this->_filecontent)) {
                    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

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

                                       $this->_filecontent[$printer] .= "\n".$buffer2;

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

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.2.1.43.18.1.1", $buffer3, 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 '$buffer3' which will lead to PHP notices.
        Open

                                    if (strlen($buffer3) > 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 '$buffer1' which will lead to PHP notices.
        Open

                                    if (strlen($buffer1) > 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 '$buffer3' which will lead to PHP notices.
        Open

                                       $this->_filecontent[$printer] .= "\n".$buffer3;

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

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.2.1.43.11.1.1", $buffer2, 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 '$buffer1' which will lead to PHP notices.
        Open

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.4.1.367.3.2.1.2.24.1.1", $buffer1, 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 '$buffer2' which will lead to PHP notices.
        Open

                                    if (strlen($buffer2) > 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 '$buffer1' which will lead to PHP notices.
        Open

                                       $this->_filecontent[$printer] .= "\n".$buffer1;

        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 static access to class 'CommonFunctions' in method '__construct'.
        Open

                                if (CommonFunctions::rfts(PSI_APP_ROOT."/data/snmppinfo{$pn}.txt", $buffer) && !empty($buffer)) {

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

        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 {
                                $printers = array(PSI_PLUGIN_SNMPPINFO_DEVICES);
                            }

        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." ".$printer." .1.3.6.1.2.1.43.11.1.1", $buffer2, 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 {
                                $printers = array(PSI_PLUGIN_SNMPPINFO_DEVICES);
                            }

        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." ".$printer." .1.3.6.1.4.1.367.3.2.1.2.24.1.1", $buffer1, 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

        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 {
                                $printers = array(PSI_PLUGIN_SNMPPINFO_DEVICES);
                            }

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

                                } else {
                                    $newstring .= chr($hexint);
                                }

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

                            } else {
                                $xmlsnmppinfo = $xmlsnmppinfo_printer->addChild("MarkerSupplies");
        
                                $xmlsnmppinfo->addAttribute("Description", isset($snmppinfo_item['prtMarkerSuppliesDescription']) ? $snmppinfo_item['prtMarkerSuppliesDescription'] : "");
                                $xmlsnmppinfo->addAttribute("SupplyUnit", isset($snmppinfo_item['prtMarkerSuppliesSupplyUnit']) ? $snmppinfo_item['prtMarkerSuppliesSupplyUnit'] : "");

        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." ".$printer." .1.3.6.1.2.1.1.5", $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." ".$printer." .1.3.6.1.2.1.43.18.1.1", $buffer3, 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 xml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                        } else {
                            if ($ricoh) {
                                if (isset($snmppinfo_item['prtMarkerSuppliesDescriptionRicoh'])) {
                                    $xmlsnmppinfo = $xmlsnmppinfo_printer->addChild("MarkerSupplies");
        
        

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

                    } else {
                        $ricoh = false;
                    }

        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 unused local variables such as '$item'.
        Open

                            foreach ($snmppinfo_item as $item=>$iarr) {

        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

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

                        if (preg_match('/^(.+) = Hex-STRING:\s(.+)/', $line, $linetmp)) {
                            $hexchars = explode(" ", trim($linetmp[2]));
                            $newstring = "";
                            foreach ($hexchars as $hexchar) {
                                $hexint = hexdec($hexchar);
        Severity: Major
        Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php and 1 other location - About 3 hrs to fix
        phpsysinfo/plugins/raid/class.raid.inc.php on lines 894..908

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

        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 SNMPPInfo extends PSI_Plugin

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

                            $pn=0;

        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

        The property $_result is not named in camelCase.
        Open

        class SNMPPInfo extends PSI_Plugin
        {
            /**
             * variable, which holds the content of the command
             * @var array

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

        class SNMPPInfo extends PSI_Plugin
        {
            /**
             * variable, which holds the content of the command
             * @var array

        CamelCasePropertyName

        Since: 0.2

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

        Example

        class ClassName {
            protected $property_name;
        }

        Source

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

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

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

                    foreach ($markersupplies_item as $marker=>$snmppinfo_item) {

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

                            foreach ($snmppinfo_item as $item=>$iarr) {

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

            private $_filecontent = array();

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

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

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

                foreach ($this->_result as $printer=>$markersupplies_item) {

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

                    foreach ($markersupplies_item as $marker=>$snmppinfo_item) {

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

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

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

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

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

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

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

            private $_result = array();

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

                foreach ($this->_filecontent as $printer=>$result) {

        Blank line found at end of control structure
        Open

        
        

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

                            foreach ($snmppinfo_item as $item=>$iarr) {

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

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

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

                foreach ($this->_filecontent as $printer=>$result) {

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

                foreach ($this->_result as $printer=>$markersupplies_item) {

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

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

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

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

        Line exceeds 120 characters; contains 151 characters
        Open

                                    $bufferarr2=snmprealwalk($printer, "public", ".1.3.6.1.2.1.43.11.1.1", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        Line exceeds 120 characters; contains 151 characters
        Open

                                    $bufferarr3=snmprealwalk($printer, "public", ".1.3.6.1.2.1.43.18.1.1", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        Line exceeds 120 characters; contains 140 characters
        Open

                                $bufferarr=snmprealwalk($printer, "public", ".1.3.6.1.2.1.1.5", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        Line exceeds 120 characters; contains 160 characters
        Open

                                    $bufferarr1=snmprealwalk($printer, "public", ".1.3.6.1.4.1.367.3.2.1.2.24.1.1", 1000000 * PSI_SNMP_TIMEOUT_INT, PSI_SNMP_RETRY_INT);

        Line exceeds 120 characters; contains 121 characters
        Open

                        } elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.11\.1\.1\.8\.1\.(.*) = INTEGER:\s(.*)/', $line, $data)) {

        Line exceeds 120 characters; contains 206 characters
        Open

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.2.1.43.18.1.1", $buffer3, PSI_DEBUG);

        Line exceeds 120 characters; contains 153 characters
        Open

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

        Line exceeds 120 characters; contains 121 characters
        Open

                        } elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.11\.1\.1\.7\.1\.(.*) = INTEGER:\s(.*)/', $line, $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 121 characters
        Open

                                if (CommonFunctions::rfts(PSI_APP_ROOT."/data/snmppinfo{$pn}.txt", $buffer) && !empty($buffer)) {

        Line exceeds 120 characters; contains 195 characters
        Open

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

        Line exceeds 120 characters; contains 174 characters
        Open

                                    $xmlsnmppinfo->addAttribute("Level", isset($snmppinfo_item['prtMarkerSuppliesLevelRicoh']) ? $snmppinfo_item['prtMarkerSuppliesLevelRicoh'] : "");

        Line exceeds 120 characters; contains 206 characters
        Open

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.2.1.43.11.1.1", $buffer2, PSI_DEBUG);

        Line exceeds 120 characters; contains 121 characters
        Open

                        } elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.11\.1\.1\.9\.1\.(.*) = INTEGER:\s(.*)/', $line, $data)) {

        Line exceeds 120 characters; contains 178 characters
        Open

                                $xmlsnmppinfo->addAttribute("MaxCapacity", isset($snmppinfo_item['prtMarkerSuppliesMaxCapacity']) ? $snmppinfo_item['prtMarkerSuppliesMaxCapacity'] : "");

        Line exceeds 120 characters; contains 131 characters
        Open

                        } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.367\.3\.2\.1\.2\.24\.1\.1\.5\.(.*) = INTEGER:\s(.*)/', $line, $data)) {

        Line exceeds 120 characters; contains 211 characters
        Open

                                    CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$printer." .1.3.6.1.4.1.367.3.2.1.2.24.1.1", $buffer1, false);

        Line exceeds 120 characters; contains 121 characters
        Open

                        } elseif (preg_match('/^\.1\.3\.6\.1\.2\.1\.43\.18\.1\.1\.2\.1\.(.*) = INTEGER:\s(.*)/', $line, $data)) {

        Line exceeds 120 characters; contains 160 characters
        Open

                                $xmlsnmppinfo->addAttribute("Level", isset($snmppinfo_item['prtMarkerSuppliesLevel']) ? $snmppinfo_item['prtMarkerSuppliesLevel'] : "");

        Line exceeds 120 characters; contains 178 characters
        Open

                                $xmlsnmppinfo->addAttribute("Description", isset($snmppinfo_item['prtMarkerSuppliesDescription']) ? $snmppinfo_item['prtMarkerSuppliesDescription'] : "");

        Line exceeds 120 characters; contains 125 characters
        Open

                                    $xmlsnmppinfo->addAttribute("Description", $snmppinfo_item['prtMarkerSuppliesDescriptionRicoh']);

        Line exceeds 120 characters; contains 130 characters
        Open

                        } elseif (preg_match('/^\.1\.3\.6\.1\.4\.1\.367\.3\.2\.1\.2\.24\.1\.1\.2\.(.*) = STRING:\s(.*)/', $line, $data)) {

        Line exceeds 120 characters; contains 175 characters
        Open

                                $xmlsnmppinfo->addAttribute("SupplyUnit", isset($snmppinfo_item['prtMarkerSuppliesSupplyUnit']) ? $snmppinfo_item['prtMarkerSuppliesSupplyUnit'] : "");

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

                                       $this->_filecontent[$printer] .= "\n".$buffer2;

        Line indented incorrectly; expected 12 spaces, found 8
        Open

                case 'data':

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

                                       $this->_filecontent[$printer] .= "\n".$buffer1;

        Line indented incorrectly; expected 12 spaces, found 8
        Open

                case 'command':

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

                                       $this->_filecontent[$printer] .= "\n".$buffer3;

        Line indented incorrectly; expected 12 spaces, found 8
        Open

                case 'php-snmp':

        The variable $old_err_rep is not named in camelCase.
        Open

            public function __construct($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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 $markersupplies_item is not named in camelCase.
        Open

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

        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($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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 $markersupplies_item is not named in camelCase.
        Open

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

        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($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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 $snmppinfo_item is not named in camelCase.
        Open

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

        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($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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 $xmlsnmppinfo_printer is not named in camelCase.
        Open

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

        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($enc)
            {
                parent::__construct(__CLASS__, $enc);
                switch (strtolower(PSI_PLUGIN_SNMPPINFO_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 $markersupplies_item is not named in camelCase.
        Open

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

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

            public function xml()
            {
                foreach ($this->_result as $printer=>$markersupplies_item) {
                    $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                    $xmlsnmppinfo_printer->addAttribute("Device", $printer);

        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

        There are no issues that match your filters.

        Category
        Status