piotrpolak/pepiscms

View on GitHub

Showing 481 of 486 total issues

File AdminCRUDController.php has 1202 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * PepisCMS
 *
Severity: Major
Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 3 days to fix

    Function generate has a Cognitive Complexity of 138 (exceeds 5 allowed). Consider refactoring.
    Open

        public function generate($extra_param = false)
        {
            $output = '';
    
            $page = $this->input->getParam('page');
    Severity: Minor
    Found in pepiscms/application/libraries/DataGrid.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 FormBuilder.php has 871 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * PepisCMS
     *
    Severity: Major
    Found in pepiscms/application/libraries/FormBuilder.php - About 2 days to fix

      File DataGrid.php has 811 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /**
       * PepisCMS
       *
      Severity: Major
      Found in pepiscms/application/libraries/DataGrid.php - About 1 day to fix

        AdminCRUDController has 98 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class AdminCRUDController extends ModuleAdminController
        {
            /**
             * Database table name used for Generic_model when no feed object is specified
             *
        Severity: Major
        Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 1 day to fix

          Function applyFilters has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function applyFilters(&$output, $filters)
              {
                  $output_new = array();
          
                  // Reading the original feed line by line
          Severity: Minor
          Found in pepiscms/application/models/Array_model.php - About 1 day 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 parseCSV has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
          Open

              public function parseCSV($path, $first_row_as_keys = true, $normalize_keys = true, $separator = false)
              {
                  $lines = array();
                  $keys = array();
                  if (file_exists($path)) {
          Severity: Minor
          Found in pepiscms/application/libraries/Spreadsheet.php - About 1 day 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

          FormBuilder has 81 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class FormBuilder extends ContainerAware
          {
              const POST_ID_FIELD_NAME = 'form_builder_id';
          
              /**
          Severity: Major
          Found in pepiscms/application/libraries/FormBuilder.php - About 1 day to fix

            File Generic_model.php has 622 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             * PepisCMS
             *
            Severity: Major
            Found in pepiscms/application/models/Generic_model.php - About 1 day to fix

              File ModuleGenerator.php has 588 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /**
               * PepisCMS
               *
              Severity: Major
              Found in pepiscms/modules/development/libraries/ModuleGenerator.php - About 1 day to fix

                Function _fb_callback_on_import has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function _fb_callback_on_import($data_array)
                    {
                        $this->load->library('Spreadsheet');
                        $this->load->helper('url');
                
                
                Severity: Minor
                Found in pepiscms/modules/crud/libraries/AdminCRUDController.php - About 1 day 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 render has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function render($controller, $method, $language_code = '', $pull_submenu_from_controller = false, $current_module = false)
                    {
                        $menu = $this->config->item('menu');
                
                        $pull_submenu_from_controller = $this->ensurePulledSumbenuFromControllerIsSet($controller, $pull_submenu_from_controller);
                Severity: Minor
                Found in pepiscms/application/libraries/MenuRendor.php - About 1 day 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 User_model.php has 542 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /**
                 * PepisCMS
                 *
                Severity: Major
                Found in pepiscms/application/models/User_model.php - About 1 day to fix

                  Function generateFilters has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function generateFilters($page = false, $order_by = false, $order = false, $applied_filter_values = -1)
                      {
                          $filters_output = '';
                  
                          if ($applied_filter_values == -1) {
                  Severity: Minor
                  Found in pepiscms/application/libraries/DataGrid.php - About 1 day 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 PagesAdmin.php has 515 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * PepisCMS
                   *
                  Severity: Major
                  Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 1 day to fix

                    Function getDefinitionFromTable has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getDefinitionFromTable($table, $resolve_fk = true)
                        {
                            $collumns_a = $this->getTableRawDescription($table);
                            if (!$collumns_a) {
                                return false;
                    Severity: Minor
                    Found in pepiscms/modules/crud/libraries/TableUtility.php - About 1 day 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 206 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function index()
                        {
                            $this->load->library('FormBuilder');
                            $this->load->model('Siteconfig_model');
                            $definition = array();
                    Severity: Major
                    Found in pepiscms/application/controllers/admin/Setup.php - About 1 day to fix

                      File jquery.frontend.js has 486 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      var serverOffsetSec = 0; // This should be computed just once
                      
                      $(document).on('ready', function () {
                          ppLib.fixLayout();
                          ppLib.resizeText('#font_resize_bar a');
                      Severity: Minor
                      Found in pepiscms/js/jquery.frontend.js - About 7 hrs to fix

                        Function generateCSV has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function generateCSV($feed, $headers = false, $file_name = false, $send = true, $separator = false, $print_headers = true)
                            {
                                if (!$separator) {
                                    $separator = ',';
                                }
                        Severity: Minor
                        Found in pepiscms/application/libraries/Spreadsheet.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

                        Function generateExcel has a Cognitive Complexity of 45 (exceeds 5 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: Minor
                        Found in pepiscms/application/libraries/Spreadsheet.php - About 6 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

                        Severity
                        Category
                        Status
                        Source
                        Language