imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

File menu.php has 521 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
Severity: Major
Found in application/modules/menu/menu.php - About 1 day to fix

Method widget_navigation has 200 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function widget_navigation($widget = []) {
        $this->load->module('core');

        $segmentGallery = $this->pathGallery();
        if ($this->core->core_data['data_type'] === '404' || !$this->core->core_data['data_type'] || $segmentGallery === 'gallery') {
Severity: Major
Found in application/modules/navigation/navigation_widgets.php - About 1 day to fix

Function runProperties has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

    public function runProperties() {
        if (ImportBootstrap::hasErrors()) {
            return FALSE;
        }
        $properties = $this->db->query('SELECT `id`, `csv_name` FROM `shop_product_properties`')->result();
Severity: Minor
Found in application/modules/import_export/classes/BaseImport.php - About 7 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

DX_Auth has 54 functions (exceeds 20 allowed). Consider refactoring.
Open

class DX_Auth
{

    // Private
    var $_banned;
Severity: Major
Found in application/libraries/DX_Auth.php - About 7 hrs to fix

MetaManipulator has 53 functions (exceeds 20 allowed). Consider refactoring.
Open

class MetaManipulator
{
    const META_TITLE = 1;
    const META_DESCRIPTION = 2;
    const META_KEYWORDS = 3;
Severity: Major
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 7 hrs to fix

File sitemap.php has 476 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use CMSFactory\Events;
use core\models\Route;
use core\src\CoreFactory;
Severity: Minor
Found in application/modules/sitemap/sitemap.php - About 7 hrs to fix

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

    private function add() {
        if (!in_array($this->name, $this->widgets) || $this->rewriteData) {
            /**
             * Check widget type(module, html) adn prepare widget data
             */
Severity: Minor
Found in application/modules/template_manager/installer/WidgetDependence.php - About 7 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 edit_item has 178 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function edit_item($item_id) {

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

Function updateDiscountsApplies has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateDiscountsApplies() {
        BaseDiscount::prepareOption(['reBuild' => 1]);
        $baseDiscount = BaseDiscount::create();

        if (BaseDiscount::checkModuleInstall()) {
Severity: Minor
Found in application/modules/mod_discount/mod_discount.php - About 7 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 BannerImageQuery.php has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace xbanners\models\Base;

use \Exception;
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.php - About 6 hrs to fix

File admin.php has 452 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/user_manager/admin.php - About 6 hrs to fix

File components.php has 449 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use CMSFactory\Events;

if (!defined('BASEPATH')) {
Severity: Minor
Found in application/modules/admin/components.php - About 6 hrs to fix

Function command_sale_import has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    private function command_sale_import() {

        if ($this->check_perm() != true) {
            exit();
        }
Severity: Minor
Found in application/modules/exchange/exchange.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

Method installModule has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function installModule($robotsCheck) {

        $this->load->dbforge();
        ($this->dx_auth->is_admin()) OR exit;

Severity: Major
Found in application/modules/sitemap/models/sitemap_model.php - About 6 hrs to fix

File search.php has 435 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/search/search.php - About 6 hrs to fix

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

    public function register() {
        $this->core->set_meta_tags(lang('Registration', 'auth'));
        $this->template->registerMeta('ROBOTS', 'NOINDEX, NOFOLLOW');

        $this->load->library('Form_validation');
Severity: Minor
Found in application/modules/auth/auth.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 _start has 160 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _start = function() {
            var obj = selectedArray[ selectedIndex ],
                href, 
                type, 
                title,
Severity: Major
Found in application/modules/gallery/assets/js/jquery.fancybox-1.3.4.js - About 6 hrs to fix

Function widget_navigation has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
Open

    public function widget_navigation($widget = []) {
        $this->load->module('core');

        $segmentGallery = $this->pathGallery();
        if ($this->core->core_data['data_type'] === '404' || !$this->core->core_data['data_type'] || $segmentGallery === 'gallery') {
Severity: Minor
Found in application/modules/navigation/navigation_widgets.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 widgets_manager.php has 426 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use CMSFactory\Events;
use translator\classes\Replacer;

Severity: Minor
Found in application/modules/admin/widgets_manager.php - About 6 hrs to fix

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

    public function make_install() {

        // Enable url access and install default settings

        $params = [
Severity: Major
Found in application/modules/gallery/models/gallery_install.php - About 6 hrs to fix
Severity
Category
Status
Source
Language