XoopsModules25x/userlog

View on GitHub

Showing 113 of 1,244 total issues

Avoid deeply nested control flow statements.
Open

                        if (el.options[i].value != '') {
                            el.value = el.options[i].value;
                            break; // loop exit
                        }
Severity: Major
Found in assets/js/scripts.js - About 45 mins to fix

    Function validate has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function validate(elName, elType, prevent, disablecat, elMsg) {
    Severity: Minor
    Found in assets/js/scripts.js - About 35 mins to fix

      Method addProxySettings has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function addProxySettings($server, $port = 3128, $wrapper = 'http', $username = null, $password = null)
      Severity: Minor
      Found in class/phpbrowscap/Browscap.php - About 35 mins to fix

        Method update has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function update($type = 'log', $period = 0, $value = null, $increment = false, $link = '')
        Severity: Minor
        Found in class/stats.php - About 35 mins to fix

          Method delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function delete($type = 'log', $period = 0, $limitDel = 0, $criteria = null, $asObject = false)
          Severity: Minor
          Found in class/stats.php - About 35 mins to fix

            Function updateCache has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updateCache()
                {
                    $lockfile = $this->cacheDir . 'cache.lock';
            
                    $lockRes = fopen($lockfile, 'w+');
            Severity: Minor
            Found in class/phpbrowscap/Browscap.php - About 35 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 ToggleBlock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function ToggleBlock(blockid, icon, src_expand, src_collapse, alt_expand, alt_collapse, class_expand, class_collapse) {
                var Img_tag = 'IMG';
                var el = document.getElementById(blockid);
                if (el.className == class_expand) {
                    el.className = class_collapse;
            Severity: Minor
            Found in assets/js/scripts.js - About 35 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 too many return statements within this method.
            Open

                    return '';
            Severity: Major
            Found in class/phpbrowscap/Browscap.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return true;
              Severity: Major
              Found in class/log.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $newFile;
                Severity: Major
                Found in class/log.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return false;
                  Severity: Major
                  Found in class/stats.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return $newFile;
                    Severity: Major
                    Found in class/log.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return true;
                      Severity: Major
                      Found in class/stats.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return 0;
                        Severity: Major
                        Found in class/phpbrowscap/Browscap.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return false;
                          Severity: Major
                          Found in class/setting.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return $object->getVar($this->keyName);
                            Severity: Major
                            Found in class/stats.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return false;
                              Severity: Major
                              Found in class/setting.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return $mergeFile;
                                Severity: Major
                                Found in class/log.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return false;
                                  Severity: Major
                                  Found in class/setting.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return $sets;
                                    Severity: Major
                                    Found in class/setting.php - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language