piotrpolak/pepiscms

View on GitHub

Showing 485 of 486 total issues

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

    public function moduleLibrary($module_name, $library, $params = null)
    {
        if ($library == '') {
            return false;
        }
Severity: Minor
Found in pepiscms/application/core/PEPISCMS_Loader.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 formatCells has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

function formatCells($menu, $level, &$lang, &$url_suffix, $site_language, $view)
Severity: Minor
Found in pepiscms/modules/pages/views/admin/index.php - About 45 mins to fix

    Consider simplifying this complex logical expression.
    Open

                    if ($H >= 0 && $H <= 24
                        && $i >= 0 && $i <= 60
                        && $s >= 0 && $s <= 60
                    ) {
                        return true;
    Severity: Major
    Found in pepiscms/application/libraries/PEPISCMS_Form_validation.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

      <?php if ((SecurityManager::hasAccess('utilities', 'flush_html_cache') || SecurityManager::hasAccess('utilities', 'flush_security_policy_cache') || SecurityManager::hasAccess('utilities', 'flush_system_cache') || SecurityManager::hasAccess('acl') || SecurityManager::hasAccess('logs') || SecurityManager::hasAccess('utilities', 'systeminfo'))): ?>
      
              <h1 class="contrasted"><?= $lang->line('utilities_label_cache') ?></h1>
              <ul class="dashboard_actions clear">
      
      
      Severity: Major
      Found in pepiscms/application/views/admin/utilities_index.php - About 40 mins to fix

        Method registerChange has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function registerChange($user_id, $password_encoded, $hashing_salt, $hashing_algorithm, $hasing_iterations)
        Severity: Minor
        Found in pepiscms/application/models/Password_history_model.php - About 35 mins to fix

          Method executeSshCommand has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

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

            Method setMessage has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function setMessage($label_name, $param1 = null, $param2 = null, $param3 = null, $param4 = null)
            Severity: Minor
            Found in pepiscms/application/libraries/SimpleSessionMessage.php - About 35 mins to fix

              Method generateLink has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  private static function generateLink($base_url, $page = 1, $order_by = false, $order = false, $filters = false)
              Severity: Minor
              Found in pepiscms/application/libraries/DataGrid.php - About 35 mins to fix

                Method generatePagination has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private function generatePagination($no_of_pages, $order_by, $order, $applied_filter_values, $page)
                Severity: Minor
                Found in pepiscms/application/libraries/DataGrid.php - About 35 mins to fix

                  Method addFilter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function addFilter($label, $field = false, $filter_type = self::FILTER_BASIC, $filter_values = false, $filter_condition = false)
                  Severity: Minor
                  Found in pepiscms/application/libraries/DataGrid.php - About 35 mins to fix

                    Method computeCacheVariableName has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        private function computeCacheVariableName($controller, $method, $language_code, $pull_submenu_from_controller, $current_module)
                    Severity: Minor
                    Found in pepiscms/application/libraries/MenuRendor.php - About 35 mins to fix

                      Method button_generic has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function button_generic($label, $url, $icon_path, $extra_classes = '', $id = false)
                      Severity: Minor
                      Found in pepiscms/application/helpers/dialog_message_helper.php - About 35 mins to fix

                        Method render has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function render($controller, $method, $language_code = '', $pull_submenu_from_controller = false, $current_module = false)
                        Severity: Minor
                        Found in pepiscms/application/libraries/MenuRendor.php - About 35 mins to fix

                          Method buildMenuItem has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              private function buildMenuItem($language_code, $pull_submenu_from_controller, $current_module, array $menu_map_item_template, $item)
                          Severity: Minor
                          Found in pepiscms/application/libraries/MenuRendor.php - About 35 mins to fix

                            Method computeReadOnlyComponentHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                private function computeReadOnlyComponentHtml($field, $valueEscaped, $object,
                                      \PiotrPolak\PepisCMS\Formbuilder\Component\ComponentInterface $component, $formatting_function_for_uneditable)
                            Severity: Minor
                            Found in pepiscms/application/classes/DefaultFormRenderer.php - About 35 mins to fix

                              Method renderInput has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  private function renderInput($field, $value, &$object,
                                                               \PiotrPolak\PepisCMS\Formbuilder\Component\ComponentInterface $component, $readOnly)
                              Severity: Minor
                              Found in pepiscms/application/classes/DefaultFormRenderer.php - About 35 mins to fix

                                Method renderComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public function renderComponent($field, $value, $valueEscaped, &$object, $extra_css_classes)

                                  Method load has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public function load($langfile, $idiom = '', $return = false, $add_suffix = true, $alt_path = '')
                                  Severity: Minor
                                  Found in pepiscms/application/core/PEPISCMS_Lang.php - About 35 mins to fix

                                    Method renderComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        public function renderComponent($field, $value, $valueEscaped, &$object, $extra_css_classes)

                                      Method renderComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public function renderComponent($field, $value, $valueEscaped, &$object, $extra_css_classes)
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language