imagecms/ImageCMS

View on GitHub

Showing 1,388 of 1,858 total issues

Function is_prop_multiple has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function is_prop_multiple($prop_id, $props) {

        foreach ($props as $val) {
            if ($val[external_id] == $prop_id) {
                if ($val[multiple]) {
Severity: Minor
Found in application/modules/exchange/helpers/exchange_helper.php - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _create() {

        if (!$this->ajaxRequest) {
            $this->display_tpl('create_group');
        }
Severity: Minor
Found in application/modules/user_manager/admin.php - About 55 mins 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 filterById has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id)) {
            $useMinMax = false;
            if (isset($id['min'])) {
Severity: Minor
Found in application/modules/core/models/Base/RouteQuery.php - About 55 mins 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 similar_posts_configure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function similar_posts_configure($action = 'show_settings', $widget_data = []) {
        if ($this->dx_auth->is_admin() == FALSE) {
            exit;
        }
        $this->load->library('similar_posts', null, 'similar_library');
Severity: Minor
Found in application/modules/core/core_widgets.php - About 55 mins 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 recent_news_configure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function recent_news_configure($action = 'show_settings', $widget_data = []) {
        if ($this->dx_auth->is_admin() == FALSE) {
            exit;
        }

Severity: Minor
Found in application/modules/core/core_widgets.php - About 55 mins 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 initModules has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function initModules() {

        $query = $this->ci->cms_base->get_modules();

        if ($query->num_rows() > 0) {
Severity: Minor
Found in application/modules/core/src/Kernel.php - About 55 mins 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function create() {

        if ($this->input->post()) {
            $id = $this->email->create();
            if ($id) {
Severity: Minor
Found in application/modules/cmsemail/admin.php - About 55 mins 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 filterByEntityId has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filterByEntityId($entityId = null, $comparison = null)
    {
        if (is_array($entityId)) {
            $useMinMax = false;
            if (isset($entityId['min'])) {
Severity: Minor
Found in application/modules/core/models/Base/RouteQuery.php - About 55 mins 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 trash_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function trash_list() {
        if ($this->input->post('urls')) {
            $data = nl2br($this->input->post('urls'));
            $data = explode('<br />', $data);
            $data = array_map('trim', $data);
Severity: Minor
Found in application/modules/trash/admin.php - About 55 mins 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 register has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function register($username, $password, $email, $address = '', $key, $phone = '', $login_user = TRUE) {
Severity: Major
Found in application/libraries/DX_Auth.php - About 50 mins to fix

Avoid deeply nested control flow statements.
Open

                                if (offset.bottom >= e.pageY) {
                                    offset.right = offset.left + root.$trigger.outerWidth();
                                    if (offset.right >= e.pageX) {
                                        // reposition
                                        root.position.call(root.$trigger, root, x, y);

Function translateRole has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function translateRole($id, $lang) {

        $sqlModel = 'SELECT id, alt_name, locale, description
            FROM  shop_rbac_roles_i18n
            WHERE id = "' . $id . '" AND locale = "' . $lang . '"';
Severity: Minor
Found in application/libraries/Permitions.php - About 45 mins 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 getOldestFileToDelete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOldestFileToDelete() {
        $files_ = $this->backupFiles();
        // getting only files that allow to delete by pattern
        $files = [];
        foreach ($files_ as $file) {
Severity: Minor
Found in application/libraries/Backup.php - About 45 mins 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 deleteOldFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteOldFiles() {
        $term = $this->getSetting('backup_term');
        $maxSize = ($this->getSetting('backup_maxsize') * 1024 * 1024);

        $maxSize = 5 * 1024 * 1024;
Severity: Minor
Found in application/libraries/Backup.php - About 45 mins 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

Avoid deeply nested control flow statements.
Open

            if (opts.nowrap) return false;
Severity: Major
Found in application/modules/xbanners/assets/js/cycle.js - About 45 mins to fix

Function commonReset has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

$.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) {
Severity: Minor
Found in application/modules/xbanners/assets/js/cycle.js - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if (moduleExists($domain)) {
                            $attributes = [
                                           'name' => $domain,
                                           'type' => 'modules',
                                           'lang' => $locale,
Severity: Major
Found in application/helpers/language_helper.php - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if (!is_file(TEMPLATES_PATH . $file)) {
                        if (is_dir(TEMPLATES_PATH . $file . '/shop/')) {
                            $new_arr_shop[$file] = $file;
                        } else {
                            $new_arr[$file] = $file;
Severity: Major
Found in application/helpers/admin_helper.php - About 45 mins to fix

Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct() {

        /*
         * include composer autoloader
         */
Severity: Minor
Found in application/libraries/lib_init.php - About 45 mins 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 showMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function showMessage($message, $title = FALSE, $class = '', $ret = false, $timeout = false) {
    $del = [
            "'",
            '"',
           ];
Severity: Minor
Found in application/helpers/javascript_helper.php - About 45 mins 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