XoopsModules25x/userlog

View on GitHub

Showing 113 of 1,244 total issues

Function ToggleBlock has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

function ToggleBlock(blockid, icon, src_expand, src_collapse, alt_expand, alt_collapse, class_expand, class_collapse) {
Severity: Major
Found in assets/js/scripts.js - About 1 hr to fix

    Method getSets has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $limit = 0,
            $start = 0,
            $otherCriteria = null,
            $sort = 'set_id',
            $order = 'DESC',
    Severity: Major
    Found in class/setting.php - About 1 hr to fix

      Method getLogs has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $limit = 0,
              $start = 0,
              $otherCriteria = null,
              $sort = 'log_id',
              $order = 'DESC',
      Severity: Major
      Found in class/log.php - About 1 hr to fix

        Method getViews has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $limit = 10,
                $start = 0,
                $sort = 'count',
                $order = 'DESC',
                $modules = [],
        Severity: Major
        Found in class/log.php - About 1 hr to fix

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

              public function logForm($options = null)
              {
                  $form    = new XoopsThemeForm(_AM_USERLOG_LOGFORM, 'logs', 'logs.php', 'get');
                  $headers = $this->getOptions('', 'title');
                  unset($headers['active'], $headers['inside'], $headers['outside'], $headers['unset_pass'], $headers['store_db'], $headers['store_file'], $headers['views']);
          Severity: Minor
          Found in class/setting.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 clearProxySettings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function clearProxySettings($wrapper = null)
              {
                  $wrappers = isset($wrapper) ? [$wrapper] : array_keys($this->_streamContextOptions);
          
                  $clearedWrappers = [];
          Severity: Minor
          Found in class/phpbrowscap/Browscap.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 getFilesFromFolders has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getFilesFromFolders($folders = [])
              {
                  list($allFiles, $totalFiles) = $this->userlog->getAllLogFiles();
                  if (empty($totalFiles)) {
                      return [];
          Severity: Minor
          Found in class/log.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

          Method getLogsFromFiles has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $log_files = [],
                  $limit = 0,
                  $start = 0,
                  $options = null,
                  $sort = 'log_time',
          Severity: Minor
          Found in class/log.php - About 45 mins to fix

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

            function SaveCollapsed(objid, addcollapsed) {
                var collapsed = GetCookie(toggle_cookie);
                var tmp = "";
                if (collapsed != null) {
                    collapsed = collapsed.split(",");
            Severity: Minor
            Found in assets/js/scripts.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

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

                protected function _getUpdateMethod()
                {
                    // Caches the result
                    if (null === $this->updateMethod) {
                        if (null !== $this->localFile) {
            Severity: Minor
            Found in class/phpbrowscap/Browscap.php - 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

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

                public function zipFiles($log_files = [], $zipFileName = null)
                {
                    $log_files = $this->parseFiles($log_files);
                    if (0 == ($totalFiles = count($log_files))) {
                        $this->setErrors('No file to zip');
            Severity: Minor
            Found in class/log.php - 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

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

            function userlog_views_edit($options)
            {
                // require_once XOOPS_ROOT_PATH . "/class/blockform.php"; //reserve for 2.6
                xoops_load('XoopsFormLoader');
                // $form = new XoopsBlockForm(); //reserve for 2.6
            Severity: Minor
            Found in blocks/views.php - 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

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

                public function delete($type = 'log', $period = 0, $limitDel = 0, $criteria = null, $asObject = false)
                {
                    switch ($type) {
                        case 'log':
                            if ($asObject) {
            Severity: Minor
            Found in class/stats.php - 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

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

                public function deleteFiles($log_files = [])
                {
                    $log_files = $this->parseFiles($log_files);
                    if (0 == ($totalFiles = count($log_files))) {
                        $this->setErrors(_AM_USERLOG_FILE_SELECT_ONE);
            Severity: Minor
            Found in class/log.php - 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

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

                public static function recurseCopy($src, $dst)
                {
                    $dir = opendir($src);
                    //    @mkdir($dst);
                    while (false !== ($file = readdir($dir))) {
            Severity: Minor
            Found in class/utility.php - 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

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

                public function shouldCacheBeUpdated()
                {
                    // Load the cache at the first request
                    if ($this->_cacheLoaded) {
                        return false;
            Severity: Minor
            Found in class/phpbrowscap/Browscap.php - 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 (is_object($xoopsUser) && !in_array($xoopsUser->getVar('uid'), $perm['super']['uid'])
                                && 0 == count(array_intersect($xoopsUser->getGroups(), $perm['super']['group']))) {
                                $modversion['hasAdmin']    = 0;
                                $modversion['system_menu'] = 0;
                                $modversion['tables']      = null;
            Severity: Major
            Found in xoops_version.php - About 45 mins to fix

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

              function GetCookie(name) {
                  cookie_name = name + "=";
                  cookie_length = document.cookie.length;
                  cookie_begin = 0;
                  while (cookie_begin < cookie_length) {
              Severity: Minor
              Found in assets/js/scripts.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

                                          while (!feof($remote_handler)) {
                                              $file .= fgets($remote_handler);
                                          }
              Severity: Major
              Found in class/phpbrowscap/Browscap.php - About 45 mins to fix

                Method getAll has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $type = [],
                        $start = 0,
                        $limit = 0,
                        $sort = 'stats_value',
                        $order = 'DESC',
                Severity: Minor
                Found in class/stats.php - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language