XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function renderPlugin_raid has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderPlugin_raid(data) {

    function raid_buildaction(data) {
        var html = "", name = "", percent = 0;
        if (data !== undefined) {
Severity: Major
Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 5 hrs to fix

    File mimetypes.php has 400 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    /**
    Severity: Minor
    Found in modules/xoopsinfo/include/mimetypes.php - About 5 hrs to fix

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

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

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

      (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
      var $, Context, Transparency, helpers, _,
        __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
      
      _ = require('../lib/lodash.js');
      Severity: Minor
      Found in phpsysinfo/js/vendor/transparency.js - 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 getWMI has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getWMI($wmi, $strClass, $strValue = array())
          {
              $arrData = array();
              if (gettype($wmi) === "object") {
                  $value = "";
      Severity: Minor
      Found in phpsysinfo/includes/class.CommonFunctions.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 _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 calculateSize has 138 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function calculateSize(resizing) {
              debug('calculateSize');
      
              modal.wrapper = modal.contentWrapper.children('div:first');
      
      
      Severity: Major
      Found in phpsysinfo/js/jQuery/jquery.nyroModal.js - About 5 hrs to fix

        Function 6 has 137 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"./elementFactory":4}],6:[function(require,module,exports){
        var Instance, chainable, helpers, _,
          __hasProp = {}.hasOwnProperty;
        
        _ = require('../lib/lodash.js');
        Severity: Major
        Found in phpsysinfo/js/vendor/transparency.js - About 5 hrs to fix

          Function renderPlugin_bat has 137 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function renderPlugin_bat(data) {
              var batcount = 0;
              var directives = {
                  Name: {
                      text: function () {
          Severity: Major
          Found in phpsysinfo/plugins/bat/js/bat_bootstrap.js - About 5 hrs to fix

            Method execute_megactl has 136 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function execute_megactl($buffer, $sas = false)
                {
                    $raiddata = preg_split("/(\r?\n)+(?=[a-z]\d+ )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
                    if (!empty($raiddata)) foreach ($raiddata as $raidgroup) {
                        if (preg_match("/^([a-z]\d+) /", $raidgroup, $buff)) {
            Severity: Major
            Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 5 hrs to fix

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

                  protected function _fans($hwpath)
                  {
                     $sensor = glob($hwpath."fan*_input", GLOB_NOSORT);
                     if (is_array($sensor) && (($total = count($sensor)) > 0)) {
                          $buf = "";
              Severity: Minor
              Found in phpsysinfo/includes/mb/class.hwmon.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 _filesystems has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
              Open

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

                  private function _info()
                  {
                      if (! empty($this->_output)) {
                          foreach ($this->_output as $name => $value) {
                              $temp = preg_split("/\n/", $value, -1, PREG_SPLIT_NO_EMPTY);
              Severity: Minor
              Found in phpsysinfo/includes/ups/class.nut.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

              Function bat_buildTable has 135 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function bat_buildTable(xml) {
                  var html = "", tree = [], closed = [], batcount = 0;
              
                  $("#Plugin_BAT #Plugin_BATTable").remove();
              
              
              Severity: Major
              Found in phpsysinfo/plugins/bat/js/bat.js - About 5 hrs to fix

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

                <?php
                /**
                 * System TO class
                 *
                 * PHP version 5
                Severity: Minor
                Found in phpsysinfo/includes/to/class.System.inc.php - About 5 hrs to fix

                  Function _distro has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _distro()
                      {
                          $buffer = $this->_get_Win32_OperatingSystem();
                          if ($buffer) {
                              $ver = $buffer[0]['Version'];
                  Severity: Minor
                  Found in phpsysinfo/includes/os/class.WINNT.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 _power has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function _power($hwpath)
                      {
                         $sensor = glob($hwpath."power*_input", GLOB_NOSORT);
                         if (is_array($sensor) && (($total = count($sensor)) > 0)) {
                              $buf = "";
                  Severity: Minor
                  Found in phpsysinfo/includes/mb/class.hwmon.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

                  Severity
                  Category
                  Status
                  Source
                  Language