XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function renderPlugin_smart has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderPlugin_smart(data) {

    if ((data.Plugins.Plugin_SMART !== undefined) && (data.Plugins.Plugin_SMART.columns !== undefined) && (items(data.Plugins.Plugin_SMART.columns.column).length > 0) && (data.Plugins.Plugin_SMART.disks !== undefined) && (items(data.Plugins.Plugin_SMART.disks.disk).length > 0)) {
        var smartitems = items(data.Plugins.Plugin_SMART.columns.column);
        var smartnames = {
Severity: Major
Found in phpsysinfo/plugins/smart/js/smart_bootstrap.js - About 3 hrs to fix

    Function snmppinfo_buildTable has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function snmppinfo_buildTable(xml) {
        var html = "", tree = [], closed = [];
    
        $("#Plugin_SNMPPInfo #Plugin_SNMPPInfoTable").remove();
    
    
    Severity: Major
    Found in phpsysinfo/plugins/snmppinfo/js/snmppinfo.js - About 3 hrs to fix

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

      <?php
      /**
       * SMART plugin, which displays all SMART informations available
       *
       * @category  PHP
      Severity: Minor
      Found in phpsysinfo/plugins/smart/class.smart.inc.php - About 3 hrs to fix

        Function buildFragment has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function buildFragment( elems, context, scripts, selection, ignored ) {
            var j, elem, contains,
                tmp, tag, tbody, wrap,
                l = elems.length,
        
        
        Severity: Major
        Found in phpsysinfo/js/jQuery/jquery.js - About 3 hrs to fix

          Function raid_buildinfos has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

          function raid_buildinfos(xml, id) {
              var html = "", prog = "", devname = "", devstatus = "", devlevel = "", devcontroller = "", devbattery = "", devsupported = "", devsize = 0, devstride = 0, devsubsets = 0, devdevs = 0, devspares = 0, devchunk = 0, devalgor = "", devpersist = 0, devreg = 0, devact = 0, devcache = 0, devbad = 0, devread = "", devwrite = "", button = "";
          
              prog = $(xml).attr("Program");
              devname = $(xml).attr("Name");
          Severity: Minor
          Found in phpsysinfo/plugins/raid/js/raid.js - About 3 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 _hardware has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _hardware()
              {
                  foreach ($this->_devicelist('PCI') as $pciDev) {
                      $dev = new HWDevice();
                      $dev->setName($pciDev['Name']);
          Severity: Minor
          Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
          Open

              private function _cpuinfo()
              {
                  $ncpu = 0;
                  $tcpu = "";
                  $vcpu = "";
          Severity: Minor
          Found in phpsysinfo/includes/os/class.AIX.inc.php - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
          Open

              public function execute()
              {
                  if (empty($this->_filecontent)) {
                      return;
                  }
          Severity: Minor
          Found in phpsysinfo/plugins/ps/class.ps.inc.php - About 3 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 fnSetColumnVis has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  this.fnSetColumnVis = function ( iCol, bShow, bRedraw )
                  {
                      var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
                      var i, iLen;
                      var iColumns = oSettings.aoColumns.length;
          Severity: Major
          Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 3 hrs to fix

            Method _findProgram has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function _findProgram($strProgram)
                {
                    $path_parts = pathinfo($strProgram);
                    if (empty($path_parts['basename'])) {
                        return null;
            Severity: Major
            Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 3 hrs to fix

              File main.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                Function _fnSortAttachListener has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function _fnSortAttachListener ( oSettings, nNode, iDataIndex, fnCallback )
                        {
                            $(nNode).on( 'click.DT', function (e) {
                                /* If the column is not sortable - don't to anything */
                                if ( oSettings.aoColumns[iDataIndex].bSortable === false )
                Severity: Major
                Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 3 hrs to fix

                  Function 5 has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  },{"../lib/lodash.js":7,"./attributeFactory":2,"./helpers":5}],5:[function(require,module,exports){
                  var ElementFactory, expando, html5Clone, _getElements;
                  
                  ElementFactory = require('./elementFactory');
                  
                  
                  Severity: Major
                  Found in phpsysinfo/js/vendor/transparency.js - About 3 hrs to fix

                    Function add has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        add: function( elem, types, handler, data, selector ) {
                            var tmp, events, t, handleObjIn,
                                special, eventHandle, handleObj,
                                handlers, type, namespaces, origType,
                                elemData = jQuery._data( elem );
                    Severity: Major
                    Found in phpsysinfo/js/jQuery/jquery.js - About 3 hrs to fix

                      Function _fnInitialise has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function _fnInitialise ( oSettings )
                              {
                                  var i, iLen, iAjaxStart=oSettings.iInitDisplayStart;
                                  
                                  /* Ensure that the table data is fully initialised */
                      Severity: Major
                      Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 3 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                                        if (preg_match('/^I:\s+(.+)/', $buf, $bufr)
                                           && isset($bufr[1]) && (trim($bufr[1])!=="")) {
                                            $devnam = trim($bufr[1]);
                                            $usbarray[$devnam]['phys'] = 'unknown';
                                        } elseif (preg_match('/^N:\s+Name="([^"]+)"/', $buf, $bufr2)
                        Severity: Critical
                        Found in phpsysinfo/includes/os/class.Linux.inc.php - About 3 hrs to fix

                          Function buildpage has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          $(document).ready(function buildpage() {
                              var i = 0, old_template = null, cookie_template = null, cookie_language = null, blocktmp = "";
                          
                              showCPUListExpanded = $("#showCPUListExpanded").val().toString()==="true";
                              showCPUInfoExpanded = $("#showCPUInfoExpanded").val().toString()==="true";
                          Severity: Major
                          Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 2 hrs to fix

                            Function renderPlugin_ps has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function renderPlugin_ps(data) {
                            
                                var directives = {
                                    MemoryUsage: {
                                        html: function () {
                            Severity: Major
                            Found in phpsysinfo/plugins/ps/js/ps_bootstrap.js - About 2 hrs to fix

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

                              function changeSpanLanguage(plugin) {
                                  var langId = "", langStr = "", langarrId = current_language + "_";
                              
                                  if (plugin === undefined) {
                                      langarrId += "phpSysInfo";
                              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 changeSpanLanguage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function changeSpanLanguage(plugin) {
                                  var langId = "", langStr = "", langarrId = current_language + "_";
                              
                                  if (plugin === undefined) {
                                      langarrId += "phpSysInfo";
                              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

                              Severity
                              Category
                              Status
                              Source
                              Language