XoopsModules25x/xoopsinfo

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

Summary

Maintainability
F
3 wks
Test Coverage

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)) {
Severity: Minor
Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 wk to fix

Cognitive Complexity

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

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

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

Further reading

Function execute has a Cognitive Complexity of 311 (exceeds 5 allowed). Consider refactoring.
Open

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

Cognitive Complexity

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

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

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

Further reading

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
Severity: Major
Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 day to fix

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

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

      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)) {
      Severity: Major
      Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 day to fix

        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'])) {
        Severity: Minor
        Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 day to fix

        Cognitive Complexity

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

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

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

        Further reading

        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]);
        Severity: Critical
        Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 4 hrs to fix

          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'])) {
          Severity: Major
          Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 3 hrs to fix

            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

            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;
            Severity: Major
            Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ($batstat != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_STATUS='.$batstat."\n";
              Severity: Major
              Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

                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";
                Severity: Major
                Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

                  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);
                  
                  
                  Severity: Major
                  Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

                    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;
                    Severity: Major
                    Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

                      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;
                      Severity: Major
                      Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

                        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 {
                        Severity: Major
                        Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

                          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 = '';
                                                      }
                          Severity: Major
                          Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 45 mins to fix

                            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")) {
                            Severity: Major
                            Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 40 mins to fix

                              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)) {

                              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;
                                      }

                              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)) {

                              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'])) {

                              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;
                                      }

                              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)) {

                              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'])) {

                              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;
                                      }

                              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');

                              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');

                              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)) {

                              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)) {

                              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)) {

                              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)) {

                              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)) {

                              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)) {

                              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)) {

                              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)

                              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) {

                              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) {

                              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) {

                              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)) {

                              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);
                                                  }

                              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']);
                                                  }

                              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)) {

                              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);

                              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'] = "???";

                              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');

                              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)) {

                              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)) {

                              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";
                                                      }

                              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);
                                                  }

                              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)) {

                              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)) {

                              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) {

                              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) {

                              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);

                              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']);

                              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);
                                                  }

                              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);

                              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")) {

                              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) {

                              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);
                                                  }

                              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);
                                                  }

                              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)) {

                              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)) {

                              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'));

                              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);

                              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);

                              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) {

                              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) {

                              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'] = "???";

                              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) {

                              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)) {

                              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'));

                              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);

                              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";
                                                                  }

                              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);
                                                  }

                              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)) {

                              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) {

                              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) {

                              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);
                                                  }

                              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');
                                              }

                              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);

                              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'] = "???";

                              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)) {

                              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)) {

                              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);

                              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) {

                              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);
                                                  }

                              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)) {

                              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) {

                              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", "%");
                                              }

                              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)) {

                              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'));

                              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'));

                              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'));

                              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);

                              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);
                                                  }

                              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) {

                              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);
                                                  }

                              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'])) {

                              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)

                              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";
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 2 other locations - About 3 hrs to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 460..475
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 616..631

                              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

                              Further Reading

                              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";
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 2 other locations - About 3 hrs to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 426..441
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 616..631

                              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

                              Further Reading

                              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";
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 2 other locations - About 3 hrs to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 426..441
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 460..475

                              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

                              Further Reading

                              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;
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 1 other location - About 1 hr to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 117..128

                              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

                              Further Reading

                              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;
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 1 other location - About 1 hr to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 97..108

                              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

                              Further Reading

                              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])) {
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 2 other locations - About 1 hr to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 357..586
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 365..373

                              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

                              Further Reading

                              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]);
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 2 other locations - About 1 hr to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 357..586
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 373..380

                              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

                              Further Reading

                              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]);
                              Severity: Major
                              Found in phpsysinfo/plugins/bat/class.bat.inc.php and 2 other locations - About 1 hr to fix
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 365..373
                              phpsysinfo/plugins/bat/class.bat.inc.php on lines 373..380

                              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

                              Further Reading

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

                              class BAT extends PSI_Plugin

                              The property $_filecontent is not named in camelCase.
                              Open

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

                              CamelCasePropertyName

                              Since: 0.2

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

                              Example

                              class ClassName {
                                  protected $property_name;
                              }

                              Source

                              The property $_result is not named in camelCase.
                              Open

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

                              CamelCasePropertyName

                              Since: 0.2

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

                              Example

                              class ClassName {
                                  protected $property_name;
                              }

                              Source

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  7: $batstat = 'Charging and High'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 5: $techn = 'NiMH'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

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

                                                              case 2: $techn = 'Unknown'; break;

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

                                                              case 5: $techn = 'NiMH'; break;

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

                                                              case 6: $techn = 'Li-ion'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  2: $batstat = 'AC connected'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

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

                                                              case  4: $batstat = 'Low'; break;

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

                                                              case  8: $batstat = 'Charging and Low'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  8: $batstat = 'Charging and Low'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 11: $batstat = 'Partially Charged'; break;

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

                                                              case 4: $techn = 'NiCd'; break;

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

                                                              case 5: $techn = 'NiMH'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 5: $techn = 'NiMH'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  1: $batstat = 'Discharging'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  1: $batstat = 'Discharging'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  7: $batstat = 'Charging and High'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  8: $batstat = 'Charging and Low'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  9: $batstat = 'Charging and Critical'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 11: $batstat = 'Partially Charged'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 3: $techn = 'PbAc'; break;

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

                                                              case 6: $techn = 'Li-ion'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 3: $techn = 'PbAc'; break;

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

                                  private $_filecontent = array();

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  3: $batstat = 'Fully Charged'; break;

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

                                                              case  7: $batstat = 'Charging and High'; break;

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

                                                              case 8: $techn = 'Li-poly'; break;

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

                                  private $_result = array();

                              Terminating statement must be on a line by itself
                              Open

                                                              case  5: $batstat = 'Critical'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 4: $techn = 'NiCd'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 4: $techn = 'NiCd'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 4: $techn = 'NiCd'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 5: $techn = 'NiMH'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  4: $batstat = 'Low'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  4: $batstat = 'Low'; break;

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

                                                              case  5: $batstat = 'Critical'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  5: $batstat = 'Critical'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  6: $batstat = 'Charging'; break;

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

                                                              case 11: $batstat = 'Partially Charged'; break;

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

                                                              default: $batstat = '';

                              Terminating statement must be on a line by itself
                              Open

                                                              case 1: $techn = 'Other'; break;

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

                                                              case 3: $techn = 'PbAc'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 3: $techn = 'PbAc'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

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

                                                              case 4: $techn = 'NiCd'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  4: $batstat = 'Low'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  5: $batstat = 'Critical'; break;

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

                                                              case 3: $techn = 'PbAc'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 4: $techn = 'NiCd'; break;

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

                                                              case  1: $batstat = 'Discharging'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 1: $techn = 'Other'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 3: $techn = 'PbAc'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

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

                                                              case  2: $batstat = 'AC connected'; break;

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

                                                              case 2: $techn = 'Unknown'; break;

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

                                                              case 1: $techn = 'Other'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

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

                                                              case  6: $batstat = 'Charging'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  8: $batstat = 'Charging and Low'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  9: $batstat = 'Charging and Critical'; break;

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

                                                              case 10: $batstat = 'Undefined'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 1: $techn = 'Other'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

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

                                                              case  3: $batstat = 'Fully Charged'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  3: $batstat = 'Fully Charged'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 10: $batstat = 'Undefined'; break;

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

                                                              case 1: $techn = 'Other'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 5: $techn = 'NiMH'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  3: $batstat = 'Fully Charged'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  9: $batstat = 'Charging and Critical'; break;

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

                                                              case 7: $techn = 'Zinc-air'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  2: $batstat = 'AC connected'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  2: $batstat = 'AC connected'; break;

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

                                                              case  9: $batstat = 'Charging and Critical'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 10: $batstat = 'Undefined'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  1: $batstat = 'Discharging'; break;

                              CASE keyword must be followed by a single space
                              Open

                                                              case  6: $batstat = 'Charging'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case  6: $batstat = 'Charging'; break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case  7: $batstat = 'Charging and High'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 1: $techn = 'Other'; break;

                              Each PHP statement must be on a line by itself
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

                              Blank line found at end of control structure
                              Open

                              
                              

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

                                          break;

                              Terminating statement must be on a line by itself
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

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

                                                              case 8: $techn = 'Li-poly'; break;

                              Blank line found at end of control structure
                              Open

                              
                              

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

                                                              case 7: $techn = 'Zinc-air'; break;

                              Blank line found at end of control structure
                              Open

                              
                              

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

                                          break;

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

                                          break;

                              Blank line found at end of control structure
                              Open

                              
                              

                              Line exceeds 120 characters; contains 125 characters
                              Open

                                                  $bufferBFCC = CommonFunctions::getWMI($_wmi, 'BatteryFullChargedCapacity', array('FullChargedCapacity'));

                              Line exceeds 120 characters; contains 132 characters
                              Open

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.($bufferWPB[$bi]['DesignVoltage']*1000)."\n";

                              Line exceeds 120 characters; contains 132 characters
                              Open

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

                              Inline control structures are not allowed
                              Open

                                                          if ($batstat != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_STATUS='.$batstat."\n";

                              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.");

                              Line exceeds 120 characters; contains 182 characters
                              Open

                                                  $bufferWPB = CommonFunctions::getWMI($_cim, 'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity', 'FullChargeCapacity', 'Manufacturer'));

                              Line exceeds 120 characters; contains 136 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max_design'))!==null) {

                              Line exceeds 120 characters; contains 177 characters
                              Open

                                              $bufferWB = CommonFunctions::getWMI($_cim, 'Win32_Battery', array('Caption', 'Name', 'EstimatedChargeRemaining', 'DesignVoltage', 'BatteryStatus', 'Chemistry'));

                              Line exceeds 120 characters; contains 132 characters
                              Open

                                                              $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.($bufferBS[$bi]['RemainingCapacity']*1000)."\n";

                              Inline control structures are not allowed
                              Open

                                                      if ($techn != '') $buffer[$bi]['info'] .= 'POWER_SUPPLY_TECHNOLOGY='.$techn."\n";

                              Inline control structures are not allowed
                              Open

                                                          if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['DesignCapacity']*10)."\n");

                              Line exceeds 120 characters; contains 123 characters
                              Open

                                                              $buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferBS[$bi]['Voltage']*1000)."\n";

                              Line exceeds 120 characters; contains 162 characters
                              Open

                                                          if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['DesignCapacity']*10)."\n");

                              Line exceeds 120 characters; contains 126 characters
                              Open

                                                          if (CommonFunctions::rfts($batdevices[$i], $pbuffer, 1, 4096, false) && trim($pbuffer[0]==="1")) {

                              Line exceeds 120 characters; contains 133 characters
                              Open

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[$bi]['DesignCapacity']*1000)."\n";

                              Line exceeds 120 characters; contains 126 characters
                              Open

                                                      if (!isset($bufferWPB[$bi]['FullChargeCapacity']) && isset($bufferBFCC[$bi]['FullChargedCapacity'])) {

                              Inline control structures are not allowed
                              Open

                                                          if (isset($bufferWPB[$bi]['DesignCapacity']) && ($bufferWPB[$bi]['DesignCapacity']>0))

                              Line exceeds 120 characters; contains 126 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_vol'))!==null) {

                              Line exceeds 120 characters; contains 128 characters
                              Open

                                              } elseif (preg_match('/^native-path:\s*(.*)$/', $roworig, $data) && isset($data[1][0]) && ($data[1][0]!=='/')) {

                              Inline control structures are not allowed
                              Open

                                          if (sizeof($bat)>0) $this->_result[$bi] = $bat;

                              Line exceeds 120 characters; contains 136 characters
                              Open

                                          if ((!isset($bat_item['remaining_capacity']) || (isset($bat_item['full_capacity']) && ($bat_item['full_capacity'] == 0))) &&

                              Line exceeds 120 characters; contains 128 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_now'))!==null) {

                              Line exceeds 120 characters; contains 124 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/health'))!==null) {

                              Line exceeds 120 characters; contains 135 characters
                              Open

                                                                 && (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/serial_number'))!==null)) {

                              Line exceeds 120 characters; contains 139 characters
                              Open

                                                              CommonFunctions::rfts(preg_replace('/\/present$/', '/uevent', $batdevices[$i]), $infoitem, 0, 4096, false);

                              Line exceeds 120 characters; contains 133 characters
                              Open

                                                                 || (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max'))!==null)) {

                              Line exceeds 120 characters; contains 129 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_full'))!==null) {

                              Line exceeds 120 characters; contains 124 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/status'))!==null) {

                              Line exceeds 120 characters; contains 124 characters
                              Open

                                                  $xmlbat->addAttribute("RemainingCapacity", round($bat_item['capacity']*$bat_item['full_capacity']/100));

                              Inline control structures are not allowed
                              Open

                                          if (isset($this->_filecontent[$bi]['info'])) foreach ($this->_filecontent[$bi]['info'] as $roworig) {

                              Line exceeds 120 characters; contains 123 characters
                              Open

                                              } elseif (preg_match('/^hw.sensors.acpibat0.watthour3=(.*) Wh \(remaining capacity\)/', $roworig, $data)) {

                              Line exceeds 120 characters; contains 129 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_full'))!==null) {

                              Line exceeds 120 characters; contains 127 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_temp'))!==null) {

                              Line exceeds 120 characters; contains 128 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_now'))!==null) {

                              Line exceeds 120 characters; contains 130 characters
                              Open

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL='.($bufferWPB[$bi]['FullChargeCapacity']*1000)."\n";

                              Line exceeds 120 characters; contains 126 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/capacity'))!==null) {

                              Line exceeds 120 characters; contains 133 characters
                              Open

                                                             (($bufferBS[$bi]['RemainingCapacity']>0) || ($hasvolt && ($bufferBS[$bi]['RemainingCapacity']==0)))) {

                              Inline control structures are not allowed
                              Open

                                                          if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['FullChargeCapacity']*10)."\n");

                              Line exceeds 120 characters; contains 124 characters
                              Open

                                                             && !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/DisplayDevice/', $infoitem)) {

                              Line exceeds 120 characters; contains 143 characters
                              Open

                                                          $rfts_bs = CommonFunctions::rfts(preg_replace('/\/info$/', '/state', $batdevices[$i]), $stateitem, 0, 4096, false);

                              Line exceeds 120 characters; contains 135 characters
                              Open

                                                              if ((($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_min_design'))!==null)

                              Line exceeds 120 characters; contains 129 characters
                              Open

                                                              $buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferWB[$bi]['DesignVoltage']*1000)."\n";

                              Line exceeds 120 characters; contains 166 characters
                              Open

                                                          if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.(round($capacity*$bufferWPB[$bi]['FullChargeCapacity']*10)."\n");

                              Inline control structures are not allowed
                              Open

                                                  if ($data[1]>0) $bat['battery_temperature'] = $data[1]/100;

                              Line exceeds 120 characters; contains 137 characters
                              Open

                                                              $buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[$bi]['DesignCapacity']*1000)."\n";

                              Line exceeds 120 characters; contains 130 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/manufacturer'))!==null) {

                              Line exceeds 120 characters; contains 129 characters
                              Open

                                                                  if (preg_match('/^\/sys\/class\/power_supply\/(.+)\/present$/', $batdevices[$i], $batname)) {

                              Line exceeds 120 characters; contains 124 characters
                              Open

                                              } elseif (preg_match('/^hw.sensors.acpibat0.watthour0=(.*) Wh \(last full capacity\)$/', $roworig, $data)) {

                              Inline control structures are not allowed
                              Open

                                                          if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_CAPACITY='.$capacity."\n";

                              Inline control structures are not allowed
                              Open

                                          if (isset($this->_filecontent[$bi]['state'])) foreach ($this->_filecontent[$bi]['state'] as $roworig) {

                              Line exceeds 120 characters; contains 121 characters
                              Open

                                              } elseif (preg_match('/^hw.sensors.acpibat0.watthour4=(.*) Wh \(design capacity\)$/', $roworig, $data)) {

                              Line exceeds 120 characters; contains 129 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_now'))!==null) {

                              Line exceeds 120 characters; contains 122 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/temp'))!==null) {

                              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'])) {

                              Line exceeds 120 characters; contains 128 characters
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/technology'))!==null) {

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

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

                                                      $buffer[$bi]['info'] = '';

                              Closing brace must be on a line by itself
                              Open

                                                              case  1: $batstat = 'Discharging'; break;

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $bufferBS = CommonFunctions::getWMI($_wmi, 'BatteryStatus', array('RemainingCapacity', 'Voltage'));

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWB[$bi]['Chemistry'])) {

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 1: $techn = 'Other'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 5: $techn = 'NiMH'; break;

                              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.");

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  if (sizeof($bufferWPB) != $sobWB) {

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

                                                      $buffer[$bi]['state'] = '';

                              Closing brace must be on a line by itself
                              Open

                                                              case  6: $batstat = 'Charging'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case  7: $batstat = 'Charging and High'; break;

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

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_MANUFACTURER='.$bufferWPB[$bi]['Manufacturer']."\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 3: $techn = 'PbAc'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

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

                                              $_cim = null; //root\CIMv2

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Closing brace must be on a line by itself
                              Open

                                                              case 3: $techn = 'PbAc'; break;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          switch ($bufferWPB[$bi]['Chemistry']) {

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  5: $batstat = 'Critical'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 10: $batstat = 'Undefined'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 4: $techn = 'NiCd'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 4: $techn = 'NiCd'; break;

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if (sizeof($bufferWB)>0) {

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  for ($bi = 0; $bi < $sobWB; $bi++) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Closing brace must be on a line by itself
                              Open

                                                              case 1: $techn = 'Other'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

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

                                                      $capacity = '';

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWB[$bi]['BatteryStatus'])) {

                              Closing brace must be on a line by itself
                              Open

                                                              case  9: $batstat = 'Charging and Critical'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 11: $batstat = 'Partially Charged'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 10: $batstat = 'Undefined'; break;

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

                                                      $techn = '';

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 4: $techn = 'NiCd'; break;

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWPB[$bi]['Manufacturer'])) {

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if ((($techn == '') || ($techn == 'Unknown')) && isset($bufferWPB[$bi]['Chemistry'])) {

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

                                                      $bufferBFCC = array();

                              Closing brace must be on a line by itself
                              Open

                                                              case  5: $batstat = 'Critical'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case  8: $batstat = 'Charging and Low'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 11: $batstat = 'Partially Charged'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              default: $batstat = '';

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Closing brace must be on a line by itself
                              Open

                                                              case 1: $techn = 'Other'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWPB[$bi]['DesignVoltage'])) {

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

                                              $_wmi = null; //root\WMI

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $_wmi = $objLocatorWMI->ConnectServer('', 'root\WMI');

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

                                              $bufferWB = CommonFunctions::getWMI($_cim, 'Win32_Battery', array('Caption', 'Name', 'EstimatedChargeRemaining', 'DesignVoltage', 'BatteryStatus', 'Chemistry'));

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $bufferBFCC = CommonFunctions::getWMI($_wmi, 'BatteryFullChargedCapacity', array('FullChargedCapacity'));

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

                                                      $bufferBCC = array();

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

                                                          $capacity = $bufferWB[$bi]['EstimatedChargeRemaining'];

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  8: $batstat = 'Charging and Low'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 5: $techn = 'NiMH'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 5: $techn = 'NiMH'; break;

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

                                                              $buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferWB[$bi]['DesignVoltage']*1000)."\n";

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  if ($info !== '') {

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          if (preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\//', $infoitem)

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

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

                                                                  $stateitem .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.$buffer1."\n";

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $bufferBCC = CommonFunctions::getWMI($_wmi, 'BatteryCycleCount', array('CycleCount'));

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $sobWB = sizeof($bufferWB);

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          switch ($bufferWB[$bi]['BatteryStatus']) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  4: $batstat = 'Low'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case  4: $batstat = 'Low'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  7: $batstat = 'Charging and High'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 1: $techn = 'Other'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 3: $techn = 'PbAc'; break;

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              try {

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              } catch (Exception $e) {

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  if (sizeof($bufferBS) != $sobWB) {

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

                                                      $bufferBS = array();

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

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_VOLTAGE_MIN_DESIGN='.($bufferWPB[$bi]['DesignVoltage']*1000)."\n";

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

                                                              $buffer[$bi]['state'] .= 'POWER_SUPPLY_VOLTAGE_NOW='.($bufferBS[$bi]['Voltage']*1000)."\n";

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $objLocatorCIM = new COM('WbemScripting.SWbemLocator');

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

                                                      $bufferWPB = array();

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  2: $batstat = 'AC connected'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case  2: $batstat = 'AC connected'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  3: $batstat = 'Fully Charged'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 3: $techn = 'PbAc'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          if (isset($bufferBS[$bi]['Voltage']) && ($bufferBS[$bi]['Voltage']>0)) {

                              Line indented incorrectly; expected 12 spaces, found 8
                              Open

                                      case 'command':

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $_cim = $objLocatorCIM->ConnectServer('', 'root\CIMv2');

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  if (sizeof($bufferBFCC) != $sobWB) {

                              Closing brace must be on a line by itself
                              Open

                                                              case 2: $techn = 'Unknown'; break;

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (sizeof($bufferBS)>0) {

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          if (PSI_OS == 'WINNT') {

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $objLocatorWMI = new COM('WbemScripting.SWbemLocator');

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $bufferWPB = CommonFunctions::getWMI($_cim, 'Win32_PortableBattery', array('DesignVoltage', 'Chemistry', 'DesignCapacity', 'FullChargeCapacity', 'Manufacturer'));

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWB[$bi]['EstimatedChargeRemaining'])) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  1: $batstat = 'Discharging'; break;

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

                                                          if ($batstat != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_STATUS='.$batstat."\n";

                              Closing brace must be on a line by itself
                              Open

                                                              case 4: $techn = 'NiCd'; break;

                              Closing brace must be on a line by itself
                              Open

                                                              case 5: $techn = 'NiMH'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  if (sizeof($bufferBCC) != $sobWB) {

                              Closing brace must be on a line by itself
                              Open

                                                              case  3: $batstat = 'Fully Charged'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  6: $batstat = 'Charging'; break;

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              case  9: $batstat = 'Charging and Critical'; break;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          switch ($bufferWB[$bi]['Chemistry']) {

                              Closing brace must be on a line by itself
                              Open

                                                              case 6: $techn = 'Li-ion'; break;

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

                                                              $hasvolt = true;

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

                                              $buffer[0]['info'] = '';

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

                                              $itemcount = 0;

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

                                                      $infoarray = preg_split("/(?=^Device:|^Daemon:)/m", $info);

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

                                                             && !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/DisplayDevice/', $infoitem)) {

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          if (($rfts_bi && ($infoitem!=='')) || ($rfts_bs && ($stateitem!==''))) {

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

                                                              $itemcount++;

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

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

                                                          $pbuffer = '';

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          if (CommonFunctions::rfts($batdevices[$i], $pbuffer, 1, 4096, false) && trim($pbuffer[0]==="1")) {

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

                                                              $infoitem = '';

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWPB[$bi]['FullChargeCapacity'])) {

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

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL_DESIGN='.($bufferWPB[$bi]['DesignCapacity']*1000)."\n";

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

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_CYCLE_COUNT='.$bufferBCC[$bi]['CycleCount']."\n";

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

                                                                  $buffer[$itemcount]['state'] = $stateitem;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          } elseif (isset($bufferWB[$bi]['DesignVoltage']) && ($bufferWB[$bi]['DesignVoltage']>0)) {

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if ($itemcount == 0) {

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

                                                          $bufferWPB[$bi]['FullChargeCapacity'] = $bufferBFCC[$bi]['FullChargedCapacity'];

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if ($buffer[0]['info'] !== '') {

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

                                              CommonFunctions::executeProgram('sysctl', 'hw.sensors.acpibat0', $buffer[0]['info'], false);

                              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);

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_now'))!==null) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_full'))!==null) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

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

                                                                  $stateitem .= 'POWER_SUPPLY_CAPACITY='.$buffer1."\n";

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

                                                                 && (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/serial_number'))!==null)) {

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

                                                                      $buffer[$itemcount]['info'] = $infoitem;

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  if ($stateitem!=='') {

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          }

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

                                          CommonFunctions::rfts(PSI_APP_ROOT."/data/bat_info.txt", $info);

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_temp'))!==null) {

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

                                                  $buffer[$itemcount++]['info'] = $infoitem;

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

                                          $this->global_error->addConfigError("__construct()", "[bat] ACCESS");

                              Closing brace must be on a line by itself
                              Open

                                                              case 7: $techn = 'Zinc-air'; break;

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

                                                              $capacity = '';

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (!isset($bufferWPB[$bi]['FullChargeCapacity']) && isset($bufferBFCC[$bi]['FullChargedCapacity'])) {

                              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");

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

                                              CommonFunctions::executeProgram('ioreg', '-w0 -l -n AppleSmartBattery -r', $buffer[0]['info'], false);

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

                                              $buffer[0]['info'] = '';

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

                                                                  $stateitem .= 'POWER_SUPPLY_ENERGY_FULL='.$buffer1."\n";

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  if (preg_match('/^\/sys\/class\/power_supply\/(.+)\/present$/', $batdevices[$i], $batname)) {

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

                              Line indented incorrectly; expected at least 20 spaces, found 19
                              Open

                                                 && !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/DisplayDevice/', $infoitem)) {

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          if ($itemcount == 0) {

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

                                                      if ($techn != '') $buffer[$bi]['info'] .= 'POWER_SUPPLY_TECHNOLOGY='.$techn."\n";

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      foreach ($infoarray as $infoitem) { //upower detection

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

                                                             && !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/line_power/', $infoitem)

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if ($stateitem!=='') {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/capacity'))!==null) {

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

                                                                  $stateitem .= 'POWER_SUPPLY_STATUS='.$buffer1."\n";

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

                                                                  $stateitem .= 'POWER_SUPPLY_MANUFACTURER='.$buffer1."\n";

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  }

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if (preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\//', $infoitem)

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

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

                                                          $buffer[$bi]['info'] .= 'POWER_SUPPLY_ENERGY_FULL='.($bufferWPB[$bi]['FullChargeCapacity']*1000)."\n";

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferBCC[$bi]['CycleCount']) && ($bufferBCC[$bi]['CycleCount']>0)) {

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          } elseif (PSI_OS == 'Darwin') {

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          } elseif (PSI_OS == 'FreeBSD') {

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

                                                             $buffer[$itemcount++]['info'] = $infoitem;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  if (is_array($batdevices) && (($total = count($batdevices)) > 0)) {

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      for ($i = 0; $i < $total; $i++) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

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

                                                                 || (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max'))!==null)) {

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

                                                                  $stateitem .= 'POWER_SUPPLY_VOLTAGE_MAX_DESIGN='.$buffer1."\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/energy_now'))!==null) {

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  }

                              Line indented incorrectly; expected 12 spaces, found 8
                              Open

                                      case 'data':

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      } else {

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

                                              CommonFunctions::executeProgram('acpiconf', '-i batt', $buffer[0]['info'], false);

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

                                              $buffer[0]['info'] = '';

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

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

                                                          $infoitem = '';

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if ($infoitem!=='') {

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      for ($i = 0; $i < $total; $i++) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if ((($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_min_design'))!==null)

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/health'))!==null) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/manufacturer'))!==null) {

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  if ($infoitem!=='') {

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

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

                                                                  $stateitem .= 'POWER_SUPPLY_HEALTH='.$buffer1."\n";

                              Closing brace must be on a line by itself
                              Open

                                                              case 8: $techn = 'Li-poly'; break;

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if ($buffer[0]['info'] !== '') {

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          } else {

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if ($itemcount == 0) {

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  } else {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_full'))!==null) {

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

                                                                  $stateitem .= 'POWER_SUPPLY_VOLTAGE_NOW='.$buffer1."\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($stateitem!=='') || ($infoitem!=='')) {

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

                                                                      $stateitem .= 'POWER_SUPPLY_NAME='.$batname[1]."\n";

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

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

                                              $buffer[0]['info'] = $info;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if ((PSI_OS == 'Linux') && defined('PSI_PLUGIN_BAT_UPOWER') && PSI_PLUGIN_BAT_UPOWER) {

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $info = '';

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $batdevices = glob('/proc/acpi/battery/BAT*/info', GLOB_NOSORT);

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

                                                          $rfts_bi = CommonFunctions::rfts($batdevices[$i], $infoitem, 0, 4096, false);

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

                                                                      $infoitem .= 'POWER_SUPPLY_NAME='.$batname[1]."\n";

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

                                                              CommonFunctions::rfts(preg_replace('/\/present$/', '/uevent', $batdevices[$i]), $infoitem, 0, 4096, false);

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

                                                                  $stateitem .= 'POWER_SUPPLY_TECHNOLOGY='.$buffer1."\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/temp'))!==null) {

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  }

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          }

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

                                          CommonFunctions::rfts(PSI_APP_ROOT."/data/bat_state.txt", $buffer[0]['state']);

                              Line indented incorrectly; expected 12 spaces, found 8
                              Open

                                      default:

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

                                                          $hasvolt = false;

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWB[$bi]['Name'])) {

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $buffer[0]['info'] .= "POWER_SUPPLY_NAME=batt\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (preg_match('/^\/proc\/acpi\/battery\/(.+)\/info$/', $batdevices[$i], $batname)) {

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/voltage_max_design'))!==null) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

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

                                                              $hasvolt = true;

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          foreach ($infoarray as $infoitem) { //upower detection

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

                                                          if (isset($bufferWPB[$bi]['DesignCapacity']) && ($bufferWPB[$bi]['DesignCapacity']>0))

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $buffer[0]['info'] .= "POWER_SUPPLY_NAME=AppleSmartBattery\n";

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

                              Line indented incorrectly; expected 16 spaces, found 12
                              Open

                                          } elseif (PSI_OS == 'OpenBSD') {

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $buffer[0]['info'] .= "POWER_SUPPLY_NAME=acpibat0\n";

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  $batdevices = glob('/sys/class/power_supply/[Bb][Aa][Tt]*/present', GLOB_NOSORT);

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/status'))!==null) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

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

                                                                  $stateitem .= 'POWER_SUPPLY_TEMP='.$buffer1."\n";

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

                                                              $buffer[$bi]['state'] .= 'POWER_SUPPLY_ENERGY_NOW='.($bufferBS[$bi]['RemainingCapacity']*1000)."\n";

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

                                                          if ($capacity != '') $buffer[$bi]['state'] .= 'POWER_SUPPLY_CAPACITY='.$capacity."\n";

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              if ($buffer[0]['info'] !== '') {

                              Line indented incorrectly; expected at least 24 spaces, found 20
                              Open

                                                  CommonFunctions::executeProgram('upower', '-d', $info, false);

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

                                                          $stateitem = '';

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  if ($infoitem!=='') {

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

                                                                      $stateitem.= 'POWER_SUPPLY_NAME='.$batname[1]."\n";

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

                                                                  $buffer[$itemcount]['info'] = $infoitem;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          }

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  if (is_array($batdevices) && (($total = count($batdevices)) > 0)) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/technology'))!==null) {

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/batt_vol'))!==null) {

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

                                          $itemcount = 0;

                              Line indented incorrectly; expected 32 spaces, found 28
                              Open

                                                          if (isset($bufferBS[$bi]['RemainingCapacity']) &&

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

                                                             (($bufferBS[$bi]['RemainingCapacity']>0) || ($hasvolt && ($bufferBS[$bi]['RemainingCapacity']==0)))) {

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              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");

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

                                                              $stateitem = '';

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

                                                                  $stateitem .= 'POWER_SUPPLY_CHARGE_FULL='.$buffer1."\n";

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

                                                                  $stateitem .= 'POWER_SUPPLY_SERIAL_NUMBER='.$buffer1."\n";

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

                                          $infoarray = preg_split("/(?=^Device:|^Daemon:)/m", $info);

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      if (isset($bufferWB[$bi]['Caption'])) {

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      } elseif (isset($bufferWPB[$bi]['DesignCapacity']) && ($bufferWPB[$bi]['DesignCapacity']>0)) {

                              Line indented incorrectly; expected 20 spaces, found 16
                              Open

                                              }

                              Line indented incorrectly; expected 24 spaces, found 20
                              Open

                                                  }

                              Line indented incorrectly; expected 40 spaces, found 36
                              Open

                                                                  }

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

                                                                  $stateitem .= 'POWER_SUPPLY_ENERGY_NOW='.$buffer1."\n";

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

                                                                  $stateitem .= 'POWER_SUPPLY_CHARGE_NOW='.$buffer1."\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

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

                                                                      $buffer[$itemcount]['state'] = $stateitem;

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

                                                                  $itemcount++;

                              Line indented incorrectly; expected 28 spaces, found 24
                              Open

                                                      }

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

                                                                  $stateitem .= 'POWER_SUPPLY_VOLTAGE_NOW='.$buffer1."\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (($buffer1 = CommonFunctions::rolv($batdevices[$i], '/\/present$/', '/charge_now'))!==null) {

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

                                                                  $stateitem .= 'POWER_SUPPLY_TEMP='.$buffer1."\n";

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              if (defined('PSI_PLUGIN_BAT_SHOW_SERIAL') && PSI_PLUGIN_BAT_SHOW_SERIAL

                              Line indented incorrectly; expected 36 spaces, found 32
                              Open

                                                              }

                              Line indented incorrectly; expected at least 20 spaces, found 19
                              Open

                                                 && !preg_match('/^Device: \/org\/freedesktop\/UPower\/devices\/line_power/', $infoitem)

                              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)) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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)) {

                              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)) {

                              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'])) {

                              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'])) {

                              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'])) {

                              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)) {

                              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'])) {

                              CamelCaseVariableName

                              Since: 0.2

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

                              Example

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

                              Source

                              There are no issues that match your filters.

                              Category
                              Status