imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Method runProductVariantUpdateQuery has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

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

Severity: Major
Found in application/modules/import_export/classes/ProductsImport.php - About 3 hrs to fix

File profiler_template.php has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<style type="text/css">
    #codeigniter-profiler { clear: both; background: #222; opacity: 0.45; padding: 0 5px; font-family: Helvetica, sans-serif; font-size: 10px !important; line-height: 12px; position: absolute; width: auto; min-width: 52em; max-width: 90%; z-index: 1000; display: none; }
    #codeigniter-profiler:hover { background: #101010; opacity: 1.0; }
    
    #codeigniter-profiler.bottom-right { position: fixed; bottom:0; right: 0; -webkit-border-top-left-radius: 7px; -moz-border-radius-topleft: 7px; border-top-left-radius: 7px; -webkit-box-shadow: -1px -1px 10px #222; -moz-box-shadow: -1px -1px 10px #222; box-shadow: -1px -1px 10px #222; }    
Severity: Minor
Found in application/views/profiler_template.php - About 3 hrs to fix

File TemplateManager.php has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace template_manager\classes;

use CMSFactory\Events;
Severity: Minor
Found in application/modules/template_manager/classes/TemplateManager.php - About 3 hrs to fix

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

    public function index($hash = '', $offset = 0) {

        $this->load->module('search');
        $this->load->helper('category');

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

Method create_trash has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create_trash() {
        $this->form_validation->set_rules('url', 'Url', 'required');

        $this->db->where('name', 'shop')->get('components');

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

File RouteQuery.php has 306 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace core\models\Base;

use \Exception;
Severity: Minor
Found in application/modules/core/models/Base/RouteQuery.php - About 3 hrs to fix

Consider simplifying this complex logical expression.
Open

        if ( $el.is('img') ) {
            // sigh..  sniffing, hacking, shrugging...  this crappy hack tries to account for what browsers do when
            // an image is being downloaded and the markup did not include sizing info (height/width attributes);
            // there seems to be some "default" sizes used in this situation
            var loadingIE    = ($.browser.msie  && this.cycleW == 28 && this.cycleH == 30 && !this.complete);
Severity: Critical
Found in application/modules/xbanners/assets/js/cycle.js - About 3 hrs to fix

Method _get_real_tpl has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function _get_real_tpl($index = 0, $mode = 'item') {
        if ($mode == 'item') {
            $is_active = $this->arranged_menu_array[$index]['is_active'];
            $edge = $this->arranged_menu_array[$index]['edge'];

Severity: Major
Found in application/modules/menu/menu.php - About 3 hrs to fix

Method translit has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function translit($str) {
    $tr = [
           'А'  => 'A',
           'Б'  => 'B',
           'В'  => 'V',
Severity: Major
Found in application/helpers/translit_helper.php - About 3 hrs to fix

Function roleEdit has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function roleEdit($roleId) {

        $locale = MY_Controller::getCurrentLocale();

        $queryModel = $this->db->select('shop_rbac_roles.id, shop_rbac_roles.name , shop_rbac_roles.importance, shop_rbac_roles_i18n.alt_name, shop_rbac_roles_i18n.description ')
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 compile has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function compile($file) {
        // Read template data
        $tpl_data = $this->read_tpl_file($file);

        if ($tpl_data === FALSE) {
Severity: Minor
Found in application/libraries/mabilis/Mabilis.compiler.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 update_widget has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function update_widget($id, $update_info = FALSE, $locale = NULL) {
        //cp_check_perm('widget_access_settings');
        $locale = $locale ?: MY_Controller::defaultLocale();
        $widget = $this->get($id);

Severity: Minor
Found in application/modules/admin/widgets_manager.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 updateJsLangsFile has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateJsLangsFile($langs, $domain, $type) {

        if ($type == 'modules') {
            if (MAINSITE && !is_client_module($domain)) {
                return FALSE;
Severity: Minor
Found in application/modules/translator/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

Function fetchApiTpl has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private static function fetchApiTpl() {
        $obj = CI::$APP;

        if (!$obj->input->is_ajax_request() || $obj->input->get('_pjax')) {
            $translator = $obj->db->where('name', 'translator')->get('components');
Severity: Minor
Found in application/modules/translator/translator.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 prepareData has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private function prepareData(\SimpleXMLElement $banner) {
        if ($banner->getName() != 'groups') {
            $attributes = $banner->attributes();
            $this->bannerData = [
                                 'group'      => (string) $attributes->group ? serialize(explode(',', trim((string) $attributes->group))) : '',
Severity: Minor
Found in application/modules/template_manager/installer/DemodataBanners.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 makePoFileData has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private function makePoFileData($data = []) {
        $resultData = [];
        foreach ($data as $key => $po) {
            if ($po) {
                $po = $this->preparePoFileData((array) $po);
Severity: Minor
Found in application/modules/translator/classes/PoFileManager.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_entity_mod has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    function get_entity_mod($w) {
        $ci = & get_instance();
        switch ($w) {
            case $w == 'product_0':
                return 'product - all';
Severity: Minor
Found in application/modules/banners/helpers/banners_helper.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 updateImageSizes has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateImageSizes($imageSizes) {
        $sizes = [];
        foreach ($imageSizes->size as $size) {
            if (isset($size['name']) && isset($size['width']) && isset($size['height'])) {
                if (is_numeric((string) $size['width']) && is_numeric((string) $size['height'])) {
Severity: Minor
Found in application/modules/template_manager/classes/TemplateManager.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 countSearchResults has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private function countSearchResults($where) {
        // begin query
        if (count($where) > 0) {
            foreach ($where as $params) {
                // Set search operator. (where, like, or_where, etc..)
Severity: Minor
Found in application/modules/search/search.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

BannersQuery has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

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

    /**
Severity: Minor
Found in application/modules/xbanners/models/Base/BannersQuery.php - About 3 hrs to fix
Severity
Category
Status
Source
Language