XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function quotas_buildTable has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function quotas_buildTable() {
    var html = "";

    html += "<div style=\"overflow-x:auto;\">\n";
    html += "  <table id=\"Plugin_QuotasTable\" style=\"border-collapse:collapse;\">\n";
Severity: Minor
Found in phpsysinfo/plugins/quotas/js/quotas.js - About 2 hrs to fix

    Method cpuinfo has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function cpuinfo()
        {
            $dev = new CpuDevice();
            if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
                $dev->setModel(preg_replace('/Processor type: /', '', $buf));
    Severity: Minor
    Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 2 hrs to fix

      Method _buildVitals has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function _buildVitals()
          {
              $vitals = $this->_xml->addChild('Vitals');
              $vitals->addAttribute('Hostname', $this->_sys->getHostname());
              $vitals->addAttribute('IPAddr', $this->_sys->getIp());
      Severity: Minor
      Found in phpsysinfo/includes/xml/class.XML.inc.php - About 2 hrs to fix

        Method __construct has 50 lines of code (exceeds 25 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 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if ($editor['class'] && is_readable(XOOPS_ROOT_PATH . $editor['class']) && $isModule) {
                  echo '<img src="../images/icons/on.gif" alt="' . _AM_XI_EDITOR_OK . '"align="absmiddle" />';
              } elseif ($editor['class'] && is_readable(XOOPS_ROOT_PATH . $editor['class']) && $editor['dirname'] && !$isModule) {
                  echo '<img src="../images/icons/notinstalled.gif" alt="' . _AM_XI_EDITOR_MODULE . '"align="absmiddle" />';
              } elseif ($editor['class'] && !is_readable(XOOPS_ROOT_PATH . $editor['class']) && $isModule) {
          Severity: Critical
          Found in modules/xoopsinfo/admin/editors.php - About 2 hrs to fix

            Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function internalRemoveData( elem, name, pvt ) {
                if ( !acceptData( elem ) ) {
                    return;
                }
            
            
            Severity: Minor
            Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

              Function _fnAddData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function _fnAddData ( oSettings, aDataSupplied )
                      {
                          var oCol;
                          
                          /* Take an independent copy of the data source so we can bash it about as we wish */
              Severity: Minor
              Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                Function _fnAddColumn has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function _fnAddColumn( oSettings, nTh )
                        {
                            var iCol = oSettings.aoColumns.length;
                            var oCol = {
                                "sType": null,
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                  Method _parseProcStat has 49 lines of code (exceeds 25 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 1 hr to fix

                    Function internalData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
                        if ( !acceptData( elem ) ) {
                            return;
                        }
                    
                    
                    Severity: Minor
                    Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                      Function 3 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      },{"../lib/lodash":7,"./helpers":5}],3:[function(require,module,exports){
                      var Context, Instance, after, before, chainable, cloneNode, _ref;
                      
                      _ref = require('./helpers'), before = _ref.before, after = _ref.after, chainable = _ref.chainable, cloneNode = _ref.cloneNode;
                      
                      
                      Severity: Minor
                      Found in phpsysinfo/js/vendor/transparency.js - About 1 hr to fix

                        Method _bootStrap has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function _bootStrap($packed, $keywords)
                            {
                                $ENCODE = $this->_safeRegExp('$encode\\($count\\)');
                        
                                // $packed: the packed script
                        Severity: Minor
                        Found in phpsysinfo/includes/js/class.JavaScriptPacker.inc.php - About 1 hr to fix

                          Method _network has 48 lines of code (exceeds 25 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.Haiku.inc.php - About 1 hr to fix

                            Method insert has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function insert(&$mimetype_object, $force = false) {
                                    if (strtolower(get_class($mimetype_object)) != 'xoopsmimetypes') {
                                        return false;
                                    }
                                    if (!$mimetype_object->isDirty()) {
                            Severity: Minor
                            Found in kernel/mimetypes.php - About 1 hr to fix

                              Function reload has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function reload(initiate) {
                                  $.ajax({
                                      url: 'xml.php',
                                      dataType: 'xml',
                                      error: function error() {
                              Severity: Minor
                              Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr 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 raid_diskicon has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function raid_diskicon(xml, id) {
                                  $("RaidItems Item", xml).each(function raid_getitems(itemid) {
                                      var status = "", name = "", type = "", info = "", parentid = 0;
                              
                                      status = $(this).attr("Status");
                              Severity: Minor
                              Found in phpsysinfo/plugins/raid/js/raid.js - About 1 hr 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 _replacement has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function _replacement($arguments)
                                  {
                                      if (empty($arguments)) return '';
                              
                                      $i = 1; $j = 0;
                              Severity: Minor
                              Found in phpsysinfo/includes/js/class.JavaScriptPacker.inc.php - About 1 hr 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 removeDupsAndCount has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function removeDupsAndCount($arrDev)
                                  {
                                      $result = array();
                                      foreach ($arrDev as $dev) {
                                          if (count($result) === 0) {
                              Severity: Minor
                              Found in phpsysinfo/includes/to/class.System.inc.php - About 1 hr 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 _voltage has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function _voltage()
                                  {
                                      foreach ($this->_buf as $sensor) {
                                          if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Voltage'))
                                              ||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Voltage')))
                              Severity: Minor
                              Found in phpsysinfo/includes/mb/class.ipmitool.inc.php - About 1 hr 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 _current has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function _current()
                                  {
                                      foreach ($this->_buf as $sensor) {
                                          if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Current'))
                                              ||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Current')))
                              Severity: Minor
                              Found in phpsysinfo/includes/mb/class.ipmitool.inc.php - About 1 hr 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