imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

File settings.php has 354 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

use template_manager\classes\Template;

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

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

    public function install() {

        $this->load->dbforge();
        ($this->dx_auth->is_admin()) OR exit;
        @mkdir('./uploads/mod_wishlist', 0777);
Severity: Major
Found in application/modules/wishlist/models/wishlist_model.php - About 4 hrs to fix

Method execute has 111 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute($where = [], $offset = 0) {
        $collect_ids = FALSE;

        if ($this->table == '') {
            $error = lang('Error. Select or specify the table for search', 'search');
Severity: Major
Found in application/modules/search/search.php - About 4 hrs to fix

Function replaceKeys has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function replaceKeys($templateName) {
        $templatesPath = ' ./templates / ' . $templateName;

        $fromLocale = 'en_US';
        $pofilePath = $templatesPath . ' / language / ' . $templateName . ' / ' . $fromLocale . ' / LC_MESSAGES / ' . $templateName . ' . po';
Severity: Minor
Found in application/modules/translator/translator.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 toArray has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function toArray($name, $type, $lang, $langOn = TRUE) {
        $path = $this->getPoFileUrl($name, $type, $lang);

        if (!FileOperator::getInstatce()->checkFile($path, $langOn)) {
            $error = FileOperator::getInstatce()->getErrors();
Severity: Minor
Found in application/modules/translator/classes/PoFileManager.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 add has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function add() {

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

        // Load comments model
Severity: Major
Found in application/modules/comments/comments.php - About 4 hrs to fix

Admin has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class Admin extends BaseAdminController
{

    /**
     *
Severity: Minor
Found in application/modules/menu/admin.php - About 4 hrs to fix

File BannersQuery.php has 347 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/BannersQuery.php - About 4 hrs to fix

Method GetPagesByCategory has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function GetPagesByCategory($cat_id = 'all', $pagination = null) {

        //////**********  Pagination pages **********\\\\\\\
        if ($pagination) {
            $paginationSession = ['pages_pag_url' => $pagination];
Severity: Major
Found in application/modules/admin/pages.php - About 4 hrs to fix

Method settings has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function settings($action = 'show') {

        switch ($action) {
            case 'show':
                \CMSFactory\assetManager::create()
Severity: Major
Found in application/modules/gallery/admin.php - About 4 hrs to fix

Method prepare_menu_array has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function prepare_menu_array($menu) {
        $menu_cache_key = $this->cache_key . $menu . self::getCurrentLocale();
        if (($menu_data = $this->cache->fetch($menu_cache_key, 'menus')) !== FALSE) {
            $this->menu_array = $menu_data['menu_array'];
            $this->sub_menu_array = $menu_data['sub_menu_array'];
Severity: Major
Found in application/modules/menu/menu.php - About 4 hrs to fix

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

    public function register($username, $password, $email, $address = '', $key, $phone = '', $login_user = TRUE) {

        // Load Models
        $this->ci->load->model('dx_auth/users', 'users');
        $this->ci->load->model('dx_auth/user_temp', 'user_temp');
Severity: Minor
Found in application/libraries/DX_Auth.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 build_cats_tree has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    function build_cats_tree($cats, $selected_cats = []) {

        if (is_array($cats)) {
            foreach ($cats as $cat) {
                echo '<option';
Severity: Minor
Found in application/helpers/admin_helper.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 doSave has a Cognitive Complexity of 29 (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/BannerImage.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 validateCustomData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function validateCustomData($validator) {
        if (!empty($this->entityName)) {
            $this->collectCustomData($this->entityName, $this->getId());

            if ($this->hasCustomData !== false) {
Severity: Minor
Found in application/modules/CMSFactory/PropelBaseModelClass.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 _show has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _show = function() {
            var pos, equal;

            loading.hide();

Severity: Major
Found in application/modules/gallery/assets/js/jquery.fancybox-1.3.4.js - About 4 hrs to fix

Function key has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        key: function(e) {
            var opt = $currentTrigger.data('contextMenu') || {};

            switch (e.keyCode) {
                case 9:

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

    public function install() {

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

Severity: Major
Found in application/modules/cmsemail/models/cmsemail_model.php - About 4 hrs to fix

Method runProductInsertQuery has 104 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function runProductInsertQuery($arg, $EmptyFields) {
        if ($arg['name'] == '') {
            Logger::create()
                ->set('Колонка имени товара пустая. NUM - ' . $arg['num'] . ' insert. - IMPORT');
            return;
Severity: Major
Found in application/modules/import_export/classes/ProductsImport.php - About 4 hrs to fix

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

    public function index() {
        $segs = $this->uri->uri_to_assoc(6);

        $status = $segs['status'];
        $off_set = $segs['page'];
Severity: Major
Found in application/modules/comments/admin.php - About 4 hrs to fix
Severity
Category
Status
Source
Language