XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Method list_mimetypes_perms has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function list_mimetypes_perms()
{
    global $xoopsModule, $uri, $status, $mid, $start, $type;

    $mimetypes_Handler = xoops_getHandler('mimetypes_perms');
Severity: Major
Found in modules/xoopsinfo/include/mimetypes.php - About 3 hrs to fix

    Function full_addr has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    function full_addr(ip_string) {
        var wrongvalue = false;
        ip_string = $.trim(ip_string).toLowerCase();
        // ipv4 notation
        if (ip_string.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/)) {
    Severity: Minor
    Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.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 fillCpu has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    function fillCpu(xml, tree, rootposition, collapsed) {
        var cpucount = 0, html = "";
        $("Hardware CPU CpuCore", xml).each(function getCpuCore(cpuCoreId) {
            var model = "", speed = 0, bus = 0, cache = 0, bogo = 0, temp = 0, load = 0, speedmax = 0, speedmin = 0, cpucoreposition = 0, virt = "", manufacturer = "";
            cpucount++;
    Severity: Minor
    Found in phpsysinfo/js/phpSysInfo/phpsysinfo.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 buildpage has a Cognitive Complexity of 27 (exceeds 5 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: Minor
    Found in phpsysinfo/js/phpSysInfo/phpsysinfo.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 full_addr has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

    function full_addr(ip_string) {
        var wrongvalue = false;
        ip_string = $.trim(ip_string).toLowerCase();
        // ipv4 notation
        if (ip_string.match(/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$)/)) {
    Severity: Minor
    Found in phpsysinfo/js/phpSysInfo/phpsysinfo.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 _getCodeSet has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        private function _getCodeSet()
        {
            $buffer = $this->_get_Win32_OperatingSystem();
            if (!$buffer) {
                if (CommonFunctions::readReg($this->_reg, "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\ACP", $strBuf, false)) {
    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 _info has a Cognitive Complexity of 27 (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.powersoftplus.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

    Method execute_graid has 97 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function execute_graid($buffer)
        {
            if (preg_match('/^Geom name: +([^\n\r]+)/', $buffer, $geom)) {
                $controller = trim($geom[1]);
            } else {
    Severity: Major
    Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 3 hrs to fix

      Function refreshNetwork has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function refreshNetwork(xml) {
          if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('network', blocks) < 0))) {
              $("#network").remove();
              return;
          }
      Severity: Major
      Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 3 hrs to fix

        Method _outputRenderTable has 96 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _outputRenderTable($group_name, $group_results)
            {
                // exit out if $group_results was empty or not an array. This sorta seems a little hacky...
                if (!is_array($group_results) || count($group_results) < 1) {
                    return false;
        Severity: Major
        Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 3 hrs to fix

          Function renderUPS has 95 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function renderUPS(data) {
              if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('ups', blocks) < 0))) {
                  $("#block_ups").remove();
                  return;
              }
          Severity: Major
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 3 hrs to fix

            Function getVitals has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $("Vitals", xml).each(function getVitals(id) {
                    hostname = $(this).attr("Hostname");
                    ip = $(this).attr("IPAddr");
                    kernel = $(this).attr("Kernel");
                    distro = $(this).attr("Distro");
            Severity: Major
            Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 3 hrs to fix

              Function stablebit_getdisks has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $("Plugins Plugin_StableBit Disk", xml).each(function stablebit_getdisks(id) {
                      var name = "";
                      name = $(this).attr("Name");
                      if (name !== undefined) {
                          var serialnumber = "", firmware = "", size = 0, powerstate = "", temperaturec = "",
              Severity: Major
              Found in phpsysinfo/plugins/stablebit/js/stablebit.js - About 3 hrs to fix

                Method _buildMbinfo has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function _buildMbinfo()
                    {
                        $mbinfo = $this->_xml->addChild('MBInfo');
                        $temp = $fan = $volt = $power = $current = $other = null;
                
                
                Severity: Major
                Found in phpsysinfo/includes/xml/class.XML.inc.php - About 3 hrs to fix

                  Function renderPlugin_stablebit has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function renderPlugin_stablebit(data) {
                  
                      var directives = {
                          IsHot: {
                              html: function () {
                  Severity: Major
                  Found in phpsysinfo/plugins/stablebit/js/stablebit_bootstrap.js - About 3 hrs to fix

                    Function fnUpdate has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                "fnUpdate": function ( oSettings, fnCallbackDraw )
                                {
                                    if ( !oSettings.aanFeatures.p )
                                    {
                                        return;
                    Severity: Major
                    Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 3 hrs to fix

                      Function refreshMemory has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function refreshMemory(xml) {
                          if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('memory', blocks) < 0))) {
                              $("#memory").remove();
                              return;
                          }
                      Severity: Minor
                      Found in phpsysinfo/js/phpSysInfo/phpsysinfo.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 cpuinfo has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function cpuinfo()
                          {
                              $dev = new CpuDevice();
                              $dev->setModel($this->grabkey('hw.model'));
                              $dev->setCpuSpeed($this->grabkey('hw.cpuspeed'));
                      Severity: Minor
                      Found in phpsysinfo/includes/os/class.OpenBSD.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 trigger has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          trigger: function( event, data, elem, onlyHandlers ) {
                              var handle, ontype, cur,
                                  bubbleType, special, tmp, i,
                                  eventPath = [ elem || document ],
                                  type = hasOwn.call( event, "type" ) ? event.type : event,
                      Severity: Major
                      Found in phpsysinfo/js/jQuery/jquery.js - About 3 hrs to fix

                        Function Animation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function Animation( elem, properties, options ) {
                            var result,
                                stopped,
                                index = 0,
                                length = Animation.prefilters.length,
                        Severity: Major
                        Found in phpsysinfo/js/jQuery/jquery.js - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language