imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function doInsert has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImage.php - About 3 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 validation has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function validation($postArray, $id = null) {

        $typeDiscount = $postArray['type_discount'];

        if (!in_array($typeDiscount, ['certificate', 'all_order', 'comulativ', 'user', 'group_user', 'category', 'product', 'brand'])) {
Severity: Minor
Found in application/modules/mod_discount/classes/DiscountManager.php - About 3 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 get_all_banner has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_all_banner($locale, $group = 0, $active = 1) {

        $query = $this->db
            ->select('*, mod_banner.id as id')
            ->where('locale', $locale);
Severity: Minor
Found in application/modules/banners/models/banner_model.php - About 3 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 not_blocked_url has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function not_blocked_url($url) {

        if (!in_array($url, $this->blocked_urls) && !in_array(substr($url, 0, -1), $this->blocked_urls)) {
            foreach ($this->blocked_urls as $blocked_url) {
                $url = str_replace(site_url(), '', $url);
Severity: Minor
Found in application/modules/sitemap/sitemap.php - About 3 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 doInsert has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

Severity: Major
Found in application/modules/xbanners/models/Base/BannerImage.php - About 3 hrs to fix

Method runProductUpdateQuery has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function runProductUpdateQuery($productId, $arg, $EmptyFields) {
        $insertData = [];

        if ($arg['url'] != '') {
            $arg['url'] = $this->urlCheck($arg['url'], $productId);
Severity: Major
Found in application/modules/import_export/classes/ProductsImport.php - About 3 hrs to fix

Method edit_trash has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function edit_trash($id) {
        $query = $this->db->get_where('trash', ['id' => $id]);
        $this->template->add_array(['trash' => $query->row()]);

        $this->_addShopData();
Severity: Major
Found in application/modules/trash/admin.php - About 3 hrs to fix

Permitions has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class Permitions extends BaseAdminController
{

    private static $shop_controllers_path;  //define shop admin controllers path

Severity: Minor
Found in application/libraries/Permitions.php - About 3 hrs to fix

Template has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class Template extends Mabilis
{

    protected $main_layout = 'main';

Severity: Minor
Found in application/libraries/template.php - About 3 hrs to fix

ParentWishlist has 29 functions (exceeds 20 allowed). Consider refactoring.
Open

class ParentWishlist extends MY_Controller
{

    /**
     * array that contains wishlist settings
Severity: Minor
Found in application/modules/wishlist/classes/ParentWishlist.php - About 3 hrs to fix

File sitemap_model.php has 312 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/sitemap/models/sitemap_model.php - About 3 hrs to fix

File admin_menu_dev.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

function log(val) {
    console.log(val)
}

$(function () {
Severity: Minor
Found in application/modules/admin_menu/assets/js/admin_menu_dev.js - About 3 hrs to fix

Method _install has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _install() {

        if ($this->dx_auth->is_admin() == FALSE) {
            exit;
        }
Severity: Major
Found in application/modules/comments/comments.php - About 3 hrs to fix

Method add has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function add() {

        $this->form_validation->set_rules('page_title', lang('Title', 'admin'), 'trim|required|min_length[1]|max_length[500]');
        $this->form_validation->set_rules('page_url', lang('URL', 'admin'), 'alpha_dash|least_one_symbol|max_length[255]');
        $this->form_validation->set_rules('prev_text', lang('Preliminary contents', 'admin'), 'trim|required');
Severity: Major
Found in application/modules/admin/pages.php - About 3 hrs to fix

File admin.php has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use CMSFactory\assetManager;
use core\models\Route;
use core\models\RouteQuery;
Severity: Minor
Found in application/modules/trash/admin.php - About 3 hrs to fix

Function checkAllPermitions has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    private static function checkAllPermitions($adminClassName, $adminMethod) {
        $ci = &get_instance();

        //check if user is loged in
        if ($ci->dx_auth->is_logged_in()) {
Severity: Minor
Found in application/libraries/Permitions.php - About 3 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 backupFiles has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function backupFiles() {
        $lockedFiles = $this->getSetting('lockedFiles');
        if (!is_array($lockedFiles)) {
            $lockedFiles = [];
        }
Severity: Minor
Found in application/libraries/Backup.php - About 3 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 prepare_tags has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function prepare_tags($array = []) {
        $result = [];

        if (count($array) > 0) {
            $result = $array;
Severity: Minor
Found in application/modules/tags/tags.php - About 3 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 deleteLanguageFolders has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    private function deleteLanguageFolders($lang) {

        $templates_dir = './templates';
        $main_dir = './application/language/main';
        $modules_dir = './application/modules';
Severity: Minor
Found in application/modules/admin/languages.php - About 3 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 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit($id, $locale = null) {

        if (null === $locale) {
            $locale = MY_Controller::getCurrentLocale();
        }
Severity: Minor
Found in application/modules/mod_discount/admin.php - About 3 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