XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _network has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

    private function _network()
    {
        $dev = null;
        if (CommonFunctions::executeProgram('netstat', '-nibd', $netstat, PSI_DEBUG)) {
            $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
Severity: Minor
Found in phpsysinfo/includes/os/class.FreeBSD.inc.php - About 1 day 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_bat has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
Open

function renderPlugin_bat(data) {
    var batcount = 0;
    var directives = {
        Name: {
            text: function () {
Severity: Minor
Found in phpsysinfo/plugins/bat/js/bat_bootstrap.js - About 1 day 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 execute has 314 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute()
    {
        if (empty($this->_filecontent)) {
            return;
        }
Severity: Major
Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 day to fix

    Function _nvme has a Cognitive Complexity of 76 (exceeds 5 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: Minor
    Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 day 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 76 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _filesystems()
        {
            $notwas = true;
            if (CommonFunctions::executeProgram('df', '2>/dev/null ', $df, PSI_DEBUG) && preg_match("/\s+[0-9\.]+[KMGT]\s+/", $df)) {
                $df = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
    Severity: Minor
    Found in phpsysinfo/includes/os/class.Android.inc.php - About 1 day 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 _distro has 301 lines of code (exceeds 25 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: Major
    Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 day to fix

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

          private function _info()
          {
              if (empty($this->_output)) {
                  return;
              }
      Severity: Minor
      Found in phpsysinfo/includes/ups/class.snmpups.inc.php - About 1 day 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 __construct has 294 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct($enc)
          {
              parent::__construct(__CLASS__, $enc);
              $buffer = array();
              switch (strtolower(PSI_PLUGIN_BAT_ACCESS)) {
      Severity: Major
      Found in phpsysinfo/plugins/bat/class.bat.inc.php - About 1 day to fix

        Function _devicelist has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
        Open

            private function _devicelist($strType)
            {
                if (empty($this->_wmidevices)) {
                    if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
                        $this->_wmidevices = CommonFunctions::getWMI($this->_wmi, 'Win32_PnPEntity', array('Name', 'PNPDeviceID', 'Manufacturer', 'PNPClass'));
        Severity: Minor
        Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 1 day 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 renderHardware has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
        Open

        function renderHardware(data) {
            var hw_type, datas, proc_param, i;
        
            if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('hardware', blocks) < 0))) {
                $("#block_hardware").remove();
        Severity: Minor
        Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 1 day 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.XML.inc.php has 649 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * XML Generation class
         *
         * PHP version 5
        Severity: Major
        Found in phpsysinfo/includes/xml/class.XML.inc.php - About 1 day to fix

          File transparency.js has 639 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* ========================================================================
           * transparency.js v0.10.0
           * http://leonidas.github.io/transparency/
           * Licensed under MIT (https://github.com/leonidas/transparency/blob/master/LICENSE)
           * ======================================================================== */
          Severity: Major
          Found in phpsysinfo/js/vendor/transparency.js - About 1 day to fix

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

            <?php
            // $Id: comment.php 506 2006-05-26 23:10:37Z skalpa $
            //  ------------------------------------------------------------------------ //
            //                XOOPS - PHP Content Management System                      //
            //                    Copyright (c) 2000 XOOPS.org                           //
            Severity: Major
            Found in kernel/mimetypes.php - About 1 day to fix

              Method _cpuinfo has 265 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _cpuinfo()
                  {
                      if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
                          $cpulist = null;
                          $raslist = null;
              Severity: Major
              Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 day to fix

                Function stablebit_buildTable has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                Open

                function stablebit_buildTable(xml) {
                    var html = "", tree = [], closed = [];
                
                    $("#Plugin_StableBit #Plugin_StableBitTable").remove();
                
                
                Severity: Minor
                Found in phpsysinfo/plugins/stablebit/js/stablebit.js - About 1 day 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 _temperature has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function _temperature()
                    {
                        $applesmc = false;
                        $sname = '';
                        foreach ($this->_lines as $line) {
                Severity: Minor
                Found in phpsysinfo/includes/mb/class.lmsensors.inc.php - About 1 day 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 66 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __construct($enc)
                    {
                        parent::__construct(__CLASS__, $enc);
                        switch (strtolower(PSI_PLUGIN_SMART_ACCESS)) {
                            case 'wmi':
                Severity: Minor
                Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 1 day 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 _buildUpsinfo has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function _buildUpsinfo()
                    {
                        $upsinfo = $this->_xml->addChild('UPSInfo');
                        if (defined('PSI_UPS_APCUPSD_CGI_ENABLE') && PSI_UPS_APCUPSD_CGI_ENABLE) {
                            $upsinfo->addAttribute('ApcupsdCgiLinks', true);
                Severity: Minor
                Found in phpsysinfo/includes/xml/class.XML.inc.php - About 1 day 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 ajax has 248 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ajax: function( url, options ) {
                
                        // If url is an object, simulate pre-1.5 signature
                        if ( typeof url === "object" ) {
                            options = url;
                Severity: Major
                Found in phpsysinfo/js/jQuery/jquery.js - About 1 day to fix

                  Function bat_buildTable has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function bat_buildTable(xml) {
                      var html = "", tree = [], closed = [], batcount = 0;
                  
                      $("#Plugin_BAT #Plugin_BATTable").remove();
                  
                  
                  Severity: Minor
                  Found in phpsysinfo/plugins/bat/js/bat.js - About 1 day 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