ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function Icms_getMonthNameById has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

function Icms_getMonthNameById($month_id) {
    global $icmsConfig;
    icms_loadLanguageFile('core', 'calendar');
    $month_id = icms_conv_local2nr($month_id);
    if( $icmsConfig['use_ext_date'] == true && defined ('_CALENDAR_TYPE') && _CALENDAR_TYPE == "jalali"){
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 checkSql has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    function checkSql($sql) {
        list($sql_wo_strings, $strings) = $this->separateStringsInSQL($sql);

        // stage1: addslashes() processed or not
        foreach ($this->doubtful_requests as $request) {

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 impresscms_get_adminmenu has 101 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function impresscms_get_adminmenu() {
    $admin_menu = array();
    $modules_menu = array();
    $systemadm = false;

Severity: Major
Found in htdocs/include/cp_functions.php - About 4 hrs to fix

    Method protector_postcommon has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function protector_postcommon() {
        global $xoopsModule;
    
        // configs writable check
        if (@$_SERVER['REQUEST_URI'] == '/admin.php' && !is_writable(dirname(__DIR__) . '/configs')) {

      File icms_version.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      // language file (modinfo.php)
      if (file_exists(__DIR__ . '/language/' . @$GLOBALS['icmsConfig']['language'] . '/modinfo.php')) {
          include __DIR__ . '/language/' . @$GLOBALS['icmsConfig']['language'] . '/modinfo.php';

        Function Hash has 99 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var Hash = Class.create(Enumerable, (function() {
            function initialize(object) {
                this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
            }
        
        
        Severity: Major
        Found in htdocs/install/prototype.js - About 3 hrs to fix

          Method updateUser has 31 arguments (exceeds 4 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: Major
          Found in htdocs/modules/system/admin/users/users.php - About 3 hrs to fix

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

            var Class = (function() {
            
                var IS_DONTENUM_BUGGY = (function(){
                    for (var p in { toString: 1 }) {
                        if (p === 'toString') return false;
            Severity: Minor
            Found in htdocs/install/prototype.js - 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 icms_getModuleHandler has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            function &icms_getModuleHandler($name = null, $module_dir = null, $module_basename = null, $optional = false) {
                static $handlers;
                // if $module_dir is not specified
                if (!isset($module_dir)) {
                    //if a module is loaded
            Severity: Minor
            Found in htdocs/include/functions.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 redirect_header has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            function redirect_header($url, $time = 3, $message = '', $addredirect = true, $allowExternalLink = false)
            {
                global $icmsConfig, $icmsConfigPersona;
                if(preg_match("/[\\0-\\31]|about:|script:/i", $url))
                {
            Severity: Minor
            Found in htdocs/include/functions.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 b_system_admin_warnings_show has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_system_admin_warnings_show() {
                $block = array();
                $block['msg'] = array();
            
                // Check if PDO is being used - if not, issue a warning, because it is being removed from PHP
            Severity: Minor
            Found in htdocs/modules/system/blocks/system_admin_blocks.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 addItem has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            function addItem(itemurl, name, target, cat, url, type) {
                var win = opener;
                var campo = win.document.getElementById(target);
                var opcoes = win.document.getElementById('img_cat_'+cat);
                var imagem = win.document.getElementById(target+'_img');
            Severity: Minor
            Found in htdocs/modules/system/admin/images/js/imanager.js - 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 imanager_index has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

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

            function system_get_plugin_info($dirname , $language = 'english') {
                // get $mytrustdirname for D3 modules
                $mytrustdirname = '' ;
                if (defined('XOOPS_TRUST_PATH') && file_exists(ICMS_MODULES_PATH . "/" . $dirname . "/mytrustdirname.php")) {
                    @include ICMS_MODULES_PATH . "/" . $dirname . "/mytrustdirname.php" ;
            Severity: Minor
            Found in htdocs/modules/system/blocks/system_waiting.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 b_system_bookmarks_show has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            function b_system_bookmarks_show() {
                global $icmsConfig;
                $block = array();
                icms_loadLanguageFile('core', 'notification');
                // User must be logged in
            Severity: Minor
            Found in htdocs/modules/system/blocks/system_blocks.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 imanager_index has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

            function imanager_index($imgcat_id = NULL) {
                global $icmsAdminTpl, $icmsConfig, $limit;
            
                if (!is_object(icms::$user)) {
                    $groups = array(ICMS_GROUP_ANONYMOUS);
            Severity: Minor
            Found in htdocs/modules/system/admin/images/main.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 displayUsers has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function displayUsers() {
                global $icmsConfig, $icmsModule, $icmsConfigUser;
                $userstart = isset($_GET['userstart']) ? (int) $_GET['userstart'] : 0;
            
                icms_cp_header();
            Severity: Major
            Found in htdocs/modules/system/admin/users/users.php - About 3 hrs to fix

              upgrade_impcms06 has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class upgrade_impcms06 {
              
                  public $usedFiles = array ();
                  private $tasks = array(
                      'table1', 'table2', 'table3', 'table4', 'conf',
              Severity: Minor
              Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 3 hrs to fix

                File page_dbsettings.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Installer database configuration page
                 *
                 * See the enclosed file license.txt for licensing information.
                Severity: Minor
                Found in htdocs/install/page_dbsettings.php - About 3 hrs to fix

                  Method modifyGroup has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function modifyGroup($g_id) {
                      $userstart = $memstart = 0;
                      if (!empty($_POST['userstart'])) {
                          $userstart = (int) $_POST['userstart'];
                      } elseif (!empty($_GET['userstart'])) {
                  Severity: Major
                  Found in htdocs/modules/system/admin/groups/groups.php - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language