ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function imanager_updateimage has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

function imanager_updateimage() {
    if (!icms::$security->check()) {
        redirect_header('admin.php?fct=images', 3, implode('<br />', icms::$security->getErrors()));
    }

Severity: Minor
Found in htdocs/modules/system/admin/images/main.php - About 5 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 cp_functions.php has 388 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// $Id: cp_functions.php 12313 2013-09-15 21:14:35Z skenow $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
Severity: Minor
Found in htdocs/include/cp_functions.php - About 5 hrs to fix

    Function Serializers has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    Form.Element.Serializers = (function() {
        function input(element, value) {
            switch (element.type.toLowerCase()) {
                case 'checkbox':
                case 'radio':
    Severity: Minor
    Found in htdocs/install/prototype.js - About 5 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 icms_wordwrap has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    function icms_wordwrap($str, $width, $break = '/n', $cut = false)
    {
        if(strtolower(_CHARSET) !== 'utf-8')
        {
            $str = wordwrap($str, $width, $break, $cut);
    Severity: Minor
    Found in htdocs/include/functions.php - About 5 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 imanager_listimg has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    function imanager_listimg($imgcat_id, $start = 0) {
        global $icmsTpl, $target, $type, $query, $limit;
    
        if (!is_object(icms::$user)) {
            $groups = array(ICMS_GROUP_ANONYMOUS);
    Severity: Minor
    Found in htdocs/modules/system/admin/images/browser.php - About 5 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 imanager_listimg has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    function imanager_listimg($imgcat_id, $start = 0) {
        global $icmsAdminTpl, $query, $limit;
    
        if (!is_object(icms::$user)) {
            $groups = array(ICMS_GROUP_ANONYMOUS);
    Severity: Minor
    Found in htdocs/modules/system/admin/images/main.php - About 5 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 imanager_delcatok has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    function imanager_delcatok($imgcat_id) {
        if (!icms::$security->check()) {
            redirect_header('admin.php?fct=images', 3, implode('<br />', icms::$security->getErrors()));
        }
    
    
    Severity: Minor
    Found in htdocs/modules/system/admin/images/main.php - About 5 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 jdate has 125 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function jdate($type,$maket='now') {
        global $icmsConfig;
        icms_loadLanguageFile('core', 'calendar');
        $result='';
        if ($maket=='now') {
    Severity: Major
    Found in htdocs/include/jalali.php - About 5 hrs to fix

      Function check_dos_attack has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

          function check_dos_attack($uid = 0, $can_ban = false) {
              if ($this->_done_dos) return true;
      
              $ip4sql = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
              $uri4sql = filter_input(INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_STRING);

      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 preferences.php has 361 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      // fichier:  .../modules/install/makedata.php
      //              .../modules/system//include/update.php
      //Gestion des pr�f�rences des modules syst�me, param�tres g�n�raux etc...
      define("_AM_DBUPDATED","Base de donn&eacute;es mise &agrave; jour avec succ&egrave;s !");
      Severity: Minor
      Found in htdocs/modules/system/language/francais/admin/preferences.php - About 4 hrs to fix

        Function convert_table has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            private function convert_table($tables, $charset, $collation) {
                // Initialize vars.
                $string_querys = array();
                $binary_querys = array();
                $gen_index_querys = array();
        Severity: Minor
        Found in upgrade/upd-icms-1.0-to-1.1/index.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 xoops_header has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function xoops_header($closehead=true) {
            global $icmsConfig, $xoopsTheme, $icmsConfigPlugins, $icmsConfigMetaFooter;
            $myts =& icms_core_Textsanitizer::getInstance();
        
            if(!headers_sent())
        Severity: Minor
        Found in htdocs/include/functions.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 protector_prepare has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function protector_prepare() {
            // check the access is from install/index.php
            if (defined('_INSTALL_CHARSET') && !defined("XOOPS_MAINFILE_INCLUDED")) die('To use installer, remove the following plugin first: /plugins/preload/protector.php');
        
            // Protector class

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

        function updateUser($uid, $uname, $login_name, $name, $url, $email, $user_icq, $user_aim, $user_yim,
                            $user_msnm, $user_from, $user_occ, $user_intrest, $user_viewemail, $user_avatar,
                            $user_sig, $attachsig, $theme, $pass, $pass2, $rank, $bio, $uorder, $umode, $notify_method,
                            $notify_mode, $timezone_offset, $user_mailok, $language,
                            $pass_expired, $groups = array()
        Severity: Minor
        Found in htdocs/modules/system/admin/users/users.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 imanager_updateimage has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

        function imanager_updateimage() {
            /* because we are using a function, the GET/POST variables are not in scope */
            global $image_id, $image_display, $image_weight, $image_nicename, $imgcat_id;
        
            if (!icms::$security->check()) {
        Severity: Minor
        Found in htdocs/modules/system/admin/images/browser.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

        File comment_post.php has 357 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        // $Id: comment_post.php 12313 2013-09-15 21:14:35Z skenow $
        //  ------------------------------------------------------------------------ //
        //                XOOPS - PHP Content Management System                      //
        //                    Copyright (c) 2000 XOOPS.org                           //
        Severity: Minor
        Found in htdocs/include/comment_post.php - About 4 hrs to fix

          File index.php has 355 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * Upgrader from 2.2.* to 2.0.x
           *
           * @copyright   The XOOPS project http://www.xoops.org/
          Severity: Minor
          Found in upgrade/cnt-2.2.x-to-2.0.x/index.php - About 4 hrs to fix

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

            function make_data(&$dbm, &$cm, $adminname, $adminlogin_name, $adminpass, $adminmail, $language, $gruops) {
            
                $tables = array();
            
                // data for table 'groups_users_link'
            Severity: Minor
            Found in htdocs/install/makedata.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 b_system_admin_modules_show has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_system_admin_modules_show() {
                $block['mods'] = array();
                $module_handler = icms::handler('icms_module');
                $moduleperm_handler = icms::handler('icms_member_groupperm');
                $criteria = new icms_db_criteria_Compo();
            Severity: Minor
            Found in htdocs/modules/system/blocks/system_admin_blocks.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 cookie has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            jQuery.cookie = function(name, value, options) {
                if (typeof value != 'undefined') { // name and value given, set cookie
                    options = options || {};
                    if (value === null) {
                        value = '';
            Severity: Minor
            Found in htdocs/themes/reflex/js/cookie.js - 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

            Severity
            Category
            Status
            Source
            Language