imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Method compile has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

        if ($tpl_data === FALSE) {
Severity: Major
Found in application/libraries/mabilis/Mabilis.compiler.php - About 3 hrs to fix

Method insert_menu_item has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function insert_menu_item() {

        $roles = $this->input->post('roles');
        if ($roles == NULL) {
            $roles = '';
Severity: Major
Found in application/modules/menu/admin.php - About 3 hrs to fix

Method display_menu has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function display_menu($menu_array) {

        $array_keys = array_keys($menu_array);
        $start_index = $array_keys[0];
        $end_index = $array_keys[count($array_keys) - 1];
Severity: Major
Found in application/modules/menu/menu.php - About 3 hrs to fix

File tags.php has 323 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/tags/tags.php - About 3 hrs to fix

Function splitTplFiles has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function splitTplFiles($tpl) {
        if (false === strpos($tpl, '</html>')) {
            return $tpl;
        }

Severity: Minor
Found in application/libraries/template.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 create has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function create($action, $cat_id = 0) {
        $url = $this->formUrl();

        $this->form_validation->set_rules('name', lang('Title', 'admin'), 'trim|required|min_length[1]|max_length[160]|xss_clean');

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

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

        $error = FALSE;
Severity: Minor
Found in application/modules/tags/tags.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 send_email has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function send_email() {

        // Load form validation class
        $this->load->library('form_validation');

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

    private function resize_and_thumb($file = []) {
        $this->load->library('image_lib');

        // Resize image
        if ($this->conf['max_width'] > 0 AND $this->conf['max_height'] > 0) {
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 parse has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse($module_template, $type, $lang) {

        $url_base = dirname($this->poFileManager->getPoFileUrl($module_template, $type, $lang));
        $url = get_mainsite_url($url_base);

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 runFactory has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    public static function runFactory($eventAlias = null, $cleanQueue = false) {

        (defined('BASEPATH')) OR exit('No direct script access allowed');
        foreach (Events::create()->storage as $storageKey => $value) {
            if ($eventAlias != null && $eventAlias != $storageKey) {
Severity: Minor
Found in application/modules/CMSFactory/BaseEvents.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

Method get_language_names has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function get_language_names() {

        $languageCodes = [
                          'ab' => lang('Abkhazian', 'translator', FALSE),
                          'ae' => lang('Avestan', 'translator', FALSE),
Severity: Major
Found in application/modules/translator/helpers/translator_helper.php - About 3 hrs to fix

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

class Admin extends BaseAdminController
{

    // Gallery config
    public $conf = [
Severity: Minor
Found in application/modules/gallery/admin.php - About 3 hrs to fix

File assetManager.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace CMSFactory;

use CI;
Severity: Minor
Found in application/modules/CMSFactory/assetManager.php - About 3 hrs to fix

File scripts.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
Open

$(document).ready(function () {
    /** Menu hide/show blocks **/
    $('section.mod_stats').on('click', 'a.firstLevelMenu', function () {
        var submenuBlock = $(this).next('.submenu');
        if (!$(submenuBlock).is(":visible")) {
Severity: Minor
Found in application/modules/mod_stats/assets/js/scripts.js - About 3 hrs to fix

Method addPost has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addPost() {

        $this->setCommentsLocale();
        $this->load->model('base');
        $this->_init_settings();
Severity: Major
Found in application/modules/comments/commentsapi.php - About 3 hrs to fix

Method step_1 has 90 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function step_1() {
        $result = TRUE;

        // Check folders permissions
        $dir_array = [
Severity: Major
Found in application/modules/install/install.php - About 3 hrs to fix

Function addToArchive has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function addToArchive($arr) {
        $zip = new \ZipArchive();
        $date = date('m_d_y');
        $time = date('G_i_s');
        $zipName = 'archive_' . $date . '_' . $time . '.zip';
Severity: Minor
Found in application/modules/import_export/classes/Export.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 index has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

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

        $status = $segs['status'];
        $off_set = $segs['page'];
Severity: Minor
Found in application/modules/comments/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 createLanguageFolders has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function createLanguageFolders($lang) {

        $templates_dir = './templates';
        $main_dir = './application/language/main';
        $modules_dir = './application/modules';
Severity: Minor
Found in application/modules/admin/languages.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