Function __construct
has a Cognitive Complexity of 365 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 execute
has a Cognitive Complexity of 311 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
if (empty($this->_filecontent)) {
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
File class.bat.inc.php
has 710 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* BAT Plugin, which displays battery state
*
* @category PHP
Method execute
has 314 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
if (empty($this->_filecontent)) {
return;
}
Method __construct
has 294 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
Function xml
has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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
Consider simplifying this complex logical expression. Open
if (preg_match('/^[dD]esign capacity:\s*(.*) (.*)$/', $roworig, $data)
|| preg_match('/^energy-full-design:\s*(.*) (.*)$/', $roworig, $data)) {
$bat['design_capacity'] = str_replace(',', '.', $data[1])+0;
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = trim($data[2]);
Method xml
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
The class BAT has an overall complexity of 334 which is very high. The configured complexity threshold is 50. Open
class BAT extends PSI_Plugin
{
/**
* variable, which holds the content of the command
* @var array
- Exclude checks
Avoid deeply nested control flow statements. Open
switch ($bufferWB[$bi]['Chemistry']) {
case 1: $techn = 'Other'; break;
case 2: $techn = 'Unknown'; break;
case 3: $techn = 'PbAc'; break;
case 4: $techn = 'NiCd'; break;
Avoid deeply nested control flow statements. Open
if ($batstat != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_STATUS='.$batstat."\n";
Avoid deeply nested control flow statements. Open
if (isset($bufferBS[$bi]['Voltage']) && ($bufferBS[$bi]['Voltage']>0)) {
$buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferBS[$bi]['Voltage']*1000)."\n";
$hasvolt = true;
} elseif (isset($bufferWB[$bi]['DesignVoltage']) && ($bufferWB[$bi]['DesignVoltage']>0)) {
$buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferWB[$bi]['DesignVoltage']*1000)."\n";
Avoid deeply nested control flow statements. Open
if (CommonFunctions::rfts($batdevices[$i], $pbuffer, 1, 4096, false) && trim($pbuffer[0]==="1")) {
$infoitem = '';
$stateitem = '';
CommonFunctions::rfts(preg_replace('/\/present$/', '/uevent', $batdevices[$i]), $infoitem, 0, 4096, false);
Avoid deeply nested control flow statements. Open
switch ($bufferWB[$bi]['BatteryStatus']) {
case 1: $batstat = 'Discharging'; break;
case 2: $batstat = 'AC connected'; break;
case 3: $batstat = 'Fully Charged'; break;
case 4: $batstat = 'Low'; break;
Avoid deeply nested control flow statements. Open
switch ($bufferWPB[$bi]['Chemistry']) {
case 1: $techn = 'Other'; break;
case 2: $techn = 'Unknown'; break;
case 3: $techn = 'PbAc'; break;
case 4: $techn = 'NiCd'; break;
Avoid deeply nested control flow statements. Open
if (($rfts_bi && ($infoitem!=='')) || ($rfts_bs && ($stateitem!==''))) {
if (preg_match('/^\/proc\/acpi\/battery\/(.+)\/info$/', $batdevices[$i], $batname)) {
if ($infoitem!=='') {
$infoitem .= 'POWER_SUPPLY_NAME='.$batname[1]."\n";
} else {
Avoid deeply nested control flow statements. Open
if (isset($bufferBS[$bi]['RemainingCapacity']) &&
(($bufferBS[$bi]['RemainingCapacity']>0) || ($hasvolt && ($bufferBS[$bi]['RemainingCapacity']==0)))) {
$buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.($bufferBS[$bi]['RemainingCapacity']*1000)."\n";
$capacity = '';
}
Consider simplifying this complex logical expression. Open
if (defined('PSI_PLUGIN_BAT_SHOW_SERIAL') && PSI_PLUGIN_BAT_SHOW_SERIAL
&& isset($bat_item['serialnumber'])
&& ($bat_item['serialnumber'] !== "")
&& ($bat_item['serialnumber'] !== "0")
&& ($bat_item['serialnumber'] !== "0000")) {
The method __construct() has 309 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Exclude checks
The method execute() has 332 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function execute()
{
if (empty($this->_filecontent)) {
return;
}
- Exclude checks
The method __construct() has an NPath complexity of 67004933655. The configured NPath complexity threshold is 200. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 xml() has an NPath complexity of 2795521. The configured NPath complexity threshold is 200. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 execute() has an NPath complexity of 18534. The configured NPath complexity threshold is 200. Open
public function execute()
{
if (empty($this->_filecontent)) {
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 __construct() has a Cyclomatic Complexity of 135. The configured cyclomatic complexity threshold is 10. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 xml() has a Cyclomatic Complexity of 43. The configured cyclomatic complexity threshold is 10. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 execute() has a Cyclomatic Complexity of 156. The configured cyclomatic complexity threshold is 10. Open
public function execute()
{
if (empty($this->_filecontent)) {
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
Missing class import via use statement (line '43', column '42'). Open
$objLocatorCIM = new COM('WbemScripting.SWbemLocator');
- 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
Missing class import via use statement (line '47', column '42'). Open
$objLocatorWMI = new COM('WbemScripting.SWbemLocator');
- 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 assigning values to variables in if clauses and the like (line '251', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '278', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '244', column '39'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '245', column '41'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '284', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '269', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '272', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
if ((($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_min_design'))!==null)
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max_design'))!==null) {
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_now'))!==null) {
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_vol'))!==null) {
- 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
&& (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/serial_number'))!==null)) {
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['present_voltage'] = round($data[1]/1000);
}
- 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 xml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (isset($bat_item['full_capacity'])) {
if (isset($bat_item['design_capacity'])) {
$xmlbat->addAttribute("DesignCapacity", $bat_item['design_capacity']);
}
- 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 assigning values to variables in if clauses and the like (line '209', column '52'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
$rfts_bs = CommonFunctions::rfts(preg_replace('/\/info$/', '/state', $batdevices[$i]), $stateitem, 0, 4096, false);
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = "mWh";
} elseif ($bat['capacity_unit'] != "mWh") {
$bat['capacity_unit'] = "???";
- 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 xml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (isset($bat_item['charging_state_i'])) {
$xmlbat->addAttribute("ChargingState", 'Charging');
} elseif (!isset($bat_item['charging_state_e'])) {
$xmlbat->addAttribute("ChargingState", 'Discharging');
- 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 assigning values to variables in if clauses and the like (line '254', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '291', column '41'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_CAPACITY='.$capacity."\n";
}
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['design_voltage_max'] = round($data[1]/1000);
}
- 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 assigning values to variables in if clauses and the like (line '257', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '281', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/health'))!==null) {
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/manufacturer'))!==null) {
- 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::rfts(PSI_APP_ROOT."/data/bat_info.txt", $info);
- 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::rfts(PSI_APP_ROOT."/data/bat_state.txt", $buffer[0]['state']);
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['present_voltage'] = round($data[1]/1000);
}
- 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('ioreg', '-w0 -l -n AppleSmartBattery -r', $buffer[0]['info'], false);
- 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
if (CommonFunctions::rfts($batdevices[$i], $pbuffer, 1, 4096, false) && trim($pbuffer[0]==="1")) {
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_full'))!==null) {
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['design_voltage'] = round($data[1]/1000);
}
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['present_voltage'] = round($data[1]/1000);
}
- 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 assigning values to variables in if clauses and the like (line '248', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '263', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
$bufferWB = CommonFunctions::getWMI($_cim, 'Win32_Battery', array('Caption', 'Name', 'EstimatedChargeRemaining', 'DesignVoltage', 'BatteryStatus', 'Chemistry'));
- 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('sysctl', 'hw.sensors.acpibat0', $buffer[0]['info'], false);
- 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
$rfts_bi = CommonFunctions::rfts($batdevices[$i], $infoitem, 0, 4096, false);
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/capacity'))!==null) {
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/temp'))!==null) {
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = "mWh";
} elseif ($bat['capacity_unit'] != "mWh") {
$bat['capacity_unit'] = "???";
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_now'))!==null) {
- 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 assigning values to variables in if clauses and the like (line '275', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
$bufferBFCC = CommonFunctions::getWMI($_wmi, 'BatteryFullChargedCapacity', array('FullChargedCapacity'));
- 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 {
$itemcount = 0;
if ((PSI_OS == 'Linux') && defined('PSI_PLUGIN_BAT_UPOWER') && PSI_PLUGIN_BAT_UPOWER) {
$info = '';
CommonFunctions::executeProgram('upower', '-d', $info, false);
- 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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$stateitem.= 'POWER_SUPPLY_NAME='.$batname[1]."\n";
}
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['design_voltage'] = round($data[1]/1000);
}
- 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 assigning values to variables in if clauses and the like (line '287', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_now'))!==null) {
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_full'))!==null) {
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['present_voltage'] = round($data[1]/1000);
}
- 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 xml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$xmlbat->addAttribute("ChargingState", 'Unknown state');
}
- 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('upower', '-d', $info, false);
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = "mWh";
} elseif ($bat['capacity_unit'] != "mWh") {
$bat['capacity_unit'] = "???";
- 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 assigning values to variables in if clauses and the like (line '236', column '52'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '266', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
CommonFunctions::executeProgram('acpiconf', '-i batt', $buffer[0]['info'], false);
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_temp'))!==null) {
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['design_voltage_max'] = round($data[1]/1000);
}
- 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
|| (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max'))!==null)) {
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/technology'))!==null) {
- 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 xml uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$xmlbat->addAttribute("FullCapacity", 100);
$xmlbat->addAttribute("RemainingCapacity", $bat_item['capacity']);
$xmlbat->addAttribute("CapacityUnit", "%");
}
- 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 assigning values to variables in if clauses and the like (line '260', column '38'). Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CommonFunctions' in method '__construct'. Open
$bufferWPB = CommonFunctions::getWMI($_cim, 'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity', 'FullChargeCapacity', 'Manufacturer'));
- 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
$bufferBCC = CommonFunctions::getWMI($_wmi, 'BatteryCycleCount', array('CycleCount'));
- 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
$bufferBS = CommonFunctions::getWMI($_wmi, 'BatteryStatus', array('RemainingCapacity', 'Voltage'));
- 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::rfts(preg_replace('/\/present$/', '/uevent', $batdevices[$i]), $infoitem, 0, 4096, false);
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['present_voltage'] = round($data[1]/1000);
}
- 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
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/status'))!==null) {
- 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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$bat['design_voltage'] = round($data[1]/1000);
}
- 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 sizeof() function in for loops. Open
for ($bi = 0; $bi < sizeof($buffer); $bi++) {
if (isset($buffer[$bi]['info'])) {
$this->_filecontent[$bi]['info'] = preg_split("/\n/", $buffer[$bi]['info'], -1, PREG_SPLIT_NO_EMPTY);
}
if (isset($buffer[$bi]['state'])) {
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
Avoid using sizeof() function in for loops. Open
for ($bi = 0; $bi < sizeof($this->_filecontent); $bi++) {
$bat = array();
if (isset($this->_filecontent[$bi]['info'])) foreach ($this->_filecontent[$bi]['info'] as $roworig) {
$roworig = trim($roworig);
if (preg_match('/^[dD]esign capacity:\s*(.*) (.*)$/', $roworig, $data)
- Read upRead up
- Exclude checks
CountInLoopExpression
Since: 2.7.0
Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.
Example
class Foo {
public function bar()
{
$array = array();
for ($i = 0; count($array); $i++) {
// ...
}
}
}
Source https://phpmd.org/rules/design.html#countinloopexpression
Similar blocks of code found in 3 locations. Consider refactoring. Open
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL=(.*)$/', $roworig, $data)) {
$bat['full_capacity'] = ($data[1]/1000);
if ($data[1]>=1000000000) { // µWh or nWh detection
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = "µWh";
- Read upRead up
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 146.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL_DESIGN=(.*)$/', $roworig, $data)) {
$bat['design_capacity'] = ($data[1]/1000);
if ($data[1]>=1000000000) { // µWh or nWh detection
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = "µWh";
- Read upRead up
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 146.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
} elseif (preg_match('/^POWER_SUPPLY_ENERGY_FULL=(.*)$/', $roworig, $data)) {
$bat['full_capacity'] = ($data[1]/1000);
if ($data[1]>=1000000000) { // µWh or nWh detection
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = "µWh";
- Read upRead up
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 146.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (isset($bufferWB[$bi]['Chemistry'])) {
switch ($bufferWB[$bi]['Chemistry']) {
case 1: $techn = 'Other'; break;
case 2: $techn = 'Unknown'; break;
case 3: $techn = 'PbAc'; break;
- Read upRead up
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 109.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ((($techn == '') || ($techn == 'Unknown')) && isset($bufferWPB[$bi]['Chemistry'])) {
switch ($bufferWPB[$bi]['Chemistry']) {
case 1: $techn = 'Other'; break;
case 2: $techn = 'Unknown'; break;
case 3: $techn = 'PbAc'; break;
- Read upRead up
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 109.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
} elseif (preg_match('/^energy:\s*(.*) (.*)$/', $roworig, $data)) {
$bat['remaining_capacity'] = str_replace(',', '.', $data[1])+0;
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = trim($data[2]);
} elseif ($bat['capacity_unit'] != trim($data[2])) {
- Read upRead up
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 102.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
} elseif (preg_match('/^[lL]ast full capacity:\s*(.*) (.*)$/', $roworig, $data)
|| preg_match('/^energy-full:\s*(.*) (.*)$/', $roworig, $data)) {
$bat['full_capacity'] = str_replace(',', '.', $data[1])+0;
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = trim($data[2]);
- Read upRead up
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 102.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
if (preg_match('/^[dD]esign capacity:\s*(.*) (.*)$/', $roworig, $data)
|| preg_match('/^energy-full-design:\s*(.*) (.*)$/', $roworig, $data)) {
$bat['design_capacity'] = str_replace(',', '.', $data[1])+0;
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = trim($data[2]);
- Read upRead up
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 102.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class BAT extends PSI_Plugin
- Exclude checks
The property $_filecontent is not named in camelCase. Open
class BAT extends PSI_Plugin
{
/**
* variable, which holds the content of the command
* @var array
- 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 property $_result is not named in camelCase. Open
class BAT extends PSI_Plugin
{
/**
* variable, which holds the content of the command
* @var array
- 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
Each PHP statement must be on a line by itself Open
case 7: $batstat = 'Charging and High'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 2: $batstat = 'AC connected'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 4: $batstat = 'Low'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 8: $batstat = 'Charging and Low'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 8: $batstat = 'Charging and Low'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 11: $batstat = 'Partially Charged'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 1: $batstat = 'Discharging'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 1: $batstat = 'Discharging'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 7: $batstat = 'Charging and High'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 8: $batstat = 'Charging and Low'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 9: $batstat = 'Charging and Critical'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 11: $batstat = 'Partially Charged'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Property name "$_filecontent" should not be prefixed with an underscore to indicate visibility Open
private $_filecontent = array();
- Exclude checks
Each PHP statement must be on a line by itself Open
case 3: $batstat = 'Fully Charged'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 7: $batstat = 'Charging and High'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Property name "$_result" should not be prefixed with an underscore to indicate visibility Open
private $_result = array();
- Exclude checks
Terminating statement must be on a line by itself Open
case 5: $batstat = 'Critical'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 4: $batstat = 'Low'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 4: $batstat = 'Low'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 5: $batstat = 'Critical'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 5: $batstat = 'Critical'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 6: $batstat = 'Charging'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 11: $batstat = 'Partially Charged'; break;
- Exclude checks
The DEFAULT body must start on the line following the statement Open
default: $batstat = '';
- Exclude checks
Terminating statement must be on a line by itself Open
case 1: $techn = 'Other'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 4: $batstat = 'Low'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 5: $batstat = 'Critical'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 1: $batstat = 'Discharging'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 1: $techn = 'Other'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 2: $batstat = 'AC connected'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 1: $techn = 'Other'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 6: $batstat = 'Charging'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 8: $batstat = 'Charging and Low'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 9: $batstat = 'Charging and Critical'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 10: $batstat = 'Undefined'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 1: $techn = 'Other'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 3: $batstat = 'Fully Charged'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 3: $batstat = 'Fully Charged'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 10: $batstat = 'Undefined'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 1: $techn = 'Other'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 3: $batstat = 'Fully Charged'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 9: $batstat = 'Charging and Critical'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 2: $batstat = 'AC connected'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 2: $batstat = 'AC connected'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 9: $batstat = 'Charging and Critical'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 10: $batstat = 'Undefined'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 1: $batstat = 'Discharging'; break;
- Exclude checks
CASE keyword must be followed by a single space Open
case 6: $batstat = 'Charging'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 6: $batstat = 'Charging'; break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 7: $batstat = 'Charging and High'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 1: $techn = 'Other'; break;
- Exclude checks
Each PHP statement must be on a line by itself Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Terminating statement must be on a line by itself Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
The CASE body must start on the line following the statement Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Blank line found at end of control structure Open
- Exclude checks
The CASE body must start on the line following the statement Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
Blank line found at end of control structure Open
- 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
Blank line found at end of control structure Open
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$bufferBFCC = CommonFunctions::getWMI($_wmi, 'BatteryFullChargedCapacity', array('FullChargedCapacity'));
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.($bufferWPB[$bi]['DesignVoltage']*1000)."\n";
- 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
Inline control structures are not allowed Open
if ($batstat != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_STATUS='.$batstat."\n";
- Exclude checks
Line exceeds 120 characters; contains 228 characters Open
$this->global_error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed.");
- Exclude checks
Line exceeds 120 characters; contains 182 characters Open
$bufferWPB = CommonFunctions::getWMI($_cim, 'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity', 'FullChargeCapacity', 'Manufacturer'));
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max_design'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 177 characters Open
$bufferWB = CommonFunctions::getWMI($_cim, 'Win32_Battery', array('Caption', 'Name', 'EstimatedChargeRemaining', 'DesignVoltage', 'BatteryStatus', 'Chemistry'));
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.($bufferBS[$bi]['RemainingCapacity']*1000)."\n";
- Exclude checks
Inline control structures are not allowed Open
if ($techn != '') $buffer[$bi]['info'] .= 'POWER_SUPPLY_TECHNOLOGY='.$techn."\n";
- Exclude checks
Inline control structures are not allowed Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['DesignCapacity']*10)."\n");
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
$buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferBS[$bi]['Voltage']*1000)."\n";
- Exclude checks
Line exceeds 120 characters; contains 162 characters Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['DesignCapacity']*10)."\n");
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
if (CommonFunctions::rfts($batdevices[$i], $pbuffer, 1, 4096, false) && trim($pbuffer[0]==="1")) {
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[$bi]['DesignCapacity']*1000)."\n";
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
if (!isset($bufferWPB[$bi]['FullChargeCapacity']) && isset($bufferBFCC[$bi]['FullChargedCapacity'])) {
- Exclude checks
Inline control structures are not allowed Open
if (isset($bufferWPB[$bi]['DesignCapacity']) && ($bufferWPB[$bi]['DesignCapacity']>0))
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_vol'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
} elseif (preg_match('/^native-path:\s*(.*)$/', $roworig, $data) && isset($data[1][0]) && ($data[1][0]!=='/')) {
- Exclude checks
Inline control structures are not allowed Open
if (sizeof($bat)>0) $this->_result[$bi] = $bat;
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
if ((!isset($bat_item['remaining_capacity']) || (isset($bat_item['full_capacity']) && ($bat_item['full_capacity'] == 0))) &&
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_now'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/health'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
&& (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/serial_number'))!==null)) {
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
CommonFunctions::rfts(preg_replace('/\/present$/', '/uevent', $batdevices[$i]), $infoitem, 0, 4096, false);
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
|| (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max'))!==null)) {
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_full'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/status'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$xmlbat->addAttribute("RemainingCapacity", round($bat_item['capacity']*$bat_item['full_capacity']/100));
- Exclude checks
Inline control structures are not allowed Open
if (isset($this->_filecontent[$bi]['info'])) foreach ($this->_filecontent[$bi]['info'] as $roworig) {
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
} elseif (preg_match('/^hw.sensors.acpibat0.watthour3=(.*) Wh \(remaining capacity\)/', $roworig, $data)) {
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_full'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_temp'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_now'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL='.($bufferWPB[$bi]['FullChargeCapacity']*1000)."\n";
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/capacity'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
(($bufferBS[$bi]['RemainingCapacity']>0) || ($hasvolt && ($bufferBS[$bi]['RemainingCapacity']==0)))) {
- Exclude checks
Inline control structures are not allowed Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['FullChargeCapacity']*10)."\n");
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
&& !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/DisplayDevice/', $infoitem)) {
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
$rfts_bs = CommonFunctions::rfts(preg_replace('/\/info$/', '/state', $batdevices[$i]), $stateitem, 0, 4096, false);
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
if ((($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_min_design'))!==null)
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferWB[$bi]['DesignVoltage']*1000)."\n";
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['FullChargeCapacity']*10)."\n");
- Exclude checks
Inline control structures are not allowed Open
if ($data[1]>0) $bat['battery_temperature'] = $data[1]/100;
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[$bi]['DesignCapacity']*1000)."\n";
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/manufacturer'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
if (preg_match('/^\/sys\/class\/power_supply\/(.+)\/present$/', $batdevices[$i], $batname)) {
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
} elseif (preg_match('/^hw.sensors.acpibat0.watthour0=(.*) Wh \(last full capacity\)$/', $roworig, $data)) {
- Exclude checks
Inline control structures are not allowed Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_CAPACITY='.$capacity."\n";
- Exclude checks
Inline control structures are not allowed Open
if (isset($this->_filecontent[$bi]['state'])) foreach ($this->_filecontent[$bi]['state'] as $roworig) {
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
} elseif (preg_match('/^hw.sensors.acpibat0.watthour4=(.*) Wh \(design capacity\)$/', $roworig, $data)) {
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_now'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/temp'))!==null) {
- Exclude checks
Line exceeds 120 characters; contains 168 characters Open
if (isset($bat_item['design_voltage_max']) && ($bat_item['design_voltage_max']>0) && ($bat_item['design_voltage_max'] != $bat_item['design_voltage'])) {
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/technology'))!==null) {
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$buffer[$bi]['info'] = '';
- Exclude checks
Closing brace must be on a line by itself Open
case 1: $batstat = 'Discharging'; break;
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$bufferBS = CommonFunctions::getWMI($_wmi, 'BatteryStatus', array('RemainingCapacity', 'Voltage'));
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWB[$bi]['Chemistry'])) {
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 1: $techn = 'Other'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$this->global_error->addError("WMI connect error", "PhpSysInfo can not connect to the WMI interface for security reasons.\nCheck an authentication mechanism for the directory where phpSysInfo is installed.");
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
if (sizeof($bufferWPB) != $sobWB) {
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$buffer[$bi]['state'] = '';
- Exclude checks
Closing brace must be on a line by itself Open
case 6: $batstat = 'Charging'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 7: $batstat = 'Charging and High'; break;
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_MANUFACTURER='.$bufferWPB[$bi]['Manufacturer']."\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$_cim = null; //root\CIMv2
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Closing brace must be on a line by itself Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
switch ($bufferWPB[$bi]['Chemistry']) {
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 5: $batstat = 'Critical'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 10: $batstat = 'Undefined'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if (sizeof($bufferWB)>0) {
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
for ($bi = 0; $bi < $sobWB; $bi++) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Closing brace must be on a line by itself Open
case 1: $techn = 'Other'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$capacity = '';
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWB[$bi]['BatteryStatus'])) {
- Exclude checks
Closing brace must be on a line by itself Open
case 9: $batstat = 'Charging and Critical'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 11: $batstat = 'Partially Charged'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 10: $batstat = 'Undefined'; break;
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$techn = '';
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWPB[$bi]['Manufacturer'])) {
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if ((($techn == '') || ($techn == 'Unknown')) && isset($bufferWPB[$bi]['Chemistry'])) {
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$bufferBFCC = array();
- Exclude checks
Closing brace must be on a line by itself Open
case 5: $batstat = 'Critical'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 8: $batstat = 'Charging and Low'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 11: $batstat = 'Partially Charged'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
default: $batstat = '';
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Closing brace must be on a line by itself Open
case 1: $techn = 'Other'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWPB[$bi]['DesignVoltage'])) {
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$_wmi = null; //root\WMI
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$_wmi = $objLocatorWMI->ConnectServer('', 'root\WMI');
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$bufferWB = CommonFunctions::getWMI($_cim, 'Win32_Battery', array('Caption', 'Name', 'EstimatedChargeRemaining', 'DesignVoltage', 'BatteryStatus', 'Chemistry'));
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$bufferBFCC = CommonFunctions::getWMI($_wmi, 'BatteryFullChargedCapacity', array('FullChargedCapacity'));
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$bufferBCC = array();
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$capacity = $bufferWB[$bi]['EstimatedChargeRemaining'];
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 8: $batstat = 'Charging and Low'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
$buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferWB[$bi]['DesignVoltage']*1000)."\n";
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
if ($info !== '') {
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
if (preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\//', $infoitem)
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected at least 44 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$bufferBCC = CommonFunctions::getWMI($_wmi, 'BatteryCycleCount', array('CycleCount'));
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$sobWB = sizeof($bufferWB);
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
switch ($bufferWB[$bi]['BatteryStatus']) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 4: $batstat = 'Low'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 4: $batstat = 'Low'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 7: $batstat = 'Charging and High'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 1: $techn = 'Other'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
try {
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
} catch (Exception $e) {
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
if (sizeof($bufferBS) != $sobWB) {
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$bufferBS = array();
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.($bufferWPB[$bi]['DesignVoltage']*1000)."\n";
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
$buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferBS[$bi]['Voltage']*1000)."\n";
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$objLocatorCIM = new COM('WbemScripting.SWbemLocator');
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$bufferWPB = array();
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 2: $batstat = 'AC connected'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 2: $batstat = 'AC connected'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 3: $batstat = 'Fully Charged'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 3: $techn = 'PbAc'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
if (isset($bufferBS[$bi]['Voltage']) && ($bufferBS[$bi]['Voltage']>0)) {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
case 'command':
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$_cim = $objLocatorCIM->ConnectServer('', 'root\CIMv2');
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
if (sizeof($bufferBFCC) != $sobWB) {
- Exclude checks
Closing brace must be on a line by itself Open
case 2: $techn = 'Unknown'; break;
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (sizeof($bufferBS)>0) {
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
if (PSI_OS == 'WINNT') {
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$objLocatorWMI = new COM('WbemScripting.SWbemLocator');
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$bufferWPB = CommonFunctions::getWMI($_cim, 'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity', 'FullChargeCapacity', 'Manufacturer'));
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWB[$bi]['EstimatedChargeRemaining'])) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 1: $batstat = 'Discharging'; break;
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
if ($batstat != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_STATUS='.$batstat."\n";
- Exclude checks
Closing brace must be on a line by itself Open
case 4: $techn = 'NiCd'; break;
- Exclude checks
Closing brace must be on a line by itself Open
case 5: $techn = 'NiMH'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
if (sizeof($bufferBCC) != $sobWB) {
- Exclude checks
Closing brace must be on a line by itself Open
case 3: $batstat = 'Fully Charged'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 6: $batstat = 'Charging'; break;
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
case 9: $batstat = 'Charging and Critical'; break;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
switch ($bufferWB[$bi]['Chemistry']) {
- Exclude checks
Closing brace must be on a line by itself Open
case 6: $techn = 'Li-ion'; break;
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
$hasvolt = true;
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$buffer[0]['info'] = '';
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$itemcount = 0;
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
$infoarray = preg_split("/(?=^Device:|^Daemon:)/m", $info);
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 31 Open
&& !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/DisplayDevice/', $infoitem)) {
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
if (($rfts_bi && ($infoitem!=='')) || ($rfts_bs && ($stateitem!==''))) {
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
$itemcount++;
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$pbuffer = '';
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
if (CommonFunctions::rfts($batdevices[$i], $pbuffer, 1, 4096, false) && trim($pbuffer[0]==="1")) {
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
$infoitem = '';
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWPB[$bi]['FullChargeCapacity'])) {
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[$bi]['DesignCapacity']*1000)."\n";
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_CYCLE_COUNT='.$bufferBCC[$bi]['CycleCount']."\n";
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$buffer[$itemcount]['state'] = $stateitem;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
} elseif (isset($bufferWB[$bi]['DesignVoltage']) && ($bufferWB[$bi]['DesignVoltage']>0)) {
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if ($itemcount == 0) {
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$bufferWPB[$bi]['FullChargeCapacity'] = $bufferBFCC[$bi]['FullChargedCapacity'];
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if ($buffer[0]['info'] !== '') {
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
CommonFunctions::executeProgram('sysctl', 'hw.sensors.acpibat0', $buffer[0]['info'], false);
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$rfts_bs = CommonFunctions::rfts(preg_replace('/\/info$/', '/state', $batdevices[$i]), $stateitem, 0, 4096, false);
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_now'))!==null) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_full'))!==null) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_CAPACITY='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 35 Open
&& (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/serial_number'))!==null)) {
- Exclude checks
Line indented incorrectly; expected at least 44 spaces, found 40 Open
$buffer[$itemcount]['info'] = $infoitem;
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
if ($stateitem!=='') {
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
CommonFunctions::rfts(PSI_APP_ROOT."/data/bat_info.txt", $info);
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_temp'))!==null) {
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 20 Open
$buffer[$itemcount++]['info'] = $infoitem;
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
$this->global_error->addConfigError("__construct()", "[bat] ACCESS");
- Exclude checks
Closing brace must be on a line by itself Open
case 7: $techn = 'Zinc-air'; break;
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 32 Open
$capacity = '';
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (!isset($bufferWPB[$bi]['FullChargeCapacity']) && isset($bufferBFCC[$bi]['FullChargedCapacity'])) {
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['FullChargeCapacity']*10)."\n");
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
CommonFunctions::executeProgram('ioreg', '-w0 -l -n AppleSmartBattery -r', $buffer[0]['info'], false);
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$buffer[0]['info'] = '';
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_ENERGY_FULL='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
if (preg_match('/^\/sys\/class\/power_supply\/(.+)\/present$/', $batdevices[$i], $batname)) {
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 19 Open
&& !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/DisplayDevice/', $infoitem)) {
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
if ($itemcount == 0) {
- Exclude checks
Line indented incorrectly; expected at least 28 spaces, found 24 Open
if ($techn != '') $buffer[$bi]['info'] .= 'POWER_SUPPLY_TECHNOLOGY='.$techn."\n";
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
foreach ($infoarray as $infoitem) { //upower detection
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 31 Open
&& !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/line_power/', $infoitem)
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if ($stateitem!=='') {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/capacity'))!==null) {
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_STATUS='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_MANUFACTURER='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if (preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\//', $infoitem)
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL='.($bufferWPB[$bi]['FullChargeCapacity']*1000)."\n";
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferBCC[$bi]['CycleCount']) && ($bufferBCC[$bi]['CycleCount']>0)) {
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
} elseif (PSI_OS == 'Darwin') {
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
} elseif (PSI_OS == 'FreeBSD') {
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 31 Open
$buffer[$itemcount++]['info'] = $infoitem;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
if (is_array($batdevices) && (($total = count($batdevices)) > 0)) {
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
for ($i = 0; $i < $total; $i++) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 35 Open
|| (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max'))!==null)) {
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_VOLTAGE_MAX_DESIGN='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_now'))!==null) {
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
case 'data':
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
} else {
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
CommonFunctions::executeProgram('acpiconf', '-i batt', $buffer[0]['info'], false);
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$buffer[0]['info'] = '';
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$infoitem = '';
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if ($infoitem!=='') {
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
for ($i = 0; $i < $total; $i++) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if ((($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_min_design'))!==null)
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/health'))!==null) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/manufacturer'))!==null) {
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
if ($infoitem!=='') {
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_HEALTH='.$buffer1."\n";
- Exclude checks
Closing brace must be on a line by itself Open
case 8: $techn = 'Li-poly'; break;
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if ($buffer[0]['info'] !== '') {
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
} else {
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if ($itemcount == 0) {
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
} else {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_full'))!==null) {
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_VOLTAGE_NOW='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($stateitem!=='') || ($infoitem!=='')) {
- Exclude checks
Line indented incorrectly; expected at least 44 spaces, found 40 Open
$stateitem .= 'POWER_SUPPLY_NAME='.$batname[1]."\n";
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$buffer[0]['info'] = $info;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if ((PSI_OS == 'Linux') && defined('PSI_PLUGIN_BAT_UPOWER') && PSI_PLUGIN_BAT_UPOWER) {
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$info = '';
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$batdevices = glob('/proc/acpi/battery/BAT*/info', GLOB_NOSORT);
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$rfts_bi = CommonFunctions::rfts($batdevices[$i], $infoitem, 0, 4096, false);
- Exclude checks
Line indented incorrectly; expected at least 44 spaces, found 40 Open
$infoitem .= 'POWER_SUPPLY_NAME='.$batname[1]."\n";
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
CommonFunctions::rfts(preg_replace('/\/present$/', '/uevent', $batdevices[$i]), $infoitem, 0, 4096, false);
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_TECHNOLOGY='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/temp'))!==null) {
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
}
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
CommonFunctions::rfts(PSI_APP_ROOT."/data/bat_state.txt", $buffer[0]['state']);
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
default:
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$hasvolt = false;
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWB[$bi]['Name'])) {
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$buffer[0]['info'] .= "POWER_SUPPLY_NAME=batt\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (preg_match('/^\/proc\/acpi\/battery\/(.+)\/info$/', $batdevices[$i], $batname)) {
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max_design'))!==null) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
$hasvolt = true;
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
foreach ($infoarray as $infoitem) { //upower detection
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
if (isset($bufferWPB[$bi]['DesignCapacity']) && ($bufferWPB[$bi]['DesignCapacity']>0))
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$buffer[0]['info'] .= "POWER_SUPPLY_NAME=AppleSmartBattery\n";
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
} elseif (PSI_OS == 'OpenBSD') {
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$buffer[0]['info'] .= "POWER_SUPPLY_NAME=acpibat0\n";
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
$batdevices = glob('/sys/class/power_supply/[Bb][Aa][Tt]*/present', GLOB_NOSORT);
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/status'))!==null) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_TEMP='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 32 Open
$buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.($bufferBS[$bi]['RemainingCapacity']*1000)."\n";
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_CAPACITY='.$capacity."\n";
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
if ($buffer[0]['info'] !== '') {
- Exclude checks
Line indented incorrectly; expected at least 24 spaces, found 20 Open
CommonFunctions::executeProgram('upower', '-d', $info, false);
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
$stateitem = '';
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
if ($infoitem!=='') {
- Exclude checks
Line indented incorrectly; expected at least 44 spaces, found 40 Open
$stateitem.= 'POWER_SUPPLY_NAME='.$batname[1]."\n";
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$buffer[$itemcount]['info'] = $infoitem;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
if (is_array($batdevices) && (($total = count($batdevices)) > 0)) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/technology'))!==null) {
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_vol'))!==null) {
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
$itemcount = 0;
- Exclude checks
Line indented incorrectly; expected 32 spaces, found 28 Open
if (isset($bufferBS[$bi]['RemainingCapacity']) &&
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 31 Open
(($bufferBS[$bi]['RemainingCapacity']>0) || ($hasvolt && ($bufferBS[$bi]['RemainingCapacity']==0)))) {
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected at least 32 spaces, found 28 Open
if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['DesignCapacity']*10)."\n");
- Exclude checks
Line indented incorrectly; expected at least 36 spaces, found 32 Open
$stateitem = '';
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_CHARGE_FULL='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected at least 44 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_SERIAL_NUMBER='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
$infoarray = preg_split("/(?=^Device:|^Daemon:)/m", $info);
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
if (isset($bufferWB[$bi]['Caption'])) {
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
} elseif (isset($bufferWPB[$bi]['DesignCapacity']) && ($bufferWPB[$bi]['DesignCapacity']>0)) {
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 20 Open
}
- Exclude checks
Line indented incorrectly; expected 40 spaces, found 36 Open
}
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_ENERGY_NOW='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_CHARGE_NOW='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected at least 44 spaces, found 40 Open
$buffer[$itemcount]['state'] = $stateitem;
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$itemcount++;
- Exclude checks
Line indented incorrectly; expected 28 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_VOLTAGE_NOW='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_now'))!==null) {
- Exclude checks
Line indented incorrectly; expected at least 40 spaces, found 36 Open
$stateitem .= 'POWER_SUPPLY_TEMP='.$buffer1."\n";
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
if (defined('PSI_PLUGIN_BAT_SHOW_SERIAL') && PSI_PLUGIN_BAT_SHOW_SERIAL
- Exclude checks
Line indented incorrectly; expected 36 spaces, found 32 Open
}
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 19 Open
&& !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/line_power/', $infoitem)
- Exclude checks
The variable $_wmi is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $rfts_bi is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $rfts_bi is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $rfts_bs is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $_wmi is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $_cim is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $_wmi is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $_cim is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $_cim is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $_wmi is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $_wmi is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $rfts_bs is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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 $_cim is not named in camelCase. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$buffer = array();
switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
- 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 $bat_item is not named in camelCase. Open
public function xml()
{
foreach ($this->_result as $bat_item) {
$xmlbat = $this->xml->addChild("Bat");
if (isset($bat_item['name'])) {
- 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();
}
}