piotrpolak/pepiscms

View on GitHub

Showing 479 of 486 total issues

Avoid too many return statements within this method.
Open

            return false;
Severity: Major
Found in pepiscms/application/core/PEPISCMS_Hooks.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                        return $this->_in_progress = false;
    Severity: Major
    Found in pepiscms/application/core/PEPISCMS_Hooks.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return true;
      Severity: Major
      Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return true;
        Severity: Major
        Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return '';
          Severity: Major
          Found in pepiscms/modules/logs/controllers/LogsAdmin.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return $this->_in_progress = false;
            Severity: Major
            Found in pepiscms/application/core/PEPISCMS_Hooks.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return true;
              Severity: Major
              Found in pepiscms/application/core/PEPISCMS_Lang.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return '<span style="background-color: #FF9F9F; padding: 2px; display: block;">' . $this->level_labels[$content] . '</span>';
                Severity: Major
                Found in pepiscms/modules/logs/controllers/LogsAdmin.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $content;
                  Severity: Major
                  Found in pepiscms/modules/logs/controllers/LogsAdmin.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return FormBuilder::TIMESTAMP;
                    Severity: Major
                    Found in pepiscms/modules/crud/libraries/TableUtility.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return FormBuilder::PASSWORD;
                      Severity: Major
                      Found in pepiscms/modules/crud/libraries/TableUtility.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return false;
                        Severity: Major
                        Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return true;
                          Severity: Major
                          Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return FormBuilder::TEXTFIELD;
                            Severity: Major
                            Found in pepiscms/modules/crud/libraries/TableUtility.php - About 30 mins to fix

                              Function resetPasswordByUserId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function resetPasswordByUserId($user_id)
                                  {
                                      // Reading user info
                                      $user = $this->getById($user_id, 'user_email, display_name');
                                      if (!$user) {
                              Severity: Minor
                              Found in pepiscms/application/models/User_model.php - About 25 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 saveById has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function saveById($id, $data)
                                  {
                                      if (!$id) {
                                          if (!isset($data['language_code']) || !$data['language_code']) {
                                              $data['language_code'] = 'en';
                              Severity: Minor
                              Found in pepiscms/application/models/Menu_model.php - About 25 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 sessionCounter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  sessionCounter: function (sessionTimeoutUTC, serverOffsetSec) {
                              
                                      var today = new Date();
                                      var todaySecsUTC = Math.floor(today.getTime() / 1000 + (today.getTimezoneOffset() * 60));
                              
                              
                              Severity: Minor
                              Found in pepiscms/js/jquery.frontend.js - About 25 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 describeSystemControllers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function describeSystemControllers()
                                  {
                                      $controllers = array();
                              
                                      $path = APPPATH . 'controllers/admin/';
                              Severity: Minor
                              Found in pepiscms/application/libraries/SecurityPolicy.php - About 25 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 getAvailableThemes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getAvailableThemes()
                                  {
                                      $theme_path = $this->config->item('theme_path');
                                      $dir = opendir($theme_path);
                              
                              
                              Severity: Minor
                              Found in pepiscms/application/models/Siteconfig_model.php - About 25 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 setMappedFilterFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function setMappedFilterFields($fields_array)
                                  {
                                      if (!$fields_array || count($fields_array) == 0) {
                                          $this->mapped_filter_fields = array();
                                          return true;
                              Severity: Minor
                              Found in pepiscms/application/models/Generic_model.php - About 25 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

                              Severity
                              Category
                              Status
                              Source
                              Language