XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _fnDrawHead has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function _fnDrawHead( oSettings, aoSource, bIncludeHidden )
        {
            var i, iLen, j, jLen, k, kLen;
            var aoLocal = [];
            var aApplied = [];
Severity: Major
Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 2 hrs to fix

    Function ajaxConvert has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ajaxConvert( s, response, jqXHR, isSuccess ) {
        var conv2, current, conv, tmp, prev,
            converters = {},
    
            // Work with a copy of dataTypes in case we need to modify it for conversion
    Severity: Major
    Found in phpsysinfo/js/jQuery/jquery.js - About 2 hrs to fix

      Method scsi has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function scsi()
          {
              foreach ($this->readdmesg() as $line) {
                  if (preg_match($this->_SCSIRegExp1, $line, $ar_buf)) {
                      $dev = new HWDevice();
      Severity: Major
      Found in phpsysinfo/includes/os/class.BSDCommon.inc.php - About 2 hrs to fix

        Method _distro has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function _distro()
            {
                $buffer = $this->_get_Win32_OperatingSystem();
                if ($buffer) {
                    $ver = $buffer[0]['Version'];
        Severity: Major
        Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 2 hrs to fix

          Method prtconf has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function prtconf()
              {
                  if ($this->_prtconf === null) {
                      $this->_prtconf = array();
                      if (CommonFunctions::executeProgram('prtconf', '-v', $buf, PSI_DEBUG) && ($buf!="")) {
          Severity: Major
          Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                                if ((version_compare("10.0.0.0", $ip, "<=") && version_compare($ip, "10.255.255.255", "<=")) ||
                                    (version_compare("172.16.0.0", $ip, "<=") && version_compare($ip, "172.31.255.255", "<=")) ||
                                    (version_compare("192.168.0.0", $ip, "<=") && version_compare($ip, "192.168.255.255", "<=")) ||
                                    (version_compare("127.0.0.0", $ip, "<=") && version_compare($ip, "127.255.255.255", "<=")) ||
                                    (version_compare("169.254.1.0", $ip, "<=") && version_compare($ip, "169.254.254.255", "<=")) ||
            Severity: Critical
            Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                                      if (($impl === '0x41')
                                         && (($_hard === 'BCM2708') || ($_hard === 'BCM2835') || ($_hard === 'BCM2709') || ($_hard === 'BCM2836') || ($_hard === 'BCM2710') || ($_hard === 'BCM2837') || ($_hard === 'BCM2711') || ($_hard === 'BCM2838'))
                                         && ($_revi !== null)) { // Raspberry Pi detection (instead of 'cat /proc/device-tree/model')
                                          if ($raslist === null) $raslist = @parse_ini_file(PSI_APP_ROOT."/data/raspberry.ini", true);
                                          if ($raslist && !preg_match('/[^0-9a-f]/', $_revi)) {
              Severity: Critical
              Found in phpsysinfo/includes/os/class.Linux.inc.php - About 2 hrs to fix

                BSDCommon has 22 functions (exceeds 20 allowed). Consider refactoring.
                Open

                abstract class BSDCommon extends OS
                {
                    /**
                     * content of the syslog
                     *
                Severity: Minor
                Found in phpsysinfo/includes/os/class.BSDCommon.inc.php - About 2 hrs to fix

                  Function applyMedia has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          applyMedia = function (fromResize) {
                              var name = "clientWidth",
                                  docElemProp = docElem[name],
                                  currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp,
                                  styleBlocks = {},
                  Severity: Major
                  Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 2 hrs to fix

                    Method install_MimeTypes has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function install_MimeTypes($dirname = '')
                    {
                        include_once(XOOPS_ROOT_PATH . '/kernel/mimetypes.php');
                    
                        $hModule = xoops_getHandler('module');
                    Severity: Major
                    Found in modules/xoopsinfo/include/mimetypes.php - About 2 hrs to fix

                      Function shivPrint has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function shivPrint(ownerDocument) {
                          var shivedSheet,
                              wrappers,
                              data = getExpandoData(ownerDocument),
                              namespaces = ownerDocument.namespaces,
                      Severity: Major
                      Found in phpsysinfo/js/vendor/html5shiv-printshiv.js - About 2 hrs to fix

                        Method _buildUpsinfo has 57 lines of code (exceeds 25 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: Major
                        Found in phpsysinfo/includes/xml/class.XML.inc.php - About 2 hrs to fix

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

                              public function xml()
                              {
                                  if (empty($this->_result)) {
                                      return $this->xml->getSimpleXmlElement();
                                  }
                          Severity: Major
                          Found in phpsysinfo/plugins/raid/class.raid.inc.php - About 2 hrs to fix

                            Function _get_Win32_PerfFormattedData_PerfOS_Processor has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function _get_Win32_PerfFormattedData_PerfOS_Processor()
                                {
                                    if ($this->_Win32_PerfFormattedData_PerfOS_Processor === null) {
                                        $this->_Win32_PerfFormattedData_PerfOS_Processor = array();
                                        $buffer = $this->_get_Win32_OperatingSystem();
                            Severity: Minor
                            Found in phpsysinfo/includes/os/class.WINNT.inc.php - 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 _loadavg has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function _loadavg()
                                {
                                    if (($cpubuffer = $this->_get_Win32_PerfFormattedData_PerfOS_Processor()) && isset($cpubuffer['cpu_Total'])) {
                                        $this->sys->setLoad($cpubuffer['cpu_Total']);
                                        if (PSI_LOAD_BAR) {
                            Severity: Minor
                            Found in phpsysinfo/includes/os/class.WINNT.inc.php - 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 _cpuinfo has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function _cpuinfo()
                                {
                                    if (CommonFunctions::rfts('/proc/cpuinfo', $bufr)) {
                                        $processors = preg_split('/\s?\n\s?\n/', trim($bufr));
                                        foreach ($processors as $processor) {
                            Severity: Minor
                            Found in phpsysinfo/includes/os/class.HPUX.inc.php - 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 _processes has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function _processes()
                                {
                                    if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
                                        $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                                        $processes['*'] = 0;
                            Severity: Minor
                            Found in phpsysinfo/includes/os/class.OpenBSD.inc.php - 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 _processes has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function _processes()
                                {
                                    if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
                                        $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                                        $processes['*'] = 0;
                            Severity: Minor
                            Found in phpsysinfo/includes/os/class.DragonFly.inc.php - 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 _memory has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function _memory()
                                {
                                    if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
                                        $bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
                                        foreach ($bufe as $buf) {
                            Severity: Minor
                            Found in phpsysinfo/includes/os/class.Linux.inc.php - 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 ide has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function ide()
                                {
                                    foreach ($this->readdmesg() as $line) {
                                        if (preg_match('/^(.*) at pciide[0-9]+ (.*): <(.*)>/', $line, $ar_buf)) {
                                            $dev = new HWDevice();
                            Severity: Minor
                            Found in phpsysinfo/includes/os/class.OpenBSD.inc.php - 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