imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

File admin.php has 338 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/cfcm/admin.php - About 4 hrs to fix

File mod_seo.php has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

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

Function create has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    public function create() {
        if (!$this->_is_writable()) {
            showMessage(lang('Set the directory access rights to continue the work with widgets', 'admin') . '<b>' . $this->widgets_path . '</b>', '', 'r');
            exit;
        }
Severity: Minor
Found in application/modules/admin/widgets_manager.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 command_catalog_file has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    private function command_catalog_file() {

        if ($this->check_perm() === true) {
            $file_info = pathinfo($this->input->get('filename'));
            $file_extension = $file_info['extension'];
Severity: Minor
Found in application/modules/exchange/exchange.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 processProducts23_Insert23 has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    protected function processProducts23_Insert23() {

        // process 2 (adding product_id to tables data)
        $products = &$this->insertCollector->getData('shop_products');
        $productsI18n = &$this->insertCollector->getData('shop_products_i18n');
Severity: Minor
Found in application/modules/exchange/classes/Products.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 getUsers has 101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getUsers(array $params_ = []) {
        $params = [
                   'interval' => 'day',
                   'dateFrom' => NULL,
                   'dateTo'   => NULL,
Severity: Major
Found in application/modules/mod_stats/models/orders_model.php - About 4 hrs to fix

File authapi.php has 335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use CMSFactory\Events;

(defined('BASEPATH')) OR exit('No direct script access allowed');
Severity: Minor
Found in application/modules/auth/authapi.php - About 4 hrs to fix

Method index has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function index() {

        $settings = $this->cms_admin->get_settings();
        unset($settings['siteinfo']);

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

assetManager has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

class assetManager
{

    /**
     * @var assetManager
Severity: Minor
Found in application/modules/CMSFactory/assetManager.php - About 4 hrs to fix

Method drawMainData has 100 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function drawMainData($y = 10) {
        $width = 150;
        $lineStep = 5;
        $x = 55;
        if ($y == 'step2') {

Method install has 99 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function install() {
        $this->load->dbforge();
        ($this->dx_auth->is_admin()) OR exit;
        $fields = [
                   'key'  => [
Severity: Major
Found in application/modules/mod_stats/models/stats_model.php - About 3 hrs to fix

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

    public function create() {
        if (!$this->_is_writable()) {
            showMessage(lang('Set the directory access rights to continue the work with widgets', 'admin') . '<b>' . $this->widgets_path . '</b>', '', 'r');
            exit;
        }
Severity: Major
Found in application/modules/admin/widgets_manager.php - About 3 hrs to fix

Method edit has 99 lines of code (exceeds 25 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: Major
Found in application/modules/admin/pages.php - About 3 hrs to fix

Method productInfo has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function productInfo($perPage = 0) {
        // Get products model
        $model = SProductsQuery::create()
                ->joinWithI18n(\MY_Controller::defaultLocale())
                ->addSelectModifier('SQL_CALC_FOUND_ROWS')
Severity: Major
Found in application/modules/mod_stats/controllers/ProductsController.php - About 3 hrs to fix

Function cache_file has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function cache_file() {
        $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 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_field has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit_field($name = '') {
        $name = urldecode($name);
        $this->db->limit(1);
        $field = $this->db->get_where('content_fields', ['field_name' => (string) $name]);

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

File lib_seo.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

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

BannerImageQuery has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class BannerImageQuery extends ModelCriteria
{
    protected $entityNotFoundExceptionClass = '\\Propel\\Runtime\\Exception\\EntityNotFoundException';

    /**
Severity: Minor
Found in application/modules/xbanners/models/Base/BannerImageQuery.php - About 3 hrs to fix

File admin.php has 326 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/template_manager/admin.php - About 3 hrs to fix

Method create_links_ajax has 95 lines of code (exceeds 25 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: Major
Found in application/libraries/MY_Pagination.php - About 3 hrs to fix
Severity
Category
Status
Source
Language