imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

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

    public function index() {
        $language = $this->cms_admin->get_default_lang();

        // get latest pages
        $this->db->limit(5);
Severity: Major
Found in application/modules/admin/dashboard.php - About 3 hrs to fix

Method getTpl has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTpl($check) {
        $languages = $this->getLangs();

        $usePriceType = self::isPremiumCMS();

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

Method search has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function search($tag = '', $offset = 0) {
        $this->load->module('search');
        $this->search->search_tpl = 'search';

        $error = FALSE;
Severity: Major
Found in application/modules/tags/tags.php - About 3 hrs to fix

Method DB has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function &DB($params = '', $active_record_override = NULL) {
    // Load the DB config file if a DSN string wasn't passed
    if (is_string($params) AND strpos($params, '://') === FALSE) {
        
        // the only logic changes are in next few lines        
Severity: Major
Found in application/core/database/DB.php - About 3 hrs to fix

Function go has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function go(els, opts, manual, fwd) {
    // opts.busy is true if we're in the middle of an animation
    if (manual && opts.busy && opts.manualTrump) {
        // let manual transitions requests trump active ones
        $(els).stop(true,true);
Severity: Major
Found in application/modules/xbanners/assets/js/cycle.js - About 3 hrs to fix

Method move_pages has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function move_pages($action) {

        $ids = $this->input->post('pages');
        $ids_key = array_flip($this->input->post('pages'));

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

Method register has 74 lines of code (exceeds 25 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: Major
Found in application/libraries/DX_Auth.php - About 2 hrs to fix

Method _buildCategoryMeta has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function _buildCategoryMeta($categoryObj) {

        CI::$APP->load->helper('array_helper');

        $local = MY_Controller::getCurrentLocale();
Severity: Major
Found in application/modules/mod_seo/mod_seo.php - About 2 hrs to fix

Method sendEmail has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function sendEmail($send_to, $pattern_name, $variables, $attachment = FALSE) {
        //loading CodeIgniter Email library
        $this->load->library('email');
        $locale = MY_Controller::getCurrentLocale();

Severity: Major
Found in application/modules/cmsemail/classes/ParentEmail.php - About 2 hrs to fix

Method register has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function register() {
        if (!$this->dx_auth->is_logged_in() AND $this->dx_auth->allow_registration) {
            $val = $this->form_validation;
            // Set form validation rules
            $this->form_validation->set_message('required', lang('The %s is required', 'auth'));
Severity: Major
Found in application/modules/auth/authapi.php - About 2 hrs to fix

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

    public function index($id) {
        $category = $this->model->getCategory($id);

        if (!$category) {
            throw new PageNotFoundException();
Severity: Major
Found in application/modules/core/src/Controller/CategoryController.php - About 2 hrs to fix

Function makeRolesArray has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function makeRolesArray($controller_types, $locale) {
        /* @var $ci MY_Controller */
        $ci = &get_instance();
        foreach ($controller_types as $controller_type) {
            $result[$controller_type] = $ci->db->query(
Severity: Minor
Found in application/libraries/Permitions.php - About 2 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 normalizeData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function normalizeData() {
        if ($this->useLocales == TRUE) {
            // deleting non locale fields from data array (except those what are present $this->nonLocaleKeys)
            foreach ($this->siteinfo as $key => $value) {
                if (!in_array($key, $this->locales) & !in_array($key, $this->nonLocaleKeys)) {
Severity: Minor
Found in application/libraries/SiteInfo.php - About 2 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 getAddCatFullIds has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    private function getAddCatFullIds($prodIds) {

        if (count($prodIds)) {
            $catIds = [];
            $cats = [];
Severity: Minor
Found in application/modules/import_export/classes/Export.php - About 2 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 getParsedPathsLangs has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParsedPathsLangs($baseUrl, $paths = []) {

        if ($paths) {
            $result = [];
            if ($paths) {
Severity: Minor
Found in application/modules/translator/classes/FilesParser.php - About 2 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 makeCorrectPoPaths has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function makeCorrectPoPaths($module_template, $type, $lang, $returnArray = FALSE) {

        $url = dirname($this->poFileManager->getPoFileUrl($module_template, $type, $lang));
        //______________________________________________________
        $url = get_mainsite_url($url);
Severity: Minor
Found in application/modules/translator/admin.php - About 2 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 processProperties has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    protected function processProperties() {
        foreach ($this->importData as $property) {
            $propertyData = [];
            $externalId = (string) $property->Ид;
            $name = (string) $property->Наименование;
Severity: Minor
Found in application/modules/exchange/classes/Properties.php - About 2 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 pass1Helper_getImagesData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    protected function pass1Helper_getImagesData(SimpleXMLElement $product, $exId) {

        $additionalImages = NULL;
        $mainImage = NULL;

Severity: Minor
Found in application/modules/exchange/classes/Products.php - About 2 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 create_user has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_user() {

        if ($this->input->post()) {

            $this->load->model('dx_auth/users', 'user2');
Severity: Minor
Found in application/modules/user_manager/admin.php - About 2 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 cache.php has 288 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/cache.php - About 2 hrs to fix
Severity
Category
Status
Source
Language