piotrpolak/pepiscms

View on GitHub

Showing 486 of 487 total issues

Method getAdvancedFeed has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function getAdvancedFeed($columns, $offset, $rowcount, $order_by_column, $order, $filters, $extra_param)
Severity: Major
Found in pepiscms/application/models/Array_model.php - About 50 mins to fix

    Method getAdvancedFeed has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getAdvancedFeed($columns, $start, $rowcount, $orderby_column, $order, $filters, $extra_param);
    Severity: Major
    Found in pepiscms/application/classes/AdvancedDataFeedableInterface.php - About 50 mins to fix

      Method mysqldump has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          function mysqldump($db_host, $database, $db_user, $db_password, $tables = false, $dump_to_filename = false, $dump_structure = true)
      Severity: Major
      Found in pepiscms/application/helpers/mysqldump_helper.php - About 50 mins to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                $actions = array_merge(array(array(
                    'name' => $back_to_items_label,
                    'link' => $back_link_for_edit . ($this->input->getParam('layout') ? '/layout-' . $this->input->getParam('layout') : '') . ($this->input->getParam('forced_filters') ? '/forced_filters-' . $this->input->getParam('forced_filters') : ''),
                    'icon' => 'pepiscms/theme/img/dialog/actions/back_16.png',
                )), $actions);
        Severity: Minor
        Found in pepiscms/modules/crud/views/admin/import.php and 1 other location - About 50 mins to fix
        pepiscms/modules/crud/views/admin/_edit_top.php on lines 65..69

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 97.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                $actions = array_merge(array(array(
                    'name' => $back_to_items_label,
                    'link' => $back_link_for_edit . ($this->input->getParam('layout') ? '/layout-' . $this->input->getParam('layout') : '') . ($this->input->getParam('forced_filters') ? '/forced_filters-' . $this->input->getParam('forced_filters') : ''),
                    'icon' => 'pepiscms/theme/img/dialog/actions/back_16.png',
                )), $actions);
        Severity: Minor
        Found in pepiscms/modules/crud/views/admin/_edit_top.php and 1 other location - About 50 mins to fix
        pepiscms/modules/crud/views/admin/import.php on lines 43..47

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 97.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            <?= display_breadcrumb(array(admin_url() . 'utilities' => $this->lang->line('label_utilities_and_settings'), admin_url() . 'module' => $this->lang->line('modules_installed_modules'), admin_url() . 'module/do_setup/module-' . $module => $this->lang->line('modules_module_setup') . ' ' . $module_label), module_icon_url($module)) ?>
            <?= display_action_bar(array(array(
        Severity: Minor
        Found in pepiscms/application/views/admin/module_configure.php and 1 other location - About 45 mins to fix
        pepiscms/application/views/admin/module_do_setup.php on lines 1..2

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 96.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        <?= display_breadcrumb(array(admin_url() . 'utilities' => $this->lang->line('label_utilities_and_settings'), admin_url() . 'module' => $this->lang->line('modules_installed_modules'), admin_url() . 'module/do_setup/module-' . $module => $this->lang->line('modules_module_setup') . ' ' . $module_label), module_icon_url($module)) ?>
        
        
        Severity: Minor
        Found in pepiscms/application/views/admin/module_do_setup.php and 1 other location - About 45 mins to fix
        pepiscms/application/views/admin/module_configure.php on lines 2..3

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 96.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Method log has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function log($message, $level = self::MESSAGE_LEVEL_INFO, $collection = 'SYSTEM', $resource_id = false, $user_id = false, $timestamp = false)
        Severity: Minor
        Found in pepiscms/application/libraries/Logger.php - About 45 mins to fix

          Function getMenuFlat has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getMenuFlat($parent_item_id = 0, $language_code = 'en', $dont_enter_item_id = false, $separator = false, &$menu = array(), $return = true, $prefix = '')
              {
                  if (!$language_code) {
                      $language_code = 'en';
                  }
          Severity: Minor
          Found in pepiscms/application/models/Menu_model.php - About 45 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 valid_timestamp has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function valid_timestamp($str)
              {
                  if (strlen($str) == 0) {
                      return true;
                  }
          Severity: Minor
          Found in pepiscms/application/libraries/PEPISCMS_Form_validation.php - About 45 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

          Method getAssocPairs has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function getAssocPairs($key_column_name, $value_column_name, $table = false, $imitial_array = false,
                                            $possible_keys = false, $where_conditions = false)
          Severity: Minor
          Found in pepiscms/application/models/Generic_model.php - About 45 mins to fix

            Method enableJournaling has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function enableJournaling($journaling_table = false, $include_fields = array(), $exclude_fields = array(),
                                                 $tag = null, $serialization_method = null, $unserialization_method = null)
            Severity: Minor
            Found in pepiscms/application/models/Generic_model.php - About 45 mins to fix

              Function setupDefaultConfig has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function setupDefaultConfig()
                  {
                      $this->load->config('editor');
                      $descriptor['editor_css_file'] = $this->config->item('editor_css_file');
                      $descriptor['editor_css_body_id'] = $this->config->item('editor_css_body_id');
              Severity: Minor
              Found in pepiscms/application/libraries/RTFEditor.php - About 45 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

              Method move has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function move($id, $direction, $table = false, $constraint_field_name = false,
                                       $item_order_field_name = 'item_order', $id_field_name = 'id')
              Severity: Minor
              Found in pepiscms/application/models/Generic_model.php - About 45 mins to fix

                Function hasAccess has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function hasAccess($controller, $method = false, $module = false)
                    {
                        if (!$method) {
                            $method = 'index';
                        }
                Severity: Minor
                Found in pepiscms/application/libraries/SecurityManager.php - About 45 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

                Method copyFileSsh has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function copyFileSsh($host, $port, $login = false, $password = false, $local_file = false, $remote_file = false)
                Severity: Minor
                Found in pepiscms/application/models/Ssh_model.php - About 45 mins to fix

                  Method generateExcel has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function generateExcel($feed, $headers = false, $file_name = false, $send = true, $print_headers = true, $excel_type = Spreadsheet::EXCEL_XLS)
                  Severity: Minor
                  Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix

                    Method move has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function move($id, $direction, $table = false, $constraint_field_name = false, $item_order_field_name = 'item_order', $id_field_name = 'id');
                    Severity: Minor
                    Found in pepiscms/application/classes/MoveableInterface.php - About 45 mins to fix

                      Method generateXML has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function generateXML($feed, $headers = false, $file_name = false, $send = true, $root_name = false, $item_name = false)
                      Severity: Minor
                      Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix

                        Method generateCSV has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function generateCSV($feed, $headers = false, $file_name = false, $send = true, $separator = false, $print_headers = true)
                        Severity: Minor
                        Found in pepiscms/application/libraries/Spreadsheet.php - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language