imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function getSCategories has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSCategories(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collSCategoriesPartial && !$this->isNew();
        if (null === $this->collSCategories || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collSCategories) {
Severity: Minor
Found in application/modules/core/models/Base/Route.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

Function DB has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

function &DB($params = '', $active_record_override = NULL) {
    // Load the DB config file if a DSN string wasn't passed
    if (is_string($params) AND strpos($params, '://') === FALSE) {
        
        // the only logic changes are in next few lines        
Severity: Minor
Found in application/core/database/DB.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

Function add has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public function add() {

        ($hook = get_hook('comments_on_add')) ? eval($hook) : NULL;

        // Load comments model
Severity: Minor
Found in application/modules/comments/comments.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

Function renameLocaleFolders has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    private function renameLocaleFolders($from_locale, $to_locale) {

        if ($from_locale && $to_locale) {
            $templates_dir = './templates';
            $main_dir = './application/language/main';
Severity: Minor
Found in application/modules/admin/languages.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

Function _sanitize_globals has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public function _sanitize_globals() {
        // It would be "wrong" to unset any of these GLOBALS.
        $protected = ['_SERVER', '_GET', '_POST', '_FILES', '_REQUEST',
            '_SESSION', '_ENV', 'GLOBALS', 'HTTP_RAW_POST_DATA',
            'system_folder', 'application_folder', 'BM', 'EXT',
Severity: Minor
Found in application/core/MY_Input.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

Method create_item has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create_item($id = null) {

        if (!$this->input->post()) {
            $parents = $this->db
                ->where('menu_id', $id)
Severity: Major
Found in application/modules/menu/admin.php - About 5 hrs to fix

File BaseImport.php has 387 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace import_export\classes;

use CI_DB_active_record;
Severity: Minor
Found in application/modules/import_export/classes/BaseImport.php - About 5 hrs to fix

Method processProducts1 has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function processProducts1() {

        $propertiesDataUpdate = [];
        $productPropDTDel = [];

Severity: Major
Found in application/modules/exchange/classes/Products.php - About 5 hrs to fix

Function getMoFilePath has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    function getMoFilePath($domain) {

        if ($domain) {
            if (!defined('CUR_LOCALE')) {
                $CI = &get_instance();
Severity: Minor
Found in application/helpers/language_helper.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

Function runProductUpdateQuery has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

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

        if ($arg['url'] != '') {
            $arg['url'] = $this->urlCheck($arg['url'], $productId);
Severity: Minor
Found in application/modules/import_export/classes/ProductsImport.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

Function step_1 has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function step_1() {
        $result = TRUE;

        // Check folders permissions
        $dir_array = [
Severity: Minor
Found in application/modules/install/install.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

Function pass1Helper_getPropertiesData has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    protected function pass1Helper_getPropertiesData(SimpleXMLElement $product, $categoryId) {

        $brandIdentif = Properties::getInstance()->getBrandIdentif();
        $brandId = '';

Severity: Minor
Found in application/modules/exchange/classes/Products.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

Function initBanners has 131 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function initBanners() {


    $(".frame_label:has(.niceCheck)").die('click').live('click', function () {
        var $this = $(this);
Severity: Major
Found in application/modules/xbanners/assets/js/script.js - About 5 hrs to fix

File discount_model_admin.php has 385 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use Currency\Currency;

if (!defined('BASEPATH')) {
Severity: Minor
Found in application/modules/mod_discount/models/discount_model_admin.php - About 5 hrs to fix

Function menuChildren has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function menuChildren(items, $children, counter) {
    if (!counter) {
        counter = 0;
    }
    

Method resize_and_thumb has 130 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function resize_and_thumb($file = []) {
        $this->load->library('image_lib');

        // Resize image
        if ($this->conf['max_width'] > 0 AND $this->conf['max_height'] > 0) {
Severity: Major
Found in application/modules/gallery/admin.php - About 5 hrs to fix

File languages.php has 383 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/admin/languages.php - About 5 hrs to fix

Method make_install has 128 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function make_install() {
        $this->load->helper('file');
        $this->load->helper('url');

        $db_server = $this->input->post('db_host');
Severity: Major
Found in application/modules/install/install.php - About 5 hrs to fix

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

    public function create_field() {
        $form = $this->get_form('create_field');
        $form->action = $this->get_url('create_field');
        $form->title = lang('Field creating', 'cfcm');

Severity: Minor
Found in application/modules/cfcm/admin.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

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

    public function insert_menu_item() {

        $roles = $this->input->post('roles');
        if ($roles == NULL) {
            $roles = '';
Severity: Minor
Found in application/modules/menu/admin.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

Severity
Category
Status
Source
Language