XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _distro has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function _distro()
    {
        if (CommonFunctions::rfts('/etc/release', $buf, 1, 4096, false) && (trim($buf)!="")) {
            $this->sys->setDistribution(trim($buf));
            $list = @parse_ini_file(PSI_APP_ROOT."/data/distros.ini", true);
Severity: Minor
Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 55 mins 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 pci has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function pci()
    {
        if ((!$results = Parser::lspci(false)) && (!$results = $this->pciconf())) {
            foreach ($this->readdmesg() as $line) {
                if (preg_match($this->_PCIRegExp1, $line, $ar_buf)) {
Severity: Minor
Found in phpsysinfo/includes/os/class.BSDCommon.inc.php - About 55 mins 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 _filesystems has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function _filesystems()
    {
        $df_args = "";
        $hideFstypes = array();
        if (defined('PSI_HIDE_FS_TYPES') && is_string(PSI_HIDE_FS_TYPES)) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Linux.inc.php - About 55 mins 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 _hostname has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function _hostname()
    {
        if (PSI_USE_VHOST === true) {
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
        } else {
Severity: Minor
Found in phpsysinfo/includes/os/class.Haiku.inc.php - About 55 mins 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 _hostname has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function _hostname()
    {
        if (PSI_USE_VHOST === true) {
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
        } else {
Severity: Minor
Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 55 mins 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 _hostname has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function _hostname()
    {
        if (PSI_USE_VHOST === true) {
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
        } else {
Severity: Minor
Found in phpsysinfo/includes/os/class.Minix.inc.php - About 55 mins 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 _copyFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function _copyFile($chmod) {
        $matched = array();
        if (!preg_match("/\.([a-zA-Z0-9]+)$/", $this->mediaName, $matched)) {
            return false;
        }
Severity: Minor
Found in class/uploader.php - About 55 mins 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 XoopsInfo_GetLastVersion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function XoopsInfo_GetLastVersion()
{
    global $modversion;

    $version = @file_get_contents($modversion['status_fileinfo']);
Severity: Minor
Found in modules/xoopsinfo/include/functions.php - About 55 mins 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 access has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Severity: Major
Found in phpsysinfo/js/jQuery/jquery.js - About 50 mins to fix

    Method get_mimetypes has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        function get_mimetypes($limit=20, $start=0, $status=-1, $OtherCriteria=null, $sort='mime_ext', $order='ASC', $asobject=true) {
    Severity: Major
    Found in kernel/mimetypes.php - About 50 mins to fix

      Function refreshHardware has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function refreshHardware(xml) {
          if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('hardware', blocks) < 0))) {
              $("#hardware").remove();
              return;
          }
      Severity: Minor
      Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                          if (bytes > Math.pow(1024, 2)) {
                              show += round(bytes / Math.pow(1024, 2), 2);
                              show += String.fromCharCode(160) + genlang(88);
                          } else {
                              if (bytes > Math.pow(1024, 1)) {
      Severity: Major
      Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 45 mins to fix

        Function setMatcher has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
        Severity: Minor
        Found in phpsysinfo/js/jQuery/jquery.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if (bps > Math.pow(1000, 1)) {
                                  show += round(bps / Math.pow(1000, 1), 2);
                                  show += String.fromCharCode(160) + 'Kb/s';
                              } else {
                                      show += bps;
          Severity: Major
          Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 45 mins to fix

            Function renderOther has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function renderOther(data) {
                if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('other', blocks) < 0))) {
                    $("#block_other").remove();
                    return;
                }
            Severity: Minor
            Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 45 mins 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

            Avoid deeply nested control flow statements.
            Open

                                if (bytes > Math.pow(1000, 2)) {
                                    show += round(bytes / Math.pow(1000, 2), 2);
                                    show += "&nbsp;" + genlang(40);
                                } else {
                                    if (bytes > Math.pow(1000, 1)) {
            Severity: Major
            Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 45 mins to fix

              Function on has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function on( elem, types, selector, data, fn, one ) {
              Severity: Minor
              Found in phpsysinfo/js/jQuery/jquery.js - About 45 mins to fix

                Function getLanguage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                function getLanguage(plugin, langarrId) {
                    var getLangUrl = "";
                    if (current_language) {
                        getLangUrl = 'language/language.php?lang=' + current_language;
                        if (plugin) {
                Severity: Minor
                Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                    if (bps > Math.pow(1000, 1)) {
                                        show += round(bps / Math.pow(1000, 1), 2);
                                        show += String.fromCharCode(160) + 'Kb/s';
                                    } else {
                                            show += bps;
                Severity: Major
                Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (bytes > Math.pow(1000, 2)) {
                                          show += round(bytes / Math.pow(1000, 2), 2);
                                          show += String.fromCharCode(160) + genlang(40);
                                      } else {
                                          if (bytes > Math.pow(1000, 1)) {
                  Severity: Major
                  Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language