XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function extend has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.extend = jQuery.fn.extend = function() {
    var src, copyIsArray, copy, name, options, clone,
        target = arguments[ 0 ] || {},
        i = 1,
        length = arguments.length,
Severity: Minor
Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

    Function html has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                html: function () {
                    if ((this.Details === undefined) || (this.Details["@attributes"] === undefined)) {
                        return '<div class="progress">' +
                            '<div class="progress-bar progress-bar-info" style="width:' + this["@attributes"].Percent + '%;"></div>' +
                            '</div><div class="percent">' + this["@attributes"].Percent + '%</div>';
    Severity: Minor
    Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 1 hr to fix

      Function stop has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          stop: function( type, clearQueue, gotoEnd ) {
              var stopQueue = function( hooks ) {
                  var stop = hooks.stop;
                  delete hooks.stop;
                  stop( gotoEnd );
      Severity: Minor
      Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

        Function renderPlugin_docker has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function renderPlugin_docker(data) {
        
            var directives = {
                CPUUsage: {
                    html: function () {
        Severity: Minor
        Found in phpsysinfo/plugins/docker/js/docker_bootstrap.js - About 1 hr to fix

          Method _filesystems has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function _filesystems()
              {
                  $typearray = array('Unknown', 'No Root Directory', 'Removable Disk', 'Local Disk', 'Network Drive', 'Compact Disc', 'RAM Disk');
                  $floppyarray = array('Unknown', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', '5 1/4 in.', 'Other', 'HD', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '5 1/4 in.', '3 1/2 in.', '3 1/2 in.', '8 in.');
                  $buffer = CommonFunctions::getWMI($this->_wmi, 'Win32_LogicalDisk', array('Name', 'Size', 'FreeSpace', 'FileSystem', 'DriveType', 'MediaType'));
          Severity: Minor
          Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 1 hr to fix

            Method _network has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _network()
                {
                    if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
                        $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
                        foreach ($lines as $line) {
            Severity: Minor
            Found in phpsysinfo/includes/os/class.Darwin.inc.php - About 1 hr to fix

              Method xml has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function xml()
                  {
                      foreach ($this->_result as $printer=>$markersupplies_item) {
                          $xmlsnmppinfo_printer = $this->xml->addChild("Printer");
                          $xmlsnmppinfo_printer->addAttribute("Device", $printer);
              Severity: Minor
              Found in phpsysinfo/plugins/snmppinfo/class.snmppinfo.inc.php - About 1 hr to fix

                Function addCombinator has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function addCombinator( matcher, combinator, base ) {
                    var dir = combinator.dir,
                        checkNonElements = base && dir === "parentNode",
                        doneName = done++;
                
                
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                  Function getDevice has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $("Network NetDevice", xml).each(function getDevice(id) {
                          var name = "", rx = 0, tx = 0, er = 0, dr = 0, info = "", networkindex = 0, htmlrx = '', htmltx = '';
                          name = $(this).attr("Name");
                          rx = parseInt($(this).attr("RxBytes"), 10);
                          tx = parseInt($(this).attr("TxBytes"), 10);
                  Severity: Minor
                  Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr to fix

                    Function fnFilter has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal )
                            {
                                var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
                                
                                if ( !oSettings.oFeatures.bFilter )
                    Severity: Minor
                    Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                      Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function on( elem, types, selector, data, fn, one ) {
                          var origFn, type;
                      
                          // Types can be a map of types/handlers
                          if ( typeof types === "object" ) {
                      Severity: Minor
                      Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                        Function showContentOrLoading has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function showContentOrLoading() {
                                debug('showContentOrLoading');
                                if (modal.ready && !modal.anim) {
                                    if (modal.dataReady) {
                                        if (modal.tmp.html()) {
                        Severity: Minor
                        Found in phpsysinfo/js/jQuery/jquery.nyroModal.js - About 1 hr to fix

                          Function _fnGetTdNodes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function _fnGetTdNodes ( oSettings, iIndividualRow )
                                  {
                                      var anReturn = [];
                                      var iCorrector;
                                      var anTds;
                          Severity: Minor
                          Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                            Function translate has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    translate = function (styles, href, media) {
                                        var qs = styles.replace(respond.regex.comments, "")
                                                .replace(respond.regex.keyframes, "")
                                                .match(respond.regex.media),
                                            ql = qs && qs.length || 0;
                            Severity: Minor
                            Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

                              Function showHide has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function showHide( elements, show ) {
                                  var display, elem, hidden,
                                      values = [],
                                      index = 0,
                                      length = elements.length;
                              Severity: Minor
                              Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                                Function removeModal has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function removeModal(e) {
                                        debug('removeModal');
                                        if (e)
                                            e.preventDefault();
                                        if (modal.full && modal.ready) {
                                Severity: Minor
                                Found in phpsysinfo/js/jQuery/jquery.nyroModal.js - About 1 hr to fix

                                  Method get_mimetypes has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function get_mimetypes($limit=20, $start=0, $module=-1, $OtherCriteria=null, $asobject=true) {
                                          $ret = array();
                                          $criteria = new CriteriaCompo();
                                          if ( is_object($OtherCriteria) ) {
                                              $criteria->add($OtherCriteria, 'AND');
                                  Severity: Minor
                                  Found in kernel/mimetypes.php - About 1 hr to fix

                                    Function _voltage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function _voltage()
                                        {
                                            foreach ($this->_lines as $line) {
                                                $buffer = preg_split("/\s*\|\s*/", $line);
                                                if ($buffer[2] == "Voltage" && $buffer[11] != "N/A" && $buffer[4] == "V") {
                                    Severity: Minor
                                    Found in phpsysinfo/includes/mb/class.freeipmi.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 _fans has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function _fans()
                                        {
                                            foreach ($this->_buf as $sensor) {
                                                if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Fan'))
                                                    ||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Fan')))
                                    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 13 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        private function _current()
                                        {
                                            foreach ($this->_lines as $line) {
                                                $buffer = preg_split("/\s*\|\s*/", $line);
                                                if ($buffer[2] == "Current" && $buffer[11] != "N/A" && $buffer[4] == "A") {
                                    Severity: Minor
                                    Found in phpsysinfo/includes/mb/class.freeipmi.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