XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _temperature has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private function _temperature()
    {
        foreach ($this->_lines as $line) {
            $buffer = preg_split("/\s*\|\s*/", $line);
            if (isset($buffer[2]) && $buffer[2] == "Temperature"
Severity: Minor
Found in phpsysinfo/includes/mb/class.ipmiutil.inc.php - About 2 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 _cpuinfo has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private function _cpuinfo()
    {
        if (CommonFunctions::executeProgram('kstat', '-p d cpu_info:*:cpu_info*:core_id', $m, PSI_DEBUG) && ($m!=="")) {
            $cpuc = count(preg_split('/\n/', $m, -1, PREG_SPLIT_NO_EMPTY));
            for ($cpu=0; $cpu < $cpuc; $cpu++) {
Severity: Minor
Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 2 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 matcherFromGroupMatchers has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
    var bySet = setMatchers.length > 0,
        byElement = elementMatchers.length > 0,
        superMatcher = function( seed, context, xml, results, outermost ) {
            var elem, j, matcher,
Severity: Major
Found in phpsysinfo/js/jQuery/jquery.js - About 2 hrs to fix

    Function _fnSort has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function _fnSort ( oSettings, bApplyClasses )
            {
                var
                    iDataSort, iDataType,
                    i, iLen, j, jLen,
    Severity: Major
    Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 2 hrs to fix

      Function refreshFilesystems has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function refreshFilesystems(xml) {
          if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('filesystem', blocks) < 0))) {
              $("#filesystem").remove();
              return;
          }
      Severity: Major
      Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 2 hrs to fix

        Function fillCpu has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function fillCpu(xml, tree, rootposition, collapsed) {
            var cpucount = 0, html = "";
            $("Hardware CPU CpuCore", xml).each(function getCpuCore(cpuCoreId) {
                var model = "", speed = 0, bus = 0, cache = 0, bogo = 0, temp = 0, load = 0, speedmax = 0, speedmin = 0, cpucoreposition = 0, virt = "", manufacturer = "";
                cpucount++;
        Severity: Major
        Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 2 hrs to fix

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

              private function _temperature()
              {
                  if (PSI_OS == 'WINNT') {
                      if ($this->_buf) foreach ($this->_buf as $buffer) {
                          if (isset($buffer['CurrentTemperature']) && (($value = ($buffer['CurrentTemperature'] - 2732)/10) > -100)) {
          Severity: Major
          Found in phpsysinfo/includes/mb/class.thermalzone.inc.php - About 2 hrs to fix

            Method _nvme has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _nvme()
                {
                    if (CommonFunctions::executeProgram('nvme', 'list', $bufr, PSI_DEBUG) && ($bufr!="")) {
                        $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                        $count = 0;
            Severity: Major
            Found in phpsysinfo/includes/os/class.Linux.inc.php - About 2 hrs to fix

              Function formatBPS has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              function formatBPS(bps) {
                  var show = "";
              
                  if (bps > Math.pow(1000, 5)) {
                      show += round(bps / Math.pow(1000, 5), 2);
              Severity: Minor
              Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 2 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 formatBPS has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

              function formatBPS(bps) {
                  var show = "";
              
                  if (bps > Math.pow(1000, 5)) {
                      show += round(bps / Math.pow(1000, 5), 2);
              Severity: Minor
              Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _power()
                  {
                      foreach ($this->_lines as $line) {
                          $buffer = preg_split("/\s*\|\s*/", $line);
                          if (isset($buffer[2]) && $buffer[2] == "Current"
              Severity: Minor
              Found in phpsysinfo/includes/mb/class.ipmiutil.inc.php - About 2 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 __construct has a Cognitive Complexity of 20 (exceeds 5 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 2 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 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function _ide()
                  {
                      $bufd = CommonFunctions::gdc('/proc/ide', false);
                      foreach ($bufd as $file) {
                          if (preg_match('/^hd/', $file)) {
              Severity: Minor
              Found in phpsysinfo/includes/os/class.Linux.inc.php - About 2 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 __construct has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct()
                  {
                      parent::__construct();
                      if (defined('PSI_UPS_NUT_LIST') && is_string(PSI_UPS_NUT_LIST)) {
                          if (preg_match(ARRAY_EXP, PSI_UPS_NUT_LIST)) {
              Severity: Minor
              Found in phpsysinfo/includes/ups/class.nut.inc.php - About 2 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 _timeoutfgets has a Cognitive Complexity of 20 (exceeds 5 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 2 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 getUprecords has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function getUprecords()
                  {
                      $result = array();
                      $i = 0;
              
              
              Severity: Minor
              Found in phpsysinfo/plugins/uprecords/class.uprecords.inc.php - About 2 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 done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function done( status, nativeStatusText, responses, headers ) {
                          var isSuccess, success, error, response, modified,
                              statusText = nativeStatusText;
              
                          // Called once
              Severity: Major
              Found in phpsysinfo/js/jQuery/jquery.js - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                                        if ( forward && useCache ) {
                
                                            // Seek `elem` from a previously-cached index
                
                                            // ...in a gzip-friendly way
                Severity: Critical
                Found in phpsysinfo/js/jQuery/jquery.js - About 2 hrs to fix

                  PhpSecInfo_Test has 24 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PhpSecInfo_Test
                  {
                      /**
                       * This value is used to group test results together.
                       * For example, all tests related to the mysql lib should be grouped under "mysql."
                  Severity: Minor
                  Found in phpsecinfo/PhpSecInfo/Test/Test.php - About 2 hrs to fix

                    Function setMatcher has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
                        if ( postFilter && !postFilter[ expando ] ) {
                            postFilter = setMatcher( postFilter );
                        }
                        if ( postFinder && !postFinder[ expando ] ) {
                    Severity: Major
                    Found in phpsysinfo/js/jQuery/jquery.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language