The method __construct() contains an eval expression. Open
$upss = eval(PSI_UPS_SNMPUPS_LIST);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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':
- Read upRead up
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;
}
- Read upRead up
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;
}
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':
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
*
- Exclude checks
Avoid deeply nested control flow statements. Open
if (! empty($bufferarr3)) {
foreach ($bufferarr3 as $id=>$string) {
$buffer .= $id." = ".$string."\n";
}
} }
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':
- Exclude checks
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;
}
- Exclude checks
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':
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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':
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
}
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
}
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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 = "";
- Read upRead up
- Exclude checks
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 = "";
- Read upRead up
- Exclude checks
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
- Exclude checks
The property $_output is not named in camelCase. Open
class SNMPups extends UPS
{
/**
* internal storage for all gathered data
*
- Read upRead up
- Exclude checks
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";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Property name "$_output" should not be prefixed with an underscore to indicate visibility Open
private $_output = array();
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 1: break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 1: break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 5: $status = "Timed Sleeping";
- Exclude checks
The CASE body must start on the line following the statement Open
case 6: $status = "Software Bypass";
- Exclude checks
Terminating statement must be on a line by itself Open
case 2: break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Expected 1 space before "=>"; 0 found Open
foreach ($bufferarr2 as $id=>$string) {
- Exclude checks
Method name "_info" should not be prefixed with an underscore to indicate visibility Open
private function _info()
- Exclude checks
Expected 1 space before "=>"; 0 found Open
foreach ($bufferarr as $id=>$string) {
- Exclude checks
The DEFAULT body must start on the line following the statement Open
default: $batstat = "Battery Unknown (".trim($data[1]).")";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 7: $status = "Off";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Expected 1 space after "=>"; 0 found Open
foreach ($bufferarr3 as $id=>$string) {
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 12:$status = "On Smart Trim";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The DEFAULT body must start on the line following the statement Open
default: $batstat = "Replace Battery (".trim($data[1]).")";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 11:$status = "Sleeping Until Power Returns";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 2: break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 2: $batstat = "Replace Battery";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 8: $status = "Rebooting";
- Exclude checks
Expected 1 space after "=>"; 0 found Open
foreach ($bufferarr2 as $id=>$string) {
- Exclude checks
Expected 1 space before "=>"; 0 found Open
foreach ($bufferarr4 as $id=>$string) {
- Exclude checks
The CASE body must start on the line following the statement Open
case 4: $status = "On Smart Boost";
- Exclude checks
Expected 1 space before "=>"; 0 found Open
foreach ($bufferarr3 as $id=>$string) {
- Exclude checks
Expected 1 space after "=>"; 0 found Open
foreach ($bufferarr4 as $id=>$string) {
- Exclude checks
The CASE body must start on the line following the statement Open
case 1: $status = "Unknown";
- Exclude checks
The CASE body must start on the line following the statement Open
case 9: $status = "Switched Bypass";
- Exclude checks
The CASE body must start on the line following the statement Open
case 1: $batstat = "Battery Unknown";
- Exclude checks
The CASE body must start on the line following the statement Open
case 2: $status = "On Line";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 10:$status = "Hardware Failure Bypass";
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 3: $batstat = "Battery Low";
- Exclude checks
Expected 1 space after "=>"; 0 found Open
foreach ($bufferarr as $id=>$string) {
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
The DEFAULT body must start on the line following the statement Open
default: $status = "Unknown state (".trim($data[1]).")";
- Exclude checks
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);
- Exclude checks
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);
- Exclude checks
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);
- Exclude checks
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)) {
- Exclude checks
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
- Exclude checks
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);
- Exclude checks
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);
- Exclude checks
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");
- Exclude checks
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);
- Exclude checks
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);
- Exclude checks
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);
- Exclude checks
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
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
if (! empty($bufferarr3)) {
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 19 Open
default: $batstat = "Replace Battery (".trim($data[1]).")";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
foreach ($bufferarr3 as $id=>$string) {
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$buffer .= $id." = ".$string."\n";
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
} }
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
case 'php-snmp':
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 19 Open
default: $batstat = "Battery Unknown (".trim($data[1]).")";
- Exclude checks
Closing brace must be on a line by itself Open
case 1: break;
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 15 Open
$dev->setStatus(trim($status));
- Exclude checks
Closing brace must be on a line by itself Open
} }
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
case 'command':
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 19 Open
default: $status = "Unknown state (".trim($data[1]).")";
- Exclude checks
Closing brace must be on a line by itself Open
case 2: break;
- Exclude checks
The variable $old_err_rep is not named in camelCase. Open
public function __construct()
{
parent::__construct();
switch (strtolower(PSI_UPS_SNMPUPS_ACCESS)) {
case 'command':
- Read upRead up
- Exclude checks
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':
- Read upRead up
- Exclude checks
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':
- Read upRead up
- Exclude checks
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':
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}