piotrpolak/pepiscms

View on GitHub

Showing 485 of 486 total issues

Function onAuthRequest has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function onAuthRequest()
    {
        parse_str(substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1), $_GET);
        $this->_init();
        phpCAS::forceAuthentication();
Severity: Minor
Found in pepiscms/application/drivers/auth/CasAuthDriver.php - About 2 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 getManyToManyRelationshipsRelatedToTable has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getManyToManyRelationshipsRelatedToTable($table)
    {
        $related_foreign_keys = $this->getForeignKeysRelatedToTable($table);

        $many_to_many_fks = array();
Severity: Minor
Found in pepiscms/modules/crud/libraries/TableUtility.php - About 2 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 DefaultFormRenderer.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * PepisCMS
 *
Severity: Minor
Found in pepiscms/application/classes/DefaultFormRenderer.php - About 2 hrs to fix

    Function makeInterfaceButtonsToWork has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        makeInterfaceButtonsToWork: function () {
            $('input[type=submit].button:visible').each(function () { // a.button:visible
    
                var $button = $(this);
    
    
    Severity: Major
    Found in pepiscms/js/jquery.frontend.js - About 2 hrs to fix

      Method getAvailableTimezones has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getAvailableTimezones()
          {
              $tz = array(
                  'Europe/Amsterdam',
                  'Europe/Andorra',
      Severity: Major
      Found in pepiscms/application/models/Siteconfig_model.php - About 2 hrs to fix

        Method formatCells has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function formatCells($menu, $level, &$lang, &$url_suffix, $site_language, $view)
        {
            static $tabs = "\t\t";
        
            if (!count($menu) > 0)
        Severity: Major
        Found in pepiscms/modules/pages/views/admin/index.php - About 2 hrs to fix

          File MenuRendor.php has 273 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * PepisCMS
           *
          Severity: Minor
          Found in pepiscms/application/libraries/MenuRendor.php - About 2 hrs to fix

            Method register has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function register($display_name, $user_email, $user_login = false, $password = false, $group_ids = array(), $is_root = false, $send_email_notification = true, $data = array(), $account_type = 0)
                {
                    // If there is no password specified, lets generate one for the user
                    if (!$password) {
                        $password = $this->generateEasyPassword($this->getMinimumAllowedPasswordLenght() + 2);
            Severity: Major
            Found in pepiscms/application/models/User_model.php - About 2 hrs to fix

              File CrudFieldDefinitionBuilder.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * PepisCMS
               *
              Severity: Minor
              Found in pepiscms/application/classes/CrudFieldDefinitionBuilder.php - About 2 hrs to fix

                Method model has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function model($model, $name = '', $db_conn = false, $hardfail = true)
                    {
                        // Keep this redundancy
                        $original_model = $model;
                        $original_name = $name;
                Severity: Major
                Found in pepiscms/application/core/PEPISCMS_Loader.php - About 2 hrs to fix

                  Method loadForModule has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function loadForModule($langfile = '', $idiom = '', $return = false, $module_name = false)
                      {
                          // TODO Remove this hack
                          $langfile = str_replace('.php', '', str_replace('_lang.', '', $langfile)) . '_lang.php';
                  
                  
                  Severity: Major
                  Found in pepiscms/application/core/PEPISCMS_Lang.php - About 2 hrs to fix

                    Method index has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function index()
                        {
                            $this->load->library('DataGrid');
                            $this->load->library('SimpleSessionMessage');
                            $this->load->library('LogsRowFormattingUtility');
                    Severity: Major
                    Found in pepiscms/modules/logs/controllers/LogsAdmin.php - About 2 hrs to fix

                      Function getDistinctAssoc has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getDistinctAssoc($column, $table = false, $pairs = false, $where_conditions = false)
                          {
                              if (!$table) {
                                  $table = $this->getTable();
                              }
                      Severity: Minor
                      Found in pepiscms/application/models/Generic_model.php - About 2 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 is_allowed_filetype has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function is_allowed_filetype($ignore_mime = false)
                          {
                              if ($this->allowed_types === '*') {
                                  return true;
                              }
                      Severity: Minor
                      Found in pepiscms/application/libraries/PEPISCMS_Upload.php - About 2 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 addFieldByDefinition has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function addFieldByDefinition($field)
                          {
                              if (!isset($field['field']) || !$field['field']) {
                                  return false;
                              }
                      Severity: Minor
                      Found in pepiscms/application/libraries/FormBuilder.php - About 2 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 translateCIValidationRulesToJSValidationEngineRules has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function translateCIValidationRulesToJSValidationEngineRules($validation_rules)
                          {
                              $validation_rules = trim($validation_rules);
                              if (!$validation_rules) {
                                  return '';

                      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 index has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function index()
                          {
                              // Reading history
                              $query_history = $this->auth->getSessionVariable('sqlconsole_query_history');
                              if (!$query_history) {
                      Severity: Major
                      Found in pepiscms/modules/sqlconsole/controllers/SqlconsoleAdmin.php - About 2 hrs to fix

                        Function init has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            this.init = function () {
                        
                                if (transtlation_map instanceof Object) {
                                    if (transtlation_map.label_new_folder_name) {
                                        dialog.new_folder_name = transtlation_map.label_new_folder_name;
                        Severity: Major
                        Found in pepiscms/js/ajaxfilemanager.js - About 2 hrs to fix

                          Method mysqldump has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function mysqldump($db_host, $database, $db_user, $db_password, $tables = false, $dump_to_filename = false, $dump_structure = true)
                              {
                                  if ($dump_to_filename && file_exists($dump_to_filename)) {
                                      return false;
                                  }
                          Severity: Major
                          Found in pepiscms/application/helpers/mysqldump_helper.php - About 2 hrs to fix

                            Method genericthumb has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function genericthumb($absolute = false, $size = 50, $current_path = false)
                                {
                                    if (!$current_path) {
                                        $start_word = 'thumb';
                                        $pos = strpos($_SERVER['REQUEST_URI'], $start_word);
                            Severity: Major
                            Found in pepiscms/application/controllers/admin/Ajaxfilemanager.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language