imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function create_links_ajax has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_links_ajax() {

        $CI = &get_instance();

        // If our item count or per-page total is zero there is no need to continue.
Severity: Minor
Found in application/libraries/MY_Pagination.php - About 6 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 update has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    public function update($page_id) {

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

Severity: Minor
Found in application/modules/admin/pages.php - About 6 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 doSave has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    protected function doSave(ConnectionInterface $con)
    {
        $affectedRows = 0; // initialize var to track total num of affected rows
        if (!$this->alreadyInSave) {
            $this->alreadyInSave = true;
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.php - About 6 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 doSave has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

    protected function doSave(ConnectionInterface $con)
    {
        $affectedRows = 0; // initialize var to track total num of affected rows
        if (!$this->alreadyInSave) {
            $this->alreadyInSave = true;
Severity: Minor
Found in application/modules/core/models/Base/Route.php - About 6 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 jquery.ui.position.js has 419 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery UI Position v1.10.0
 * http://jqueryui.com
 *
 * Copyright 2013 jQuery Foundation and other contributors

File BaseEvents.php has 418 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace CMSFactory;

use Closure;
Severity: Minor
Found in application/modules/CMSFactory/BaseEvents.php - About 6 hrs to fix

Method create_captcha has 148 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function create_captcha($data = '', $img_path = '', $img_url = '', $font_path = '') {
        /**
         * Function to create a random color
         * Note: We aren't using this outside this function so we will sit it inside
         * @auteur mastercode.nl
Severity: Major
Found in application/helpers/dx_captcha_helper.php - About 5 hrs to fix

Function runProductVariantUpdateQuery has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

    private function runProductVariantUpdateQuery(&$arg, &$productId, $EmptyFields) {
        /* START product variant insert query block */

        $prepareNames = $binds = $updateData = [];

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 contextMenu has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.contextMenu = function(operation, options) {
    if (typeof operation != 'string') {
        options = operation;
        operation = 'create';
    }

Function position has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

$.fn.position = function( options ) {
    if ( !options || !options.of ) {
        return _position.apply( this, arguments );
    }

File ParentWishlist.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace wishlist\classes;

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

Function buildOptions has 145 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildOptions($cont, $slides, els, options, o) {
    // support metadata plugin (v1.0 and v2.0)
    var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
    if (opts.autostop)
        opts.countdown = opts.autostopCount || els.length;
Severity: Major
Found in application/modules/xbanners/assets/js/cycle.js - About 5 hrs to fix

Function create has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        create: function(opt, root) {
            if (root === undefined) {
                root = opt;
            }
            // create contextMenu

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

<?php

(defined('BASEPATH')) OR exit('No direct script access allowed');

use CMSFactory\assetManager;
Severity: Minor
Found in application/modules/callbacks/admin.php - About 5 hrs to fix

Method command_sale_query has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function command_sale_query() {

        $xml_order = '';

        if ($this->check_perm() === true) {
Severity: Major
Found in application/modules/exchange/exchange.php - About 5 hrs to fix

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

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

        ($hook = get_hook('comments_on_add')) ? eval($hook) : NULL;
Severity: Minor
Found in application/modules/comments/commentsapi.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 getBannerImages has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBannerImages(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collBannerImagesPartial && !$this->isNew();
        if (null === $this->collBannerImages || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collBannerImages) {
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.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 getBannerImageI18ns has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBannerImageI18ns(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collBannerImageI18nsPartial && !$this->isNew();
        if (null === $this->collBannerImageI18ns || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collBannerImageI18ns) {
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImage.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 getBannersI18ns has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBannersI18ns(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collBannersI18nsPartial && !$this->isNew();
        if (null === $this->collBannersI18ns || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collBannersI18ns) {
Severity: Minor
Found in application/modules/xbanners/models/Base/Banners.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 getSProductss has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSProductss(Criteria $criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collSProductssPartial && !$this->isNew();
        if (null === $this->collSProductss || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collSProductss) {
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

Severity
Category
Status
Source
Language