imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

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

class Admin extends BaseAdminController
{

    private static $BILING;

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

Method roleEdit has 79 lines of code (exceeds 25 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: Major
Found in application/libraries/Permitions.php - About 3 hrs to fix

Method getOnline has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getOnline() {
        $locale = MY_Controller::getCurrentLocale();
        $query = "
            SELECT 
                `mod_stats_attendance`.`id_user`,
Severity: Major
Found in application/modules/mod_stats/models/attendance_model.php - About 3 hrs to fix

File cmsemail_model.php has 297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
use CMSFactory\ModuleSettings;

/**
 * @property CI_DB_active_record $db
Severity: Minor
Found in application/modules/cmsemail/models/cmsemail_model.php - About 3 hrs to fix

Method translate has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function translate($id, $lang) {
        $cat = $this->cms_admin->get_category($id);

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

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

Function processRbacPrivileges has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private static function processRbacPrivileges() {
        $ci = &get_instance();
        $controllerFolders = self::$controller_types;
        foreach ($controllerFolders as $folder) {
            if ($folder == 'base') {
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 get_templates has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function get_templates() {

        $new_arr_shop = [];
        if ($handle = opendir(TEMPLATES_PATH)) {
            while (false !== ($file = readdir($handle))) {
Severity: Minor
Found in application/helpers/admin_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 renderGAForCart has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function renderGAForCart($model = null, $GAid = null) {

        /* Show Google Analytics code if some value inserted in admin panel */
        if ($GAid['google_analytics_id']) {
            if ($this->getCustomParams()) {
Severity: Minor
Found in application/libraries/lib_seo.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 siteInfoAdditionalManipulations has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    function siteInfoAdditionalManipulations($name) {
        if (FALSE !== strpos($name, '_path')) {
            $name = str_replace('_path', '', $name);
        }
        if (FALSE !== strpos($name, '_url')) {
Severity: Minor
Found in application/helpers/siteinfo_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 parseFile has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseFile($offers, $limit, $file = false) {
        if (!$file) {
            $file = @fopen($this->CSVsource, 'r');
        }
        if ($offers > 0) {
Severity: Minor
Found in application/modules/import_export/classes/BaseImport.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 updateSProductsCategories has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateSProductsCategories(&$arg, $productId, $EmptyFields) {
        $shopCategoryIds = [];

        $updateAddCategories = isset($arg['addcats']) && ('' !== trim($arg['addcats']) || $EmptyFields);
        if ($updateAddCategories) {
Severity: Minor
Found in application/modules/import_export/classes/ProductsImport.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 settings has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

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

        switch ($action) {
            case 'show':
                \CMSFactory\assetManager::create()
Severity: Minor
Found in application/modules/gallery/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 connect_fields has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function connect_fields($item_data, $item_type) {

        if (($cache_result = $this->cache->fetch('cfcm_field_' . $item_data['id'] . $item_type)) !== false) {
            $item_data = array_merge($item_data, $cache_result);
            return $item_data;
Severity: Minor
Found in application/modules/cfcm/cfcm.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_form has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_form($category_id = false, $item_id = false, $item_type = false, $tpl = '_onpage_form') {

        if ('page' === $category_id) {
            $item_type = 'page';
            $item_id = 0;
Severity: Minor
Found in application/modules/cfcm/cfcm.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 save_item_data has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function save_item_data($item_id, $type = 'page') {

        $this->load->module('forms');

        $group = (int) $this->input->post('cfcm_use_group');
Severity: Minor
Found in application/modules/cfcm/cfcm.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 copyUploads has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private function copyUploads($templateName) {
        $templateUploadsFolder = "./templates/{$templateName}/uploads";

        if (is_dir($templateUploadsFolder)) {
            foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($templateUploadsFolder)) as $entity) {
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 prepareUpdateSettings has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function prepareUpdateSettings($data) {
        if (!isset($data['Project-Id-Version']) || !$data['Project-Id-Version']) {
            $data['projectName'] = '';
        } else {
            $data['projectName'] = $data['Project-Id-Version'];
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 update has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function update($name, $type, $lang, $data) {
        $po_data = $this->toArray($name, $type, $lang);

        if ($po_data && array_key_exists('po_array', $po_data)) {
            foreach ($data as $origin => $values) {
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 saveCustomData has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveCustomData() {

        $locale = in_array($this->entityName, $this->entities_locale, true) ? chose_language() : MY_Controller::defaultLocale();

        if ($this->hasCustomData === false) {
Severity: Minor
Found in application/modules/CMSFactory/PropelBaseModelClass.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 sendEmail has a Cognitive Complexity of 22 (exceeds 5 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: Minor
Found in application/modules/cmsemail/classes/ParentEmail.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

Severity
Category
Status
Source
Language