XoopsModules25x/xoopsinfo

View on GitHub

Showing 16,781 of 16,781 total issues

Function dataTable has 4156 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.dataTable = function( oInit )
    {
        /*
         * Function: classSettings
         * Purpose:  Settings container function for all 'class' properties which are required
Severity: Major
Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 2 wks to fix

    File jquery.js has 7071 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.12.4-ff3fix-ff2fix
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in phpsysinfo/js/jQuery/jquery.js - About 2 wks to fix

      File jquery.dataTables.js has 4633 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * File:        jquery.dataTables.js
       * Version:     1.8.2+jquery1.9fix+parseJSONfix2+bindfix
       * Description: Paginate, search and sort HTML tables
       * Author:      Allan Jardine (www.sprymedia.co.uk)
      Severity: Major
      Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 wk to fix

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

        <?php
        
        declare(strict_types=1);
        
        /**
        Severity: Major
        Found in modules/xoopsinfo/language/french/admin.php and 1 other location - About 1 wk to fix
        modules/xoopsinfo/language/english/admin.php on lines 1..167

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

        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

        <?php
        
        declare(strict_types=1);
        
        /**
        Severity: Major
        Found in modules/xoopsinfo/language/english/admin.php and 1 other location - About 1 wk to fix
        modules/xoopsinfo/language/french/admin.php on lines 1..168

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

        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

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

            protected function _distro()
            {
                $this->sys->setDistribution("Linux");
                $list = @parse_ini_file(PSI_APP_ROOT."/data/distros.ini", true);
                if (!$list) {
        Severity: Minor
        Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 wk 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 365 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct($enc)
            {
                parent::__construct(__CLASS__, $enc);
                $buffer = array();
                switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
        Severity: Minor
        Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 wk 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 Sizzle has 1387 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        (function( window ) {
        
        var i,
            support,
            Expr,
        Severity: Major
        Found in phpsysinfo/js/jQuery/jquery.js - About 6 days to fix

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

              public function execute()
              {
                  if (empty($this->_filecontent)) {
                      return;
                  }
          Severity: Minor
          Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 6 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 _cpuinfo has a Cognitive Complexity of 307 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _cpuinfo()
              {
                  if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
                      $cpulist = null;
                      $raslist = null;
          Severity: Minor
          Found in phpsysinfo/includes/os/class.Linux.inc.php - About 6 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 _network has a Cognitive Complexity of 289 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _network()
              {
                  if (CommonFunctions::rfts('/proc/net/dev', $bufr, 0, 4096, PSI_DEBUG)) {
                      $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                      foreach ($bufe as $buf) {
          Severity: Minor
          Found in phpsysinfo/includes/os/class.Linux.inc.php - About 5 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 execute_idrac has a Cognitive Complexity of 262 (exceeds 5 allowed). Consider refactoring.
          Open

              private function execute_idrac($buffer, $device)
              {
                  $snmptablec = array(); //controller table
                  $snmptableb = array(); //battery table
                  $snmptablev = array(); //virtual disks table
          Severity: Minor
          Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 5 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 _network has a Cognitive Complexity of 259 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _network()
              {
                  if ($this->_wmi) {
                      $buffer = $this->_get_Win32_OperatingSystem();
                      if ($buffer && isset($buffer[0]) && isset($buffer[0]['Version']) && version_compare($buffer[0]['Version'], "6.2", ">=")) { // minimal windows 2012 or windows 8
          Severity: Minor
          Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 5 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 execute_zpool has a Cognitive Complexity of 228 (exceeds 5 allowed). Consider refactoring.
          Open

              private function execute_zpool($buffer)
              {
                  $raiddata = preg_split("/(\r?\n)+ +(?=pool: )/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
                  if (!empty($raiddata)) foreach ($raiddata as $raid) {
                      if (preg_match("/^pool: (\S+)/", $raid, $buff)) {
          Severity: Minor
          Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 4 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 df has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function df($df_param = "", $get_inodes = true)
              {
                  $arrResult = array();
                  if (CommonFunctions::executeProgram('mount', '', $mount, PSI_DEBUG)) {
                      $mount = preg_split("/\n/", $mount, -1, PREG_SPLIT_NO_EMPTY);
          Severity: Minor
          Found in phpsysinfo/includes/class.Parser.inc.php - About 4 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 phpsysinfo_bootstrap.js has 1633 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var langxml = [], langarr = [], current_language = "", plugins = [], blocks = [], plugin_liste = [],
               showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, oldnetwork = [], refrTimer;
          
          /**
           * generate a cookie, if not exist, and add an entry to it<br><br>
          Severity: Major
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 4 days to fix

            File phpsysinfo.js has 1577 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /***************************************************************************
             *   Copyright (C) 2008 by phpSysInfo - A PHP System Information Script    *
             *   http://phpsysinfo.sourceforge.net/                                    *
             *                                                                         *
             *   This program is free software; you can redistribute it and/or modify  *
            Severity: Major
            Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 4 days to fix

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

              <?php
              /**
               * Linux System Class
               *
               * PHP version 5
              Severity: Major
              Found in phpsysinfo/includes/os/class.Linux.inc.php - About 3 days to fix

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

                (function() {
                  Object.defineProperty(Element.prototype, 'classList', {
                    get:function(){
                        var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
                        if (domTokenList[0]==='') domTokenList.splice(0,1);
                Severity: Major
                Found in phpsysinfo/js/vendor/bootstrap-ie8.js and 1 other location - About 3 days to fix
                phpsysinfo/js/vendor/bootstrap-ie9.js on lines 16..64

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

                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

                (function() {
                  Object.defineProperty(Element.prototype, 'classList', {
                    get:function(){
                        var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
                        if (domTokenList[0]==='') domTokenList.splice(0,1);
                Severity: Major
                Found in phpsysinfo/js/vendor/bootstrap-ie9.js and 1 other location - About 3 days to fix
                phpsysinfo/js/vendor/bootstrap-ie8.js on lines 154..202

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

                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

                Severity
                Category
                Status
                Source
                Language