piotrpolak/pepiscms

View on GitHub

Showing 485 of 486 total issues

Method edit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function edit($display_view = true)
    {
        $id = $this->input->getParam('id');
        $sameuser = $this->auth->getUserId() == $id;

Severity: Minor
Found in pepiscms/modules/cms_users/controllers/Cms_usersAdmin.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

        <?php if (count($controllers) && count($entities)): ?>
    
            <?php if ($is_editable): ?>
                <?= display_tip($this->lang->line('acl_edit_tip')) ?>
            <?php endif; ?>
    Severity: Major
    Found in pepiscms/application/views/admin/acl_edit.php - About 1 hr to fix

      Method computeSubmenuItem has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function computeSubmenuItem($controller, $method, $language_code, $pull_submenu_from_controller,
                                              array $menu_map_item_template, $item, $module, array $menu_map_item)
      Severity: Major
      Found in pepiscms/application/libraries/MenuRendor.php - About 1 hr to fix

        Method sendTemplate has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function sendTemplate($to, $from, $from_name, $subject, $email_template_path,
                                         $data = array(), $html = false, $attachments = array())
        Severity: Major
        Found in pepiscms/application/libraries/EmailSender.php - About 1 hr to fix

          Method drawSimpleColumnChart has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function drawSimpleColumnChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number")
          Severity: Major
          Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

            Function saveById has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function saveById($id, $data)
                {
                    foreach ($data as $_param_name => $_param_value) {
                        if (!in_array($_param_name, $this->getAcceptedPostFields())) {
                            continue;
            Severity: Minor
            Found in pepiscms/application/models/Site_language_model.php - About 55 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 log has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function log($message, $level = self::MESSAGE_LEVEL_INFO, $collection = 'SYSTEM', $resource_id = false, $user_id = false, $timestamp = false)
                {
                    $CI = &get_instance();
                    $CI->load->helper('date');
            
            
            Severity: Minor
            Found in pepiscms/application/libraries/Logger.php - About 55 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 addFilter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function addFilter($label, $field = false, $filter_type = self::FILTER_BASIC, $filter_values = false, $filter_condition = false)
                {
                    if (!is_array($label)) {
                        if (!$filter_condition) {
                            $filter_condition = $this->getDefaultFilterConditionByFilterType($filter_type);
            Severity: Minor
            Found in pepiscms/application/libraries/DataGrid.php - About 55 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 writeConfigFiles has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function writeConfigFiles($data, $base_path)
                {
                    list($hostname, $port) = $this->explodeHostname($data['hostname']);
            
                    $templates_base_path = realpath(dirname(realpath(__FILE__)) . '/../../resources/config_template/') . '/';
            Severity: Minor
            Found in pepiscms/application/libraries/Installer_helper.php - About 55 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 saveConfigByName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function saveConfigByName($name, $value, $module = null)
                {
                    $entry = $this->getByName($name);
            
                    $id = false;
            Severity: Minor
            Found in pepiscms/application/models/Siteconfig_model.php - About 55 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 runMultipleSqlQueries has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function runMultipleSqlQueries($sql, $query_separator = ';')
                {
                    $rs = false;
            
                    $this->db->trans_start();
            Severity: Minor
            Found in pepiscms/application/libraries/Query_helper.php - About 55 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 features has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function features()
                {
                    $_LANG_DIR = dirname(realpath(__FILE__)) . '/../../language/';
                    $_THEMES_DIR = INSTALLATIONPATH . 'theme/';
            
            
            Severity: Minor
            Found in pepiscms/application/controllers/admin/Installer.php - About 55 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 index has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function index()
                {
                    $reflection = new ReflectionClass($this);
                    $methods = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
            
            
            Severity: Minor
            Found in pepiscms/application/controllers/Tools.php - About 55 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 display_action_bar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                function display_action_bar($actions)
                {
                    if (count($actions) == 0) {
                        return false;
                    }
            Severity: Minor
            Found in pepiscms/application/helpers/dialog_message_helper.php - About 55 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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function execute($baseDir, $currentRelativePath, $input)
                {
                    $files = $this->getFiles($input);
            
                    $new_path = $this->getNewLocation($input);

            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 _getPageEditDefinition has a Cognitive Complexity of 9 (exceeds 5 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: Minor
            Found in pepiscms/modules/pages/controllers/PagesAdmin.php - About 55 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 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/Generic_model.php - About 50 mins to fix

              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 update has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function update($user_id, $display_name, $user_login = false, $group_ids = false, $password = false, $is_root = null, $data = array())
                Severity: Major
                Found in pepiscms/application/models/User_model.php - About 50 mins to fix

                  Method getMenuFlat has 7 arguments (exceeds 4 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 = '')
                  Severity: Major
                  Found in pepiscms/application/models/Menu_model.php - About 50 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language