XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/includes/xml/class.XML.inc.php

Summary

Maintainability
F
2 wks
Test Coverage

The method _buildFilesystems() contains an eval expression.
Open

                $ignoreUsage = eval(PSI_IGNORE_USAGE);

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 _buildFilesystems() contains an eval expression.
Open

                $ignoreFree = eval(PSI_IGNORE_FREE);

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 _buildFilesystems() contains an eval expression.
Open

                $hideMounts = eval(PSI_HIDE_MOUNTS);

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 _buildFilesystems() contains an eval expression.
Open

                $ignoreThreshold = eval(PSI_IGNORE_THRESHOLD_FS_TYPES);

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 _buildNetwork() contains an eval expression.
Open

                    $hideDevices = eval(PSI_HIDE_NETWORK_INTERFACE);

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 _buildFilesystems() contains an eval expression.
Open

                $hideFstypes = eval(PSI_HIDE_FS_TYPES);

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 _buildFilesystems() contains an eval expression.
Open

                    $hideDisks = eval(PSI_HIDE_DISKS);

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 _buildMbinfo has a Cognitive Complexity of 152 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildMbinfo()
    {
        $mbinfo = $this->_xml->addChild('MBInfo');
        $temp = $fan = $volt = $power = $current = $other = null;

Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.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 _buildHardware has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildHardware()
    {
        $hardware = $this->_xml->addChild('Hardware');
        if ($this->_sys->getMachine() != "") {
            $hardware->addAttribute('Name', $this->_sys->getMachine());
Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.inc.php - About 2 days to fix

Cognitive Complexity

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

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

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

Further reading

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

<?php
/**
 * XML Generation class
 *
 * PHP version 5
Severity: Major
Found in phpsysinfo/includes/xml/class.XML.inc.php - About 1 day to fix

    Function _buildUpsinfo has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _buildUpsinfo()
        {
            $upsinfo = $this->_xml->addChild('UPSInfo');
            if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                $upsinfo->addAttribute('ApcupsdCgiLinks', true);
    Severity: Minor
    Found in phpsysinfo/includes/xml/class.XML.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

    Function _buildXml has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _buildXml()
        {
            if (!$this->_plugin_request || $this->_complete_request) {
                if ($this->_sys === null) {
                    if (PSI_DEBUG === true) {
    Severity: Minor
    Found in phpsysinfo/includes/xml/class.XML.inc.php - About 7 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method _buildHardware has 148 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function _buildHardware()
        {
            $hardware = $this->_xml->addChild('Hardware');
            if ($this->_sys->getMachine() != "") {
                $hardware->addAttribute('Name', $this->_sys->getMachine());
    Severity: Major
    Found in phpsysinfo/includes/xml/class.XML.inc.php - About 5 hrs to fix

      Function _buildFilesystems has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          private function _buildFilesystems()
          {
              $hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
              $i = 1;
              if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {
      Severity: Minor
      Found in phpsysinfo/includes/xml/class.XML.inc.php - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function _buildVitals has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

          private function _buildVitals()
          {
              $vitals = $this->_xml->addChild('Vitals');
              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
              $vitals->addAttribute('IPAddr', $this->_sys->getIp());
      Severity: Minor
      Found in phpsysinfo/includes/xml/class.XML.inc.php - About 5 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method _buildMbinfo has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function _buildMbinfo()
          {
              $mbinfo = $this->_xml->addChild('MBInfo');
              $temp = $fan = $volt = $power = $current = $other = null;
      
      
      Severity: Major
      Found in phpsysinfo/includes/xml/class.XML.inc.php - About 3 hrs to fix

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

        class XML
        {
            /**
             * Sysinfo object where the information retrieval methods are included
             *

        Method _buildFilesystems has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function _buildFilesystems()
            {
                $hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
                $i = 1;
                if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {
        Severity: Major
        Found in phpsysinfo/includes/xml/class.XML.inc.php - About 2 hrs to fix

          Method _buildUpsinfo has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function _buildUpsinfo()
              {
                  $upsinfo = $this->_xml->addChild('UPSInfo');
                  if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                      $upsinfo->addAttribute('ApcupsdCgiLinks', true);
          Severity: Major
          Found in phpsysinfo/includes/xml/class.XML.inc.php - About 2 hrs to fix

            Method _buildVitals has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _buildVitals()
                {
                    $vitals = $this->_xml->addChild('Vitals');
                    $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                    $vitals->addAttribute('IPAddr', $this->_sys->getIp());
            Severity: Minor
            Found in phpsysinfo/includes/xml/class.XML.inc.php - About 2 hrs to fix

              Function _buildNetwork has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _buildNetwork()
                  {
                      $hideDevices = array();
                      $network = $this->_xml->addChild('Network');
                      if (defined('PSI_HIDE_NETWORK_INTERFACE')) {
              Severity: Minor
              Found in phpsysinfo/includes/xml/class.XML.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

              Function _xmlbody has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _xmlbody()
                  {
                      $dom = new DOMDocument('1.0', 'UTF-8');
                      $root = $dom->createElement("tns:phpsysinfo");
                      $root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');
              Severity: Minor
              Found in phpsysinfo/includes/xml/class.XML.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 _xmlbody has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function _xmlbody()
                  {
                      $dom = new DOMDocument('1.0', 'UTF-8');
                      $root = $dom->createElement("tns:phpsysinfo");
                      $root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');
              Severity: Minor
              Found in phpsysinfo/includes/xml/class.XML.inc.php - About 1 hr to fix

                Method _buildXml has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function _buildXml()
                    {
                        if (!$this->_plugin_request || $this->_complete_request) {
                            if ($this->_sys === null) {
                                if (PSI_DEBUG === true) {
                Severity: Minor
                Found in phpsysinfo/includes/xml/class.XML.inc.php - About 1 hr to fix

                  Function _buildPlugins has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _buildPlugins()
                      {
                          $pluginroot = $this->_xml->addChild("Plugins");
                          if (($this->_plugin_request || $this->_complete_request) && count($this->_plugins) > 0) {
                              $plugins = array();
                  Severity: Minor
                  Found in phpsysinfo/includes/xml/class.XML.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 _buildMemory has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function _buildMemory()
                      {
                          $memory = $this->_xml->addChild('Memory');
                          $memory->addAttribute('Free', $this->_sys->getMemFree());
                          $memory->addAttribute('Used', $this->_sys->getMemUsed());
                  Severity: Minor
                  Found in phpsysinfo/includes/xml/class.XML.inc.php - About 1 hr to fix

                    Function _buildMemory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function _buildMemory()
                        {
                            $memory = $this->_xml->addChild('Memory');
                            $memory->addAttribute('Free', $this->_sys->getMemFree());
                            $memory->addAttribute('Used', $this->_sys->getMemUsed());
                    Severity: Minor
                    Found in phpsysinfo/includes/xml/class.XML.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

                    Avoid deeply nested control flow statements.
                    Open

                                            if (preg_match("/^\.$/m", $include_path)) {
                                                $include_path = ".";
                                            }
                    Severity: Major
                    Found in phpsysinfo/includes/xml/class.XML.inc.php - About 45 mins to fix

                      Function _fillDevice has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)
                          {
                              $mount->addAttribute('MountPointID', $i);
                              if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType());
                              $mount->addAttribute('Name', $dev->getName());
                      Severity: Minor
                      Found in phpsysinfo/includes/xml/class.XML.inc.php - About 35 mins 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

                      The method _buildUpsinfo() has an NPath complexity of 49161. The configured NPath complexity threshold is 200.
                      Open

                          private function _buildUpsinfo()
                          {
                              $upsinfo = $this->_xml->addChild('UPSInfo');
                              if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                                  $upsinfo->addAttribute('ApcupsdCgiLinks', true);

                      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 _buildHardware() has an NPath complexity of 28986191121250. The configured NPath complexity threshold is 200.
                      Open

                          private function _buildHardware()
                          {
                              $hardware = $this->_xml->addChild('Hardware');
                              if ($this->_sys->getMachine() != "") {
                                  $hardware->addAttribute('Name', $this->_sys->getMachine());

                      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 _buildXml() has an NPath complexity of 848560. The configured NPath complexity threshold is 200.
                      Open

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

                      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 _buildHardware() has 157 lines of code. Current threshold is set to 100. Avoid really long methods.
                      Open

                          private function _buildHardware()
                          {
                              $hardware = $this->_xml->addChild('Hardware');
                              if ($this->_sys->getMachine() != "") {
                                  $hardware->addAttribute('Name', $this->_sys->getMachine());

                      The method _buildFilesystems() has an NPath complexity of 40960. The configured NPath complexity threshold is 200.
                      Open

                          private function _buildFilesystems()
                          {
                              $hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
                              $i = 1;
                              if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {

                      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 _buildVitals() has an NPath complexity of 7856. The configured NPath complexity threshold is 200.
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      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 _buildMbinfo() has an NPath complexity of 92425027. The configured NPath complexity threshold is 200.
                      Open

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

                      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 _xmlbody() has an NPath complexity of 320. The configured NPath complexity threshold is 200.
                      Open

                          private function _xmlbody()
                          {
                              $dom = new DOMDocument('1.0', 'UTF-8');
                              $root = $dom->createElement("tns:phpsysinfo");
                              $root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');

                      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 _buildMbinfo() has 105 lines of code. Current threshold is set to 100. Avoid really long methods.
                      Open

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildFilesystems()
                          {
                              $hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
                              $i = 1;
                              if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {

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

                          private function _buildNetwork()
                          {
                              $hideDevices = array();
                              $network = $this->_xml->addChild('Network');
                              if (defined('PSI_HIDE_NETWORK_INTERFACE')) {

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildHardware()
                          {
                              $hardware = $this->_xml->addChild('Hardware');
                              if ($this->_sys->getMachine() != "") {
                                  $hardware->addAttribute('Name', $this->_sys->getMachine());

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

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

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

                          private function _xmlbody()
                          {
                              $dom = new DOMDocument('1.0', 'UTF-8');
                              $root = $dom->createElement("tns:phpsysinfo");
                              $root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');

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

                          private function _buildUpsinfo()
                          {
                              $upsinfo = $this->_xml->addChild('UPSInfo');
                              if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                                  $upsinfo->addAttribute('ApcupsdCgiLinks', true);

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

                      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 '796', column '27').
                      Open

                              $this->_xml = new SimpleXMLExtended(simplexml_import_dom($dom), $this->_sysinfo->getEncoding());

                      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

                      Remove error control operator '@' on line 358.
                      Open

                          private function _buildHardware()
                          {
                              $hardware = $this->_xml->addChild('Hardware');
                              if ($this->_sys->getMachine() != "") {
                                  $hardware->addAttribute('Name', $this->_sys->getMachine());

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      The method __construct has a boolean flag argument $complete, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function __construct($complete = false, $pluginname = "", $blockname = false)

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

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

                      Remove error control operator '@' on line 710.
                      Open

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      Remove error control operator '@' on line 715.
                      Open

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

                      ErrorControlOperator

                      Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                      Example

                      function foo($filePath) {
                          $file = @fopen($filPath); // hides exceptions
                          $key = @$array[$notExistingKey]; // assigns null to $key
                      }

                      Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                      Missing class import via use statement (line '790', column '20').
                      Open

                              $dom = new DOMDocument('1.0', 'UTF-8');

                      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 has a boolean flag argument $blockname, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function __construct($complete = false, $pluginname = "", $blockname = false)

                      BooleanArgumentFlag

                      Since: 1.4.0

                      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                      Example

                      class Foo {
                          public function bar($flag = true) {
                          }
                      }

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

                      Avoid assigning values to variables in if clauses and the like (line '162', column '50').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

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

                                  } else {
                                      $ignoreThreshold = array(PSI_IGNORE_THRESHOLD_FS_TYPES);
                                  }

                      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 'System' in method '_buildHardware'.
                      Open

                              foreach (System::removeDupsAndCount($this->_sys->getPciDevices()) as $dev) {

                      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 'System' in method '_buildHardware'.
                      Open

                              foreach (System::removeDupsAndCount($this->_sys->getI2cDevices()) as $dev) {

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

                                  } else {
                                      $ignoreUsage = array(PSI_IGNORE_USAGE);
                                  }

                      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 '811', column '19').
                      Open

                          private function _xmlbody()
                          {
                              $dom = new DOMDocument('1.0', 'UTF-8');
                              $root = $dom->createElement("tns:phpsysinfo");
                              $root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');

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

                                      } else {
                                          $hideDevices = array(PSI_HIDE_NETWORK_INTERFACE);
                                      }

                      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 '142', column '42').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      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 'System' in method '_buildHardware'.
                      Open

                              foreach (System::removeDupsAndCount($this->_sys->getUsbDevices()) as $dev) {

                      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 {
                                  $this->_complete_request = false;
                              }

                      ElseExpression

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class 'System' in method '_buildHardware'.
                      Open

                              foreach (System::removeDupsAndCount($this->_sys->getIdeDevices()) as $dev) {

                      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 '150', column '50').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      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 '158', column '50').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      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 {
                                  $this->_plugin_request = true;
                                  $this->_plugin = $pluginname;
                              }

                      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 'PSI_Error' in method '__construct'.
                      Open

                              $this->_errors = PSI_Error::singleton();

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

                                  } else {
                                      $hideMounts = array(PSI_HIDE_MOUNTS);
                                  }

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

                              } else {
                                  $options->addAttribute('refresh', 60000);
                              }

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

                                      } else {
                                          $hideDisks = array(PSI_HIDE_DISKS);
                                      }

                      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 '141', column '14').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

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

                              } else {
                                  $options->addAttribute('threshold', 90);
                              }

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

                                  } else {
                                      $ignoreFree = array(PSI_IGNORE_FREE);
                                  }

                      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 '146', column '50').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      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 '166', column '26').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      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 'System' in method '_buildHardware'.
                      Open

                              foreach (System::removeDupsAndCount($this->_sys->getNvmeDevices()) as $dev) {

                      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 'System' in method '_buildHardware'.
                      Open

                              foreach (System::removeDupsAndCount($this->_sys->getTbDevices()) as $dev) {

                      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

                              $this->_plugins = CommonFunctions::getPlugins();

                      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 '154', column '50').
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      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 'System' in method '_buildHardware'.
                      Open

                              foreach (System::removeDupsAndCount($this->_sys->getScsiDevices()) as $dev) {

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

                                  } else {
                                      $hideFstypes = array(PSI_HIDE_FS_TYPES);
                                  }

                      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

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

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='voltage') foreach ($mbinfo_detail->getMbVolt() as $dev) {
                                          if ($volt == null) {
                                              $volt = $mbinfo->addChild('Voltage');
                                          }
                                          $item = $volt->addChild('Item');
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 1 other location - About 6 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 595..611

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

                      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 (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='current') foreach ($mbinfo_detail->getMbCurrent() as $dev) {
                                          if ($current == null) {
                                              $current = $mbinfo->addChild('Current');
                                          }
                                          $item = $current->addChild('Item');
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 1 other location - About 6 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 562..578

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

                      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

                              foreach (System::removeDupsAndCount($this->_sys->getScsiDevices()) as $dev) {
                                  if ($scsi === null) $scsi = $hardware->addChild('SCSI');
                                  $tmp = $scsi->addChild('Device');
                                  $tmp->addAttribute('Name', $dev->getName());
                                  if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 2 other locations - About 5 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 259..274
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 293..308

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

                      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

                              foreach (System::removeDupsAndCount($this->_sys->getIdeDevices()) as $dev) {
                                  if ($ide === null) $ide = $hardware->addChild('IDE');
                                  $tmp = $ide->addChild('Device');
                                  $tmp->addAttribute('Name', $dev->getName());
                                  if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 2 other locations - About 5 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 276..291
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 293..308

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

                      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

                              foreach (System::removeDupsAndCount($this->_sys->getNvmeDevices()) as $dev) {
                                  if ($nvme === null) $nvme = $hardware->addChild('NVMe');
                                  $tmp = $nvme->addChild('Device');
                                  $tmp->addAttribute('Name', $dev->getName());
                                  if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 2 other locations - About 5 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 259..274
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 276..291

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

                      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 (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='temperature') foreach ($mbinfo_detail->getMbTemp() as $dev) {
                                          if ($temp == null) {
                                              $temp = $mbinfo->addChild('Temperature');
                                          }
                                          $item = $temp->addChild('Item');
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 2 other locations - About 4 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 547..560
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 580..593

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

                      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 (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='fans') foreach ($mbinfo_detail->getMbFan() as $dev) {
                                          if ($fan == null) {
                                              $fan = $mbinfo->addChild('Fans');
                                          }
                                          $item = $fan->addChild('Item');
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 2 other locations - About 4 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 532..545
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 580..593

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

                      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 (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='power') foreach ($mbinfo_detail->getMbPower() as $dev) {
                                          if ($power == null) {
                                              $power = $mbinfo->addChild('Power');
                                          }
                                          $item = $power->addChild('Item');
                      Severity: Major
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 2 other locations - About 4 hrs to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 532..545
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 547..560

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

                      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

                              foreach (System::removeDupsAndCount($this->_sys->getTbDevices()) as $dev) {
                                  if ($tb === null) $tb = $hardware->addChild('TB');
                                  $tmp = $tb->addChild('Device');
                                  $tmp->addAttribute('Name', $dev->getName());
                                  if ($dev->getCount() > 1) {
                      Severity: Minor
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 1 other location - About 55 mins to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 319..326

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

                      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

                              foreach (System::removeDupsAndCount($this->_sys->getI2cDevices()) as $dev) {
                                  if ($i2c === null) $i2c = $hardware->addChild('I2C');
                                  $tmp = $i2c->addChild('Device');
                                  $tmp->addAttribute('Name', $dev->getName());
                                  if ($dev->getCount() > 1) {
                      Severity: Minor
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 1 other location - About 55 mins to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 310..317

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

                      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 (defined('PSI_HIDE_NETWORK_INTERFACE')) {
                                  if (is_string(PSI_HIDE_NETWORK_INTERFACE)) {
                                      if (preg_match(ARRAY_EXP, PSI_HIDE_NETWORK_INTERFACE)) {
                                          $hideDevices = eval(PSI_HIDE_NETWORK_INTERFACE);
                                      } else {
                      Severity: Minor
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 1 other location - About 35 mins to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 469..479

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

                      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 (defined('PSI_HIDE_DISKS')) {
                                  if (is_string(PSI_HIDE_DISKS)) {
                                      if (preg_match(ARRAY_EXP, PSI_HIDE_DISKS)) {
                                          $hideDisks = eval(PSI_HIDE_DISKS);
                                      } else {
                      Severity: Minor
                      Found in phpsysinfo/includes/xml/class.XML.inc.php and 1 other location - About 35 mins to fix
                      phpsysinfo/includes/xml/class.XML.inc.php on lines 185..195

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

                      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 XML

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

                              $tb = null;

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

                      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 = 1;

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

                      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 = 1;

                      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 $i. Configured minimum length is 3.
                      Open

                          private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

                      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 $os. Configured minimum length is 3.
                      Open

                              $os = PSI_OS;

                      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 $fs. Configured minimum length is 3.
                      Open

                              $fs = $this->_xml->addChild('FileSystem');

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

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

                      class XML
                      {
                          /**
                           * Sysinfo object where the information retrieval methods are included
                           *

                      CamelCasePropertyName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          protected $property_name;
                      }

                      Source

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

                          private $_complete_request = false;

                      Method name "_buildNetwork" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildNetwork()

                      Method name "_buildMemory" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildMemory()

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

                          private $_plugins;

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

                          private $_plugin = '';

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

                          private $_xml;

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

                          private $_sysinfo;

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

                          private $_sys = null;

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

                          private $_plugin_request = false;

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

                          private $_errors;

                      Method name "_buildVitals" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildVitals()

                      Method name "_buildHardware" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildHardware()

                      Method name "_buildMbinfo" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildMbinfo()

                      Method name "_buildUpsinfo" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildUpsinfo()

                      Method name "_buildPlugins" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildPlugins()

                      Expected 1 space after comma in function call; 2 found
                      Open

                                  $options->addAttribute('refresh',  max(intval(PSI_REFRESH), 0));

                      Method name "_buildXml" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildXml()

                      Method name "_fillDevice" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)

                      Method name "_buildFilesystems" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _buildFilesystems()

                      Method name "_xmlbody" should not be prefixed with an underscore to indicate visibility
                      Open

                          private function _xmlbody()

                      Inline control structures are not allowed
                      Open

                                  if ($cpu === null) $cpu = $hardware->addChild('CPU');

                      Inline control structures are not allowed
                      Open

                                  if ($usb === null) $usb = $hardware->addChild('USB');

                      Line exceeds 120 characters; contains 141 characters
                      Open

                              if (($this->_sys->getMemApplication() !== null) || ($this->_sys->getMemBuffer() !== null) || ($this->_sys->getMemCache() !== null)) {

                      Inline control structures are not allowed
                      Open

                                  if ($scsi === null) $scsi = $hardware->addChild('SCSI');

                      Inline control structures are not allowed
                      Open

                                  if ($nvme === null) $nvme = $hardware->addChild('NVMe');

                      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 ($tb === null) $tb = $hardware->addChild('TB');

                      Inline control structures are not allowed
                      Open

                                  if ($pci === null) $pci = $hardware->addChild('PCI');

                      Inline control structures are not allowed
                      Open

                                      if (defined('PSI_SHOW_NETWORK_INFOS') && PSI_SHOW_NETWORK_INFOS && $dev->getInfo())

                      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 ($i2c === null) $i2c = $hardware->addChild('I2C');

                      Inline control structures are not allowed
                      Open

                                      if ($vendortab === null) $vendortab = @parse_ini_file(PSI_APP_ROOT."/data/cpus.ini", true);

                      Inline control structures are not allowed
                      Open

                                  if ($ide === null) $ide = $hardware->addChild('IDE');

                      Line exceeds 120 characters; contains 121 characters
                      Open

                                              $this->_errors->addError("WARN", "PhpSysInfo requires '.' inside the 'include_path' in php.ini");

                      Line exceeds 120 characters; contains 140 characters
                      Open

                                              $this->_errors->addError("WARN", "Installed version of PHP does not support proc_open() function, popen() is used");

                      Inline control structures are not allowed
                      Open

                              if (!$this->_sysinfo->getBlockName()) $this->_buildPlugins();

                      Line exceeds 120 characters; contains 148 characters
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='voltage') foreach ($mbinfo_detail->getMbVolt() as $dev) {

                      Line exceeds 120 characters; contains 147 characters
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='other') foreach ($mbinfo_detail->getMbOther() as $dev) {

                      Inline control structures are not allowed
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='vitals') $this->_buildVitals();

                      Inline control structures are not allowed
                      Open

                                  if (!$this->_sysinfo->getBlockName() || in_array($this->_sysinfo->getBlockName(), array('voltage','current','temperature','fans','power','other'))) $this->_buildMbinfo();

                      Inline control structures are not allowed
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='network') $this->_buildNetwork();

                      Line exceeds 120 characters; contains 151 characters
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='current') foreach ($mbinfo_detail->getMbCurrent() as $dev) {

                      Line exceeds 120 characters; contains 138 characters
                      Open

                                              $this->_errors->addError("WARN", "This is an unstable version of phpSysInfo, some things may not work correctly");

                      Inline control structures are not allowed
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='filesystem') $this->_buildFilesystems();

                      Inline control structures are not allowed
                      Open

                              if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType());

                      Line exceeds 120 characters; contains 127 characters
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='filesystem') $this->_buildFilesystems();

                      Inline control structures are not allowed
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='fans') foreach ($mbinfo_detail->getMbFan() as $dev) {

                      Line exceeds 120 characters; contains 122 characters
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='hardware') $this->_buildHardware();

                      Inline control structures are not allowed
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='temperature') foreach ($mbinfo_detail->getMbTemp() as $dev) {

                      Line exceeds 120 characters; contains 152 characters
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='temperature') foreach ($mbinfo_detail->getMbTemp() as $dev) {

                      Inline control structures are not allowed
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='voltage') foreach ($mbinfo_detail->getMbVolt() as $dev) {

                      Inline control structures are not allowed
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='power') foreach ($mbinfo_detail->getMbPower() as $dev) {

                      Line exceeds 120 characters; contains 147 characters
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='power') foreach ($mbinfo_detail->getMbPower() as $dev) {

                      Inline control structures are not allowed
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='other') foreach ($mbinfo_detail->getMbOther() as $dev) {

                      Inline control structures are not allowed
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='hardware') $this->_buildHardware();

                      Inline control structures are not allowed
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='ups') $this->_buildUpsinfo();

                      Line exceeds 120 characters; contains 173 characters
                      Open

                                  if (!in_array($disk->getMountPoint(), $hideMounts, true) && !in_array($disk->getFsType(), $hideFstypes, true) && !in_array($disk->getName(), $hideDisks, true)) {

                      Line exceeds 120 characters; contains 182 characters
                      Open

                                  if (!$this->_sysinfo->getBlockName() || in_array($this->_sysinfo->getBlockName(), array('voltage','current','temperature','fans','power','other'))) $this->_buildMbinfo();

                      Line exceeds 120 characters; contains 144 characters
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='fans') foreach ($mbinfo_detail->getMbFan() as $dev) {

                      Inline control structures are not allowed
                      Open

                                      if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='current') foreach ($mbinfo_detail->getMbCurrent() as $dev) {

                      Line exceeds 120 characters; contains 123 characters
                      Open

                              $options->addAttribute('datetimeFormat', defined('PSI_DATETIME_FORMAT') ? strtolower(PSI_DATETIME_FORMAT) : 'utc');

                      Inline control structures are not allowed
                      Open

                              if ($dev->getIgnore() > 0) $mount->addAttribute('Ignore', $dev->getIgnore());

                      Inline control structures are not allowed
                      Open

                                  if (!$this->_sysinfo->getBlockName() || $this->_sysinfo->getBlockName()==='memory') $this->_buildMemory();

                      The variable $mbinfo_detail is not named in camelCase.
                      Open

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildUpsinfo()
                          {
                              $upsinfo = $this->_xml->addChild('UPSInfo');
                              if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                                  $upsinfo->addAttribute('ApcupsdCgiLinks', true);

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildUpsinfo()
                          {
                              $upsinfo = $this->_xml->addChild('UPSInfo');
                              if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                                  $upsinfo->addAttribute('ApcupsdCgiLinks', true);

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildUpsinfo()
                          {
                              $upsinfo = $this->_xml->addChild('UPSInfo');
                              if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                                  $upsinfo->addAttribute('ApcupsdCgiLinks', true);

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildUpsinfo()
                          {
                              $upsinfo = $this->_xml->addChild('UPSInfo');
                              if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                                  $upsinfo->addAttribute('ApcupsdCgiLinks', true);

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

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

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

                      CamelCaseVariableName

                      Since: 0.2

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

                      Example

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

                      Source

                      The method _buildFilesystems is not named in camelCase.
                      Open

                          private function _buildFilesystems()
                          {
                              $hideMounts = $hideFstypes = $hideDisks = $ignoreFree = $ignoreUsage = $ignoreThreshold = array();
                              $i = 1;
                              if (defined('PSI_HIDE_MOUNTS') && is_string(PSI_HIDE_MOUNTS)) {

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildNetwork is not named in camelCase.
                      Open

                          private function _buildNetwork()
                          {
                              $hideDevices = array();
                              $network = $this->_xml->addChild('Network');
                              if (defined('PSI_HIDE_NETWORK_INTERFACE')) {

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildXml is not named in camelCase.
                      Open

                          private function _buildXml()
                          {
                              if (!$this->_plugin_request || $this->_complete_request) {
                                  if ($this->_sys === null) {
                                      if (PSI_DEBUG === true) {

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildMbinfo is not named in camelCase.
                      Open

                          private function _buildMbinfo()
                          {
                              $mbinfo = $this->_xml->addChild('MBInfo');
                              $temp = $fan = $volt = $power = $current = $other = null;
                      
                      

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _fillDevice is not named in camelCase.
                      Open

                          private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)
                          {
                              $mount->addAttribute('MountPointID', $i);
                              if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType());
                              $mount->addAttribute('Name', $dev->getName());

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildHardware is not named in camelCase.
                      Open

                          private function _buildHardware()
                          {
                              $hardware = $this->_xml->addChild('Hardware');
                              if ($this->_sys->getMachine() != "") {
                                  $hardware->addAttribute('Name', $this->_sys->getMachine());

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildPlugins is not named in camelCase.
                      Open

                          private function _buildPlugins()
                          {
                              $pluginroot = $this->_xml->addChild("Plugins");
                              if (($this->_plugin_request || $this->_complete_request) && count($this->_plugins) > 0) {
                                  $plugins = array();

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildVitals is not named in camelCase.
                      Open

                          private function _buildVitals()
                          {
                              $vitals = $this->_xml->addChild('Vitals');
                              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
                              $vitals->addAttribute('IPAddr', $this->_sys->getIp());

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildMemory is not named in camelCase.
                      Open

                          private function _buildMemory()
                          {
                              $memory = $this->_xml->addChild('Memory');
                              $memory->addAttribute('Free', $this->_sys->getMemFree());
                              $memory->addAttribute('Used', $this->_sys->getMemUsed());

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _xmlbody is not named in camelCase.
                      Open

                          private function _xmlbody()
                          {
                              $dom = new DOMDocument('1.0', 'UTF-8');
                              $root = $dom->createElement("tns:phpsysinfo");
                              $root->setAttribute('xmlns:tns', 'http://phpsysinfo.sourceforge.net/');

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      The method _buildUpsinfo is not named in camelCase.
                      Open

                          private function _buildUpsinfo()
                          {
                              $upsinfo = $this->_xml->addChild('UPSInfo');
                              if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                                  $upsinfo->addAttribute('ApcupsdCgiLinks', true);

                      CamelCaseMethodName

                      Since: 0.2

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

                      Example

                      class ClassName {
                          public function get_name() {
                          }
                      }

                      Source

                      There are no issues that match your filters.

                      Category
                      Status