piotrpolak/pepiscms

View on GitHub

Showing 485 of 486 total issues

File Siteconfig_model.php has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * PepisCMS
 *
Severity: Minor
Found in pepiscms/application/models/Siteconfig_model.php - About 4 hrs to fix

    Function edit has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        public function edit()
        {
            $section = $this->input->getParam('section');
            $is_editable = ($section != 'system' && !$this->Module_model->isCoreModule($section)) || !PEPISCMS_PRODUCTION_RELEASE;
    
    
    Severity: Minor
    Found in pepiscms/application/controllers/admin/Acl.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 generateExcel has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function generateExcel($feed, $headers = false, $file_name = false, $send = true, $print_headers = true, $excel_type = Spreadsheet::EXCEL_XLS)
        {
            if (!$this->isFullyEnabled()) {
                throw new \RuntimeException("PhpSpreadsheet is not enabled. Please refer to README.md");
            }
    Severity: Major
    Found in pepiscms/application/libraries/Spreadsheet.php - About 4 hrs to fix

      Method _getPageEditDefinition has 114 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function _getPageEditDefinition($input_groups, $page_id, $site_language)
          {
              $definition = array();
              $definition['page_title'] = array(
                  'input_group' => $input_groups['document'],
      Severity: Major
      Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 4 hrs to fix

        Function _on_page_save_callback has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _on_page_save_callback(&$data)
            {
                /*
                 * TESTS
                 * Update page contents
        Severity: Minor
        Found in pepiscms/modules/pages/controllers/PagesAdmin.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 theme has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function theme()
            {
                $this->load->library('Google_chart_helper');
        
                $this->load->library('FormBuilder');
        Severity: Major
        Found in pepiscms/application/controllers/admin/About.php - About 4 hrs to fix

          Function redrawTable has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function redrawTable(_path) {
                  window.location.hash = '#' + _path;
                  //$(".path").html('<strong>'+label_loading_list_of_files+'</strong>');
          
                  $("#filemanager_grid").attr('disabled', 'disabled');
          Severity: Major
          Found in pepiscms/js/ajaxfilemanager.js - About 4 hrs to fix

            File Cms_usersAdmin.php has 344 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             * PepisCMS
             *
            Severity: Minor
            Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.php - About 4 hrs to fix

              Function loadForModule has a Cognitive Complexity of 29 (exceeds 5 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: Minor
              Found in pepiscms/application/core/PEPISCMS_Lang.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 _fb_callback_on_save has a Cognitive Complexity of 29 (exceeds 5 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 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

              File ajaxfilemanager.js has 343 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              function FileManagerUI(transtlation_map, is_intranet) {
              
                  var current_path = '/';
                  var parent_path = '';
                  var allowed_extensions = []; // Must be an array
              Severity: Minor
              Found in pepiscms/js/ajaxfilemanager.js - About 4 hrs to fix

                User_model has 33 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class User_model extends Generic_model
                {
                
                    /**
                     * Minimum minimum allowed length of the password
                Severity: Minor
                Found in pepiscms/application/models/User_model.php - About 4 hrs to fix

                  Method getDefinitionFromTable has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getDefinitionFromTable($table, $resolve_fk = true)
                      {
                          $collumns_a = $this->getTableRawDescription($table);
                          if (!$collumns_a) {
                              return false;
                  Severity: Major
                  Found in pepiscms/modules/crud/libraries/TableUtility.php - About 4 hrs to fix

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

                        public function isAuthenticated($force_do_all_checks_again = false)
                        {
                            if (!$force_do_all_checks_again) {
                                if ($this->is_authenticated !== null) {
                                    // Kind of cache
                    Severity: Minor
                    Found in pepiscms/application/libraries/Auth.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 _fb_callback_on_import has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _fb_callback_on_import($data_array)
                        {
                            $this->load->library('Spreadsheet');
                            $this->load->helper('url');
                    
                    
                    Severity: Major
                    Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 4 hrs to fix

                      Document has 32 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Document extends ContainerAware
                      {
                          /** @var int */
                          private $id;
                          /** @var string */
                      Severity: Minor
                      Found in pepiscms/application/libraries/Document.php - About 4 hrs to fix

                        Method makeUserSpaceModule has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function makeUserSpaceModule($module_database_table_name,
                                                                $module_name,
                                                                $auto_install = true,
                                                                $parse_database_schema = true,
                                                                $database_group = false,
                        Severity: Major
                        Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 3 hrs to fix

                          Function menurendor_render_submenu has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function menurendor_render_submenu($menu_items, $level = 1)
                              {
                                  $prefix = "\t";
                                  for ($i = 0; $i < $level; $i++) {
                                      $prefix .= "\t";
                          Severity: Minor
                          Found in pepiscms/application/views/templates/menurendor_menu.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 index has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function index($display_view = true)
                              {
                                  $running_module = $this->getAttribute('running_module');
                                  $definition = $this->getDefinition();
                          
                          
                          Severity: Major
                          Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 3 hrs to fix

                            File Module.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            /**
                             * PepisCMS
                             *
                            Severity: Minor
                            Found in pepiscms/application/controllers/admin/Module.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language