XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Method _temperature has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _temperature($hwpath)
    {
       $sensor = glob($hwpath."temp*_input", GLOB_NOSORT);
       if (is_array($sensor) && (($total = count($sensor)) > 0)) {
            $buf = "";
Severity: Minor
Found in phpsysinfo/includes/mb/class.hwmon.inc.php - About 1 hr to fix

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

        public function __construct()
        {
            parent::__construct();
            switch (defined('PSI_SENSOR_SPEEDFAN_ACCESS')?strtolower(PSI_SENSOR_SPEEDFAN_ACCESS):'command') {
            case 'command':
    Severity: Minor
    Found in phpsysinfo/includes/mb/class.speedfan.inc.php - About 1 hr to fix

      Method memory has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function memory()
          {
              if (PSI_OS == 'FreeBSD' || PSI_OS == 'OpenBSD') {
                  // vmstat on fbsd 4.4 or greater outputs kbytes not hw.pagesize
                  // I should probably add some version checking here, but for now
      Severity: Minor
      Found in phpsysinfo/includes/os/class.BSDCommon.inc.php - About 1 hr to fix

        Method ide has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function ide()
            {
                foreach ($this->readdmesg() as $line) {
                    if (preg_match('/^(.*) at (pciide|wdc|atabus|atapibus)[0-9]+ (.*): <(.*)>/', $line, $ar_buf)
                       || preg_match('/^(.*) at (pciide|wdc|atabus|atapibus)[0-9]+ /', $line, $ar_buf)) {
        Severity: Minor
        Found in phpsysinfo/includes/os/class.NetBSD.inc.php - About 1 hr to fix

          Method _memory has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _memory()
              {
                  if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
                      $bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
                      foreach ($bufe as $buf) {
          Severity: Minor
          Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 hr to fix

            Method _timeoutfgets has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function _timeoutfgets($pipes, &$out, &$err, $timeout)
                {
                    $w = null;
                    $e = null;
                    $te = false;
            Severity: Minor
            Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

              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

                Method _retrieveCurrentVersions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _retrieveCurrentVersions()
                    {
                        if (!function_exists('curl_init')) {
                            // Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version
                            $this->_message_ok = 'You are running a current stable version of PHP!
                Severity: Minor
                Found in phpsecinfo/PhpSecInfo/Test/Core/version.php - About 1 hr to fix

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

                  function refreshVoltage(xml) {
                      if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('voltage', blocks) < 0))) {
                          $("#voltage").remove();
                          return;
                      }
                  Severity: Minor
                  Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - 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 fillHWDevice has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function fillHWDevice(xml, type, tree, rootposition) {
                      var devicecount = 0, html = "";
                      $("Hardware " + type + " Device", xml).each(function getHWDevice(deviceId) {
                          var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", devcoreposition = 0;
                  
                  
                  Severity: Minor
                  Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - 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 refreshCurrent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function refreshCurrent(xml) {
                      if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('current', blocks) < 0))) {
                          $("#current").remove();
                          return;
                      }
                  Severity: Minor
                  Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - 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 implement has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      implement: function (linkElement) {
                          if (!linkElement.href) {
                              return;
                          }
                  
                  
                  Severity: Minor
                  Found in phpsysinfo/js/vendor/bootstrap-ie9.js - 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 implement has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      implement: function (linkElement) {
                          if (!linkElement.href) {
                              return;
                          }
                  
                  
                  Severity: Minor
                  Found in phpsysinfo/js/vendor/bootstrap-ie8.js - 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 _fans has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _fans()
                      {
                          foreach ($this->_lines as $line) {
                              $buffer = preg_split("/\s*\|\s*/", $line);
                              if ($buffer[2] == "Fan" && $buffer[11] != "N/A" && $buffer[4] == "RPM") {
                  Severity: Minor
                  Found in phpsysinfo/includes/mb/class.freeipmi.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 _filesystems has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _filesystems()
                      {
                          if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                              $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                              if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
                  Severity: Minor
                  Found in phpsysinfo/includes/os/class.HPUX.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 _other has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _other()
                      {
                          foreach ($this->_buf as $sensor) {
                              if (isset($sensor['Sensor Type (Discrete)'])) {
                                  $dev = new SensorDevice();
                  Severity: Minor
                  Found in phpsysinfo/includes/mb/class.ipmitool.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 _hostname has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function _hostname()
                      {
                          if (PSI_USE_VHOST === true) {
                              if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
                          } else {
                  Severity: Minor
                  Found in phpsysinfo/includes/os/class.Linux.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 _cpuinfo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function _cpuinfo()
                      {
                          if (CommonFunctions::executeProgram('pidin', 'info', $buf)
                             && preg_match('/^Processor\d+: (.*)/m', $buf)) {
                              $lines = preg_split("/\n/", $buf, -1, PREG_SPLIT_NO_EMPTY);
                  Severity: Minor
                  Found in phpsysinfo/includes/os/class.QNX.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 _network has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _network()
                      {
                          if (CommonFunctions::executeProgram('ifconfig', '-a', $bufr, PSI_DEBUG)) {
                              $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                              foreach ($lines as $line) {
                  Severity: Minor
                  Found in phpsysinfo/includes/os/class.Minix.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 _filesystems has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _filesystems()
                      {
                          if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
                              $mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
                              if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
                  Severity: Minor
                  Found in phpsysinfo/includes/os/class.AIX.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

                  Severity
                  Category
                  Status
                  Source
                  Language