XoopsModules25x/userlog

View on GitHub

Showing 113 of 1,244 total issues

File log.php has 961 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/*
 You may not change or alter any portion of this comment or credits
 of supporting developers from this source code or any supporting source code
 which is considered copyrighted (c) material of the original comment or credit authors.
Severity: Major
Found in class/log.php - About 2 days to fix

    Function getLogsFromFiles has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getLogsFromFiles(
            $log_files = [],
            $limit = 0,
            $start = 0,
            $options = null,
    Severity: Minor
    Found in class/log.php - About 2 days 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

    File Browscap.php has 825 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace phpbrowscap;
    
    use Exception as BaseException;
    Severity: Major
    Found in class/phpbrowscap/Browscap.php - About 1 day to fix

      Method getOptions has 227 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getOptions($option = null, $V = 'value')
          {
              $V = strtolower($V);
      
              if ($this->userlog->getUser()) {
      Severity: Major
      Found in class/setting.php - About 1 day to fix

        Function validate has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

        function validate(elName, elType, prevent, disablecat, elMsg) {
            var i = 0;
            var el = document.getElementsByName(elName);
            var is_valid = true;
            switch (elType) {
        Severity: Minor
        Found in assets/js/scripts.js - About 7 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 getBrowser has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getBrowser($user_agent = null, $return_array = false)
            {
                if ($this->shouldCacheBeUpdated()) {
                    try {
                        $this->updateCache();
        Severity: Minor
        Found in class/phpbrowscap/Browscap.php - About 7 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

        File setting.php has 449 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /*
         You may not change or alter any portion of this comment or credits
         of supporting developers from this source code or any supporting source code
         which is considered copyrighted (c) material of the original comment or credit authors.
        Severity: Minor
        Found in class/setting.php - About 6 hrs to fix

          File xoops_version.php has 384 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*
           You may not change or alter any portion of this comment or credits
           of supporting developers from this source code or any supporting source code
           which is considered copyrighted (c) material of the original comment or credit authors.
          Severity: Minor
          Found in xoops_version.php - About 5 hrs to fix

            Function getViews has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getViews(
                    $limit = 10,
                    $start = 0,
                    $sort = 'count',
                    $order = 'DESC',
            Severity: Minor
            Found in class/log.php - About 5 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

            File stats.php has 367 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /*
             You may not change or alter any portion of this comment or credits
             of supporting developers from this source code or any supporting source code
             which is considered copyrighted (c) material of the original comment or credit authors.
            Severity: Minor
            Found in class/stats.php - About 4 hrs to fix

              Function getLogsCounts has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getLogsCounts($criteria = null, $fields = null, $asObject = true, $id_as_key = true)
                  {
                      if (is_array($fields) && count($fields) > 0) {
                          if (!in_array($this->keyName, $fields)) {
                              $fields[] = $this->keyName;
              Severity: Minor
              Found in class/log.php - About 4 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 updateAll has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function updateAll($type = 'log', $prob = 11)
                  {
                      if (!$this->userlog->probCheck($prob)) {
                          return false;
                      }
              Severity: Minor
              Found in class/stats.php - About 4 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 getLogsFromFiles has 106 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getLogsFromFiles(
                      $log_files = [],
                      $limit = 0,
                      $start = 0,
                      $options = null,
              Severity: Major
              Found in class/log.php - About 4 hrs to fix

                Function createCacheNewWay has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function createCacheNewWay($iniContent)
                    {
                        $patternPositions = [];
                
                        // get all patterns from the ini file in the correct order,
                Severity: Minor
                Found in class/phpbrowscap/Browscap.php - About 4 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 createCacheNewWay has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function createCacheNewWay($iniContent)
                    {
                        $patternPositions = [];
                
                        // get all patterns from the ini file in the correct order,
                Severity: Major
                Found in class/phpbrowscap/Browscap.php - About 4 hrs to fix

                  Method getViews has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getViews(
                          $limit = 10,
                          $start = 0,
                          $sort = 'count',
                          $order = 'DESC',
                  Severity: Major
                  Found in class/log.php - About 4 hrs to fix

                    Method updateAll has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function updateAll($type = 'log', $prob = 11)
                        {
                            if (!$this->userlog->probCheck($prob)) {
                                return false;
                            }
                    Severity: Major
                    Found in class/stats.php - About 3 hrs to fix

                      Function _getRemoteData has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function _getRemoteData($url)
                          {
                              ini_set('user_agent', $this->_getUserAgent());
                      
                              switch ($this->_getUpdateMethod()) {
                      Severity: Minor
                      Found in class/phpbrowscap/Browscap.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 getBrowser has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getBrowser($user_agent = null, $return_array = false)
                          {
                              if ($this->shouldCacheBeUpdated()) {
                                  try {
                                      $this->updateCache();
                      Severity: Major
                      Found in class/phpbrowscap/Browscap.php - About 3 hrs to fix

                        Browscap has 28 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Browscap
                        {
                            /**
                             * Current version of the class.
                             */
                        Severity: Minor
                        Found in class/phpbrowscap/Browscap.php - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language