imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function set_meta_tags has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function set_meta_tags($title = '', $keywords = '', $description = '', $page_number = '', $showsitename = 0, $category = '') {

        if ($this->core_data['data_type'] == 'main') {
            $this->template->add_array(
                [
Severity: Minor
Found in application/modules/core/core.php - About 5 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 install.php has 376 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
Severity: Minor
Found in application/modules/install/install.php - About 5 hrs to fix

Method update has 124 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function update($page_id) {

        $pagesPagination = $this->session->userdata('pages_pag_url');
        $pagesPagination = $pagesPagination ?: null;

Severity: Major
Found in application/modules/admin/pages.php - About 4 hrs to fix

Function delete_all has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete_all() {
        $n = 0;

        $cache_store_dir = $this->_Config['store'] . '/';
        if (is_dir($cache_store_dir) and ( $root_dir_handle = opendir($cache_store_dir))) {
Severity: Minor
Found in application/libraries/cache.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 delete has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete() {

        foreach ($this->input->post('ids') as $p) {

            $cat_id = $p;
Severity: Minor
Found in application/modules/admin/categories.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 search has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function search() {
        if ($this->input->get()) {
            $locale = MY_Controller::defaultLocale();
            @$s_data = $this->input->get('s_data');
            @$s_email = $this->input->get('s_email');
Severity: Minor
Found in application/modules/user_manager/admin.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 MetaManipulator.php has 370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace CMSFactory\MetaManipulator;

use CI;
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 4 hrs to fix

Method newPost has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function newPost() {
        $this->load->model('base');
        $this->_init_settings();

        ($hook = get_hook('comments_on_add')) ? eval($hook) : NULL;
Severity: Major
Found in application/modules/comments/commentsapi.php - About 4 hrs to fix

Method moduleInstall has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function moduleInstall() {

        $column = $this->db->query("SHOW COLUMNS FROM `shop_orders` where `Field` = 'discount'")->num_rows();
        if (!$column) {
            $sql = 'ALTER TABLE shop_orders ADD discount float(10,2);';
Severity: Major
Found in application/modules/mod_discount/models/discount_model_admin.php - About 4 hrs to fix

Method explode_str_on_words has 119 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function explode_str_on_words($text) {

        $search = [
                   "'ё'",
                   "'<script[^>]*?>.*?</script>'si",
Severity: Major
Found in application/libraries/lib_seo.php - About 4 hrs to fix

Function register has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function register() {
        if (!$this->dx_auth->is_logged_in() AND $this->dx_auth->allow_registration) {
            $val = $this->form_validation;
            // Set form validation rules
            $this->form_validation->set_message('required', lang('The %s is required', 'auth'));
Severity: Minor
Found in application/modules/auth/authapi.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 login has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function login() {
        $this->template->registerMeta('ROBOTS', 'NOINDEX, NOFOLLOW');
        $this->core->set_meta_tags(lang('Authorization', 'auth'));
        if (!$this->dx_auth->is_logged_in()) {
            $val = $this->form_validation;
Severity: Minor
Found in application/modules/auth/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 create_links has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create_links() {
        // If our item count or per-page total is zero there is no need to continue.
        if ($this->total_rows == 0 OR $this->per_page == 0) {
            return '';
        }
Severity: Major
Found in application/libraries/MY_Pagination.php - About 4 hrs to fix

Method create has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create($action, $cat_id = 0) {
        $url = $this->formUrl();

        $this->form_validation->set_rules('name', lang('Title', 'admin'), 'trim|required|min_length[1]|max_length[160]|xss_clean');

Severity: Major
Found in application/modules/admin/categories.php - About 4 hrs to fix

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

    public function roleCreate() {
        if ($this->input->post()) {
            $this->form_validation->set_rules('Name', lang('Title'), 'required');
            $this->form_validation->set_rules('Importance', lang('Важность'), 'numeric');
            if ($this->form_validation->run($this) == FALSE) {
Severity: Minor
Found in application/libraries/Permitions.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 login has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function login($login, $password, $remember = TRUE) {
        // Load Models
        $this->ci->load->model('dx_auth/users', 'users');
        $this->ci->load->model('dx_auth/user_temp', 'user_temp');
        $this->ci->load->model('dx_auth/login_attempts', 'login_attempts');
Severity: Minor
Found in application/libraries/DX_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

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

    public function edit($page_id, $lang = 0) {
        $this->cms_base->setLocaleId($lang);

        if ($this->cms_admin->get_page($page_id) == FALSE) {
            showMessage(lang('Page', 'admin') . $page_id . lang('Not found', 'admin'), false, 'r');
Severity: Minor
Found in application/modules/admin/pages.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 applyDiscountCartItems has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    private function applyDiscountCartItems() {
        $cart = BaseCart::getInstance();
        $cartItems = $cart->getItems('SProducts');

        if (count($cartItems['data']) == 0) {
Severity: Minor
Found in application/modules/mod_discount/mod_discount.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 _buildCategoryMeta has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public static function _buildCategoryMeta($categoryObj) {

        CI::$APP->load->helper('array_helper');

        $local = MY_Controller::getCurrentLocale();
Severity: Minor
Found in application/modules/mod_seo/mod_seo.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

Wishlist_model has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

class Wishlist_model extends CI_Model
{

    public function __construct() {
        parent::__construct();
Severity: Minor
Found in application/modules/wishlist/models/wishlist_model.php - About 4 hrs to fix
Severity
Category
Status
Source
Language