XoopsModules25x/xoopsinfo

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

Summary

Maintainability
F
1 wk
Test Coverage

The method __construct() contains an eval expression.
Open

                            $fullIds = eval(PSI_PLUGIN_SMART_IDS);

EvalExpression

Since: 0.2

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

Example

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

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

The method __construct() contains an eval expression.
Open

                        $disks = eval(PSI_PLUGIN_SMART_DEVICES);

EvalExpression

Since: 0.2

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

Example

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

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

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

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

Cognitive Complexity

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

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

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

Further reading

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

    public function __construct($enc)
    {
        parent::__construct(__CLASS__, $enc);
        switch (strtolower(PSI_PLUGIN_SMART_ACCESS)) {
            case 'wmi':
Severity: Minor
Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function execute()
    {
        if (empty($this->_filecontent) || empty($this->_ids)) {
            return;
        }
Severity: Major
Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 5 hrs to fix

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

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

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

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

      File class.smart.inc.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * SMART plugin, which displays all SMART informations available
       *
       * @category  PHP
      Severity: Minor
      Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 3 hrs to fix

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

            public function xml()
            {
                if (empty($this->_result) || empty($this->_ids)) {
                    return $this->xml->getSimpleXmlElement();
                }
        Severity: Minor
        Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 1 hr to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            public function xml()
            {
                if (empty($this->_result) || empty($this->_ids)) {
                    return $this->xml->getSimpleXmlElement();
                }
        Severity: Minor
        Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                                          if (($id != 0) && ($id != 255)) {
                                              switch ($id) {
                                                  case 3:
                                                      //raw16(avg16)
                                                      $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";
          Severity: Major
          Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 45 mins to fix

            Consider simplifying this complex logical expression.
            Open

                                    if (((in_array($value, array_keys($this->_ids)) && $labels[$j] == 'id') || ($found && (in_array($labels[$j], array_values($this->_ids)))) || ($found && $labels[$j] == 'attribute_name'))) {
                                        $this->_result[$disk][$i][$labels[$j]] = $value;
                                        $found = true;
                                    }
            Severity: Major
            Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 40 mins to fix

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

                  public function execute()
                  {
                      if (empty($this->_filecontent) || empty($this->_ids)) {
                          return;
                      }

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

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

              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 264784905. The configured NPath complexity threshold is 200.
              Open

                  public function execute()
                  {
                      if (empty($this->_filecontent) || empty($this->_ids)) {
                          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 116 lines of code. Current threshold is set to 100. Avoid really long methods.
              Open

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

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

                  public function execute()
                  {
                      if (empty($this->_filecontent) || empty($this->_ids)) {
                          return;
                      }

              CyclomaticComplexity

              Since: 0.1

              Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

              Example

              // Cyclomatic Complexity = 11
              class Foo {
              1   public function example() {
              2       if ($a == $b) {
              3           if ($a1 == $b1) {
                              fiddle();
              4           } elseif ($a2 == $b2) {
                              fiddle();
                          } else {
                              fiddle();
                          }
              5       } elseif ($c == $d) {
              6           while ($c == $d) {
                              fiddle();
                          }
              7        } elseif ($e == $f) {
              8           for ($n = 0; $n < $h; $n++) {
                              fiddle();
                          }
                      } else {
                          switch ($z) {
              9               case 1:
                                  fiddle();
                                  break;
              10              case 2:
                                  fiddle();
                                  break;
              11              case 3:
                                  fiddle();
                                  break;
                              default:
                                  fiddle();
                                  break;
                          }
                      }
                  }
              }

              Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

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

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

              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 10. The configured cyclomatic complexity threshold is 10.
              Open

                  public function xml()
                  {
                      if (empty($this->_result) || empty($this->_ids)) {
                          return $this->xml->getSimpleXmlElement();
                      }

              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 '76', column '43').
              Open

                                      $objLocator = 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

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

              ElseExpression

              Since: 1.4.0

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

              Example

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

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

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

                          } else {
                              //SCSI and MVMe devices
                              if (!empty($this->_ids[1]) && ($this->_ids[1]=="raw_value")) {
                                  if (preg_match('/\nread\: (.*)\n/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);

              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 (trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                                      $asd_wmi = CommonFunctions::getWMI($wmi, 'MSStorageDriver_ATAPISmartData', array('VendorSpecific'));

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

              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 (CommonFunctions::rfts(PSI_APP_ROOT."/data/smart{$dn}.txt", $buffer) && !empty($buffer)) {

              StaticAccess

              Since: 1.4.0

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

              Example

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

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

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

                                      } else {
                                          $diskname = trim($disk);
                                      }

              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 empty try-catch blocks in __construct.
              Open

                                  } catch (Exception $e) {
                                  }

              EmptyCatchBlock

              Since: 2.7.0

              Usually empty try-catch is a bad idea because you are silently swallowing an error condition and then continuing execution. Occasionally this may be the right thing to do, but often it's a sign that a developer saw an exception, didn't know what to do about it, and so used an empty catch to silence the problem.

              Example

              class Foo {
              
                public function bar()
                {
                    try {
                        // ...
                    } catch (Exception $e) {} // empty catch block
                }
              }

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

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

                          foreach ($this->_result as $diskName=>$diskInfos) {

              UnusedLocalVariable

              Since: 0.2

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

              Example

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

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

              Avoid using count() function in for loops.
              Open

                                          for ($c = 2; $c < count($asdvs); $c += 12) {
                                              //Attribute values 0x00, 0xff are invalid
                                              $id = $asdvs[$c];
                                              if (($id != 0) && ($id != 255)) {
                                                  switch ($id) {

              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

                                                      case 3:
                                                          //raw16(avg16)
                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";
                                                          break;
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 2 other locations - About 5 hrs to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 97..100
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 107..110

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

              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

                                                      case 196:
                                                          //raw16(raw16)
                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";
                                                          break;
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 2 other locations - About 5 hrs to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 92..95
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 107..110

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

              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

                                                      case 194:
                                                          //tempminmax
                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";
                                                          break;
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 2 other locations - About 5 hrs to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 92..95
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 97..100

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

              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 (!empty($this->_ids[12]) && ($this->_ids[12]=="raw_value")) {
                                  if (preg_match('/\nPower Cycles\: (.*)\n/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);
                                      if (!empty($values) && ($values[2]!=null)) {
                                          $vals=preg_replace('/,/', '', trim($values[2]));
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 1 other location - About 5 hrs to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 289..299

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

              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 (!empty($this->_ids[192]) && ($this->_ids[192]=="raw_value")) {
                                  if (preg_match('/\nUnsafe Shutdowns\: (.*)\n/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);
                                      if (!empty($values) && ($values[2]!=null)) {
                                          $vals=preg_replace('/,/', '', trim($values[2]));
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 1 other location - About 5 hrs to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 278..288

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

              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 (preg_match('/\n +number of hours powered up = (.*)\n/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);
                                      if (!empty($values) && ($values[7]!=null)) {
                                          $vals=preg_split('/[,\.]/', trim($values[7]));
                                          $this->_result[$disk][2]['id'] = 9;
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 1 other location - About 3 hrs to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 215..230

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

              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 4 locations. Consider refactoring.
              Open

                                  if (preg_match('/\nread\: (.*)\n/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);
                                      if (!empty($values) && ($values[7]!=null)) {
                                          $this->_result[$disk][0]['id'] = 1;
                                          $this->_result[$disk][0]['attribute_name'] = "Raw_Read_Error_Rate";
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 3 other locations - About 1 hr to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 233..240
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 262..276
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 269..276

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

              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 4 locations. Consider refactoring.
              Open

                                  if (preg_match('/\nElements in grown defect list\: (.*)\n/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);
                                      if (!empty($values) && ($values[5]!=null)) {
                                          $this->_result[$disk][1]['id'] = 5;
                                          $this->_result[$disk][1]['attribute_name'] = "Reallocated_Sector_Ct";
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 3 other locations - About 1 hr to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 215..230
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 262..276
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 269..276

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

              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 4 locations. Consider refactoring.
              Open

                                  } elseif (preg_match('/\nTemperature\: (.*) Celsius/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);
                                      if (!empty($values) && ($values[1]!=null)) {
                                          $this->_result[$disk][3]['id'] = 194;
                                          $this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius";
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 3 other locations - About 1 hr to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 215..230
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 233..240
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 262..276

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

              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 4 locations. Consider refactoring.
              Open

                                  if (preg_match('/\nCurrent Drive Temperature\: (.*)\n/', $result, $lines)) {
                                      $values=preg_split('/ +/', $lines[0]);
                                      if (!empty($values) && ($values[3]!=null)) {
                                          $this->_result[$disk][3]['id'] = 194;
                                          $this->_result[$disk][3]['attribute_name'] = "Temperature_Celsius";
              Severity: Major
              Found in phpsysinfo/plugins/smart/class.smart.inc.php and 3 other locations - About 1 hr to fix
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 215..230
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 233..240
              phpsysinfo/plugins/smart/class.smart.inc.php on lines 269..276

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

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

              The property $_ids is not named in camelCase.
              Open

              class SMART 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

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

                              $dn=0;

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              The property $_result is not named in camelCase.
              Open

              class SMART 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

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

                              $i = 0; // Line number

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

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

                                  $j = 0;

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

              The property $_filecontent is not named in camelCase.
              Open

              class SMART 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

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

                                              $id = $asdvs[$c];

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

              Source https://phpmd.org/rules/naming.html#shortvariable

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

                                      foreach ($lineInfos as $label=>$value) {

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

                                  foreach ($asd_wmi as $_nr=>$asd) {

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

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

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

                                      foreach ($lineInfos as $label=>$value) {

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

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

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

                              foreach ($labels as $k=>$v) {

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

                                  foreach ($asd_wmi as $_nr=>$asd) {

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

                      foreach ($this->_ids as $id=>$column_name) {

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

                          foreach ($this->_result as $diskName=>$diskInfos) {

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

                      foreach ($this->_ids as $id=>$column_name) {

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

                      foreach ($this->_ids as $id=>$column_name) {

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

                              foreach ($lineInfos as $label=>$value) {

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

                              foreach ($lineInfos as $label=>$value) {

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

                  private $_filecontent = array();

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

                  private $_ids = array();

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

                      foreach ($this->_result as $diskName=>$diskInfos) {

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

                      foreach ($this->_ids as $id=>$column_name) {

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

                      foreach ($this->_result as $diskName=>$diskInfos) {

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

                              foreach ($labels as $k=>$v) {

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

                          foreach ($this->_result as $diskName=>$diskInfos) {

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

                  private $_result = array();

              Line exceeds 120 characters; contains 166 characters
              Open

                          if (preg_match('/(SMART Error Log Version)|(SMART Error Log not supported)|(Error SMART Error Log Read failed)/', $result, $matches, PREG_OFFSET_CAPTURE))

              Inline control structures are not allowed
              Open

                              if ($found!=2) foreach ($diskInfos as $lineInfos) {

              Inline control structures are not allowed
              Open

                          if ($found==2) $newIds[$id] = $this->_ids[$id];

              Inline control structures are not allowed
              Open

                          if ($startIndex && $endIndex && ($endIndex>$startIndex))

              Line exceeds 120 characters; contains 315 characters
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7]+16777216*$asdvs[$c+8])."\n";

              Line exceeds 120 characters; contains 123 characters
              Open

                          if (preg_match('/(Vendor Specific SMART Attributes with Thresholds)/', $result, $matches, PREG_OFFSET_CAPTURE))

              Line exceeds 120 characters; contains 232 characters
              Open

                          // locate the end string offset for the attributes, this is usually right before string "SMART Error Log Version" or "SMART Error Log not supported" or "Error SMART Error Log Read failed" (hopefully every output has it!)

              Line exceeds 120 characters; contains 132 characters
              Open

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

              Line exceeds 120 characters; contains 274 characters
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              Line exceeds 120 characters; contains 274 characters
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              Inline control structures are not allowed
              Open

                                        if (($arrFullVa[0]=="#replace") && !empty($arrFullVa[1]))

              Line exceeds 120 characters; contains 293 characters
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7])."\n";

              Inline control structures are not allowed
              Open

                                          if (!empty($arrFullId[2]))

              Line exceeds 120 characters; contains 157 characters
              Open

                                      if (trim($diskname != "") && (CommonFunctions::executeProgram('smartctl', '--all'.' '.$diskdev.' '.$diskname, $buffer, PSI_DEBUG))) {

              Inline control structures are not allowed
              Open

                          if (preg_match('/(SMART Error Log Version)|(SMART Error Log not supported)|(Error SMART Error Log Read failed)/', $result, $matches, PREG_OFFSET_CAPTURE))

              Inline control structures are not allowed
              Open

                                          if (($found==1) && ($label==$column_name))

              Line exceeds 120 characters; contains 274 characters
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              Inline control structures are not allowed
              Open

                          if (preg_match('/(Vendor Specific SMART Attributes with Thresholds)/', $result, $matches, PREG_OFFSET_CAPTURE))

              Inline control structures are not allowed
              Open

                                          if (($found==0) && ($label=="id") && ($value==$id))

              Line exceeds 120 characters; contains 124 characters
              Open

                                      $asd_wmi = CommonFunctions::getWMI($wmi, 'MSStorageDriver_ATAPISmartData', array('VendorSpecific'));

              Line exceeds 120 characters; contains 212 characters
              Open

                                      if (((in_array($value, array_keys($this->_ids)) && $labels[$j] == 'id') || ($found && (in_array($labels[$j], array_values($this->_ids)))) || ($found && $labels[$j] == 'attribute_name'))) {

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

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

                                        $arrFullVa = preg_split('/-/', $this->_ids[$value]);

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

                                        if (($arrFullVa[0]=="#replace") && !empty($arrFullVa[1]))

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7]+16777216*$asdvs[$c+8])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7]+16777216*$asdvs[$c+8])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7]+16777216*$asdvs[$c+8])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6]+65536*$asdvs[$c+7]+16777216*$asdvs[$c+8])."\n";

              No space found after comma in function call
              Open

                                                          $this->_filecontent[$_name] .= $id." ID".$id." 0x".substr("0".dechex($asdvs[$c+2]),-2).substr("0".dechex($asdvs[$c+1]),-2)." ".substr("00".$asdvs[$c+3],-3)." ".substr("00".$asdvs[$c+4],-3)." ".($asdvs[$c+5]+256*$asdvs[$c+6])."\n";

              The variable $_name is not named in camelCase.
              Open

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

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

                  public function xml()
                  {
                      if (empty($this->_result) || empty($this->_ids)) {
                          return $this->xml->getSimpleXmlElement();
                      }

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

                  public function execute()
                  {
                      if (empty($this->_filecontent) || empty($this->_ids)) {
                          return;
                      }

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

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

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

                  public function execute()
                  {
                      if (empty($this->_filecontent) || empty($this->_ids)) {
                          return;
                      }

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

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

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

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

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

                  public function xml()
                  {
                      if (empty($this->_result) || empty($this->_ids)) {
                          return $this->xml->getSimpleXmlElement();
                      }

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

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

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

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

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

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

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

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

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

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

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

                  public function xml()
                  {
                      if (empty($this->_result) || empty($this->_ids)) {
                          return $this->xml->getSimpleXmlElement();
                      }

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

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

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

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

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

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

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

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

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

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

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

                  public function xml()
                  {
                      if (empty($this->_result) || empty($this->_ids)) {
                          return $this->xml->getSimpleXmlElement();
                      }

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

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

              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