XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function cpuinfo has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    protected function cpuinfo()
    {
        $dev = new CpuDevice();

        if (PSI_OS == "NetBSD") {
Severity: Minor
Found in phpsysinfo/includes/os/class.BSDCommon.inc.php - About 6 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 42 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _cpuinfo()
    {
        if (CommonFunctions::rfts('/proc/cpuinfo', $bufr, 0, 4096, false)) {
            $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
            foreach ($processors as $processor) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Minix.inc.php - About 6 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 execute has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        if (count($this->_filecontent)>0) {
            foreach ($this->prog_items as $item) if (isset($this->_filecontent[$item])) {
                if ($item !== 'idrac') {
Severity: Minor
Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 6 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 _fnCalculateColumnWidths has 158 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function _fnCalculateColumnWidths ( oSettings )
        {
            var iTableWidth = oSettings.nTable.offsetWidth;
            var iUserInputs = 0;
            var iTmpWidth;
Severity: Major
Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 6 hrs to fix

    Function 4 has 158 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"./helpers":5,"./instance":6}],4:[function(require,module,exports){
    var AttributeFactory, Checkbox, Element, ElementFactory, Input, Radio, Select, TextArea, VoidElement, helpers, _,
      __hasProp = {}.hasOwnProperty,
      __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
    
    
    Severity: Major
    Found in phpsysinfo/js/vendor/transparency.js - About 6 hrs to fix

      Function _info has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

          private function _info()
          {
              foreach ($this->_output as $ups) {
      
                  $dev = new UPSDevice();
      Severity: Minor
      Found in phpsysinfo/includes/ups/class.apcupsd.inc.php - About 6 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 renderMemory has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      function renderMemory(data) {
          if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('memory', blocks) < 0))) {
              $("#block_memory").remove();
              return;
          }
      Severity: Minor
      Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 6 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 _network has 149 lines of code (exceeds 25 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: Major
      Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 5 hrs to fix

        Method execute has 149 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function execute()
            {
                if (empty($this->_filecontent) || empty($this->_ids)) {
                    return;
                }
        Severity: Major
        Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 5 hrs to fix

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

                private function _scsi()
                {
                    $getline = 0;
                    $device = null;
                    $scsiid = null;
            Severity: Minor
            Found in phpsysinfo/includes/os/class.Linux.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 install_MimeTypes has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

            function install_MimeTypes($dirname = '')
            {
                include_once(XOOPS_ROOT_PATH . '/kernel/mimetypes.php');
            
                $hModule = xoops_getHandler('module');
            Severity: Minor
            Found in modules/xoopsinfo/include/mimetypes.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 __construct has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($enc)
                {
                    parent::__construct(__CLASS__, $enc);
                    if (defined('PSI_PLUGIN_PINGTEST_ADDRESSES') && is_string(PSI_PLUGIN_PINGTEST_ADDRESSES)) {
                        if (preg_match(ARRAY_EXP, PSI_PLUGIN_PINGTEST_ADDRESSES)) {
            Severity: Minor
            Found in phpsysinfo/plugins/pingtest/class.pingtest.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

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

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

              Method execute_zpool has 144 lines of code (exceeds 25 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: Major
              Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 5 hrs to fix

                Function refreshNetwork has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                function refreshNetwork(xml) {
                    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('network', blocks) < 0))) {
                        $("#network").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 renderPlugin_ps has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                function renderPlugin_ps(data) {
                
                    var directives = {
                        MemoryUsage: {
                            html: function () {
                Severity: Minor
                Found in phpsysinfo/plugins/ps/js/ps_bootstrap.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 _network has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

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

                    protected function _parseProcStat($cpuline)
                    {
                        if (is_null($this->_cpu_loads)) {
                            $this->_cpu_loads = array();
                
                
                Severity: Minor
                Found in phpsysinfo/includes/os/class.Linux.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

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

                /*
                 * jQuery treegrid Plugin 0.3.0
                 * https://github.com/maxazan/jquery-treegrid
                 *
                 * Copyright 2013, Pomazan Max
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.treegrid.js - About 5 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language