piotrpolak/pepiscms

View on GitHub

Showing 486 of 487 total issues

File PEPISCMS_Loader.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

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

    Method dologin has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function dologin()
        {
            $this->_oninit();
            $this->load->library('Logger');
    
    
    Severity: Minor
    Found in pepiscms/application/controllers/admin/Login.php - About 2 hrs to fix

      Method _fb_callback_on_save has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _fb_callback_on_save(&$data)
          {
              $user_id = $this->formbuilder->getId();
      
              if (!$data['birth_date'] || $data['birth_date'] = '0000-00-00') {
      Severity: Minor
      Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.php - About 2 hrs to fix

        Method fix_autoincrement_on_cms_tables has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function fix_autoincrement_on_cms_tables()
            {
                $tables = array(
                    'database_table_users' => array('user_id', 'INT UNSIGNED'),
                    'database_table_group_to_entity' => array('id', 'INT'),
        Severity: Minor
        Found in pepiscms/modules/development/controllers/DevelopmentAdmin.php - About 1 hr to fix

          Method generate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function generate()
              {
                  $this->generateSetNoCacheHeaders();
          
                  // Default value
          Severity: Minor
          Found in pepiscms/application/libraries/FormBuilder.php - About 1 hr to fix

            Method __construct has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function __construct()
                {
                    // Do not render menu and skip authorization
                    parent::__construct(false, true);
            
            
            Severity: Minor
            Found in pepiscms/application/controllers/admin/Installer.php - About 1 hr to fix

              Function runAdminModule has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function runAdminModule($module_name, $method)
                  {
                      $this->load->model('Module_model');
                      if (!$module_name || !self::isModuleInstalled($module_name)) {
                          return false;
              Severity: Minor
              Found in pepiscms/application/libraries/ModuleRunner.php - About 1 hr 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 __doGet has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function __doGet($var)
                  {
                      static $CI;
                      isset($CI) or $CI = CI_Controller::get_instance();
              
              
              Severity: Minor
              Found in pepiscms/application/classes/ContainerAware.php - About 1 hr 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 display_steps has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  function display_steps($steps, $type)
                  {
                      $html = '';
                      $html .= '<nav class="steps ' . $type . '">' . "\n";
                      $i = 0;
              Severity: Minor
              Found in pepiscms/application/helpers/dialog_message_helper.php - About 1 hr 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 generateHandleFileUpload has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function generateHandleFileUpload(&$save_array)
                  {
                      if (count($this->file_upload_fields) == 0) {
                          return;
                      }
              Severity: Minor
              Found in pepiscms/application/libraries/FormBuilder.php - About 1 hr 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 formatCells has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              function formatCells($menu, $level, &$lang, &$url_suffix, $site_language, $view)
              {
                  static $tabs = "\t\t";
              
                  if (!count($menu) > 0)
              Severity: Minor
              Found in pepiscms/modules/pages/views/admin/index.php - About 1 hr 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 execute has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function execute($language_code = '', $uri = '')
                  {
                      $this->load->library('ModuleRunner');
                      $this->load->library('Widget');
              
              
              Severity: Minor
              Found in pepiscms/application/controllers/public/Displaypage.php - About 1 hr to fix

                Method is_allowed_filetype has 47 lines of code (exceeds 25 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 1 hr to fix

                  Method _edit has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function _edit($is_preview = false, $display_view = true)
                      {
                          $forced_filters = $this->getForcedFilters();
                          $definition = $this->getDefinition();
                  
                  
                  Severity: Minor
                  Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 1 hr to fix

                    Method parseCommandFeed has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function parseCommandFeed($contents, $fields_that_can_contain_spaces = array())
                        {
                            // Line counter, -1 meaning reading headers
                            $line_counter = -1;
                    
                    
                    Severity: Minor
                    Found in pepiscms/application/models/Ssh_model.php - About 1 hr to fix

                      Method generatePagination has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function generatePagination($no_of_pages, $order_by, $order, $applied_filter_values, $page)
                          {
                              if ($no_of_pages < 1) {
                                  return '';
                              }
                      Severity: Minor
                      Found in pepiscms/application/libraries/DataGrid.php - About 1 hr to fix

                        Method _model has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function _model($model, $name = '', $db_conn = false, $hardfail = true)
                            {
                                if (is_array($model)) {
                                    foreach ($model as $babe) {
                                        $this->model($babe);
                        Severity: Minor
                        Found in pepiscms/application/core/PEPISCMS_Loader.php - About 1 hr to fix

                          Method translateCIValidationRulesToJSValidationEngineRules has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method runAdminModule has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function runAdminModule($module_name, $method)
                                {
                                    $this->load->model('Module_model');
                                    if (!$module_name || !self::isModuleInstalled($module_name)) {
                                        return false;
                            Severity: Minor
                            Found in pepiscms/application/libraries/ModuleRunner.php - About 1 hr to fix

                              Method runModule has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function runModule($module_name, $method)
                                  {
                                      $this->load->model('Module_model');
                                      if (!$module_name || !self::isModuleInstalled($module_name)) {
                                          return false;
                              Severity: Minor
                              Found in pepiscms/application/libraries/ModuleRunner.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language