ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function blocks_engine_upgrade has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    function blocks_engine_upgrade() {
        echo '<h2>Updating blocks engine </h2>';
        if (!$this->table_exists('block_positions')) {
            $xoopsDB = $GLOBALS['xoopsDB'];
            $query = "CREATE TABLE `" . $xoopsDB->prefix('block_positions') . "` (
Severity: Minor
Found in upgrade/upd-2.0.18-to-impresscms-1.0/index.php - About 1 hr 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_main_show has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function b_system_main_show() {
    global $icmsConfigUser;

    $block = array();
    $block['lang_home'] = _MB_SYSTEM_HOME;
Severity: Minor
Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr 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 selFilter has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function selFilter(id,value){
    var div_arg1 = xoopsGetElementById(id+'_arg1');
    var div_arg2 = xoopsGetElementById(id+'_arg2');
    var div_arg3 = xoopsGetElementById(id+'_arg3');
    
Severity: Minor
Found in htdocs/modules/system/admin/images/js/imanager.js - About 1 hr to fix

    Function supersubs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.supersubs = function(options){
            var opts = $.extend({}, $.fn.supersubs.defaults, options);
            // return original object to support chaining
            return this.each(function() {
                // cache selections
    Severity: Minor
    Found in htdocs/themes/reflex/js/supersubs.js - About 1 hr to fix

      Function addCombinator has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function addCombinator( matcher, combinator, base ) {
              var dir = combinator.dir,
                  checkNonElements = base && dir === "parentNode",
                  doneName = done++;
      
      
      Severity: Minor
      Found in htdocs/install/prototype.js - About 1 hr to fix

        Method xoops_module_deactivate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xoops_module_deactivate($mid) {
            global $icms_page_handler, $icms_block_handler, $icmsConfig, $icmsAdminTpl;
            if (!isset($icms_page_handler)) {
                $icms_page_handler = icms_getModuleHandler('pages', 'system');
            }
        Severity: Minor
        Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php - About 1 hr to fix

          Method b_system_info_show has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function b_system_info_show($options) {
              global $icmsConfig;
              $block = array();
              if (!empty($options[3])) {
                  $block['showgroups'] = TRUE;
          Severity: Minor
          Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

            Method icms_get_base_domain has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function icms_get_base_domain($url)
            {
                $debug = 0;
                $base_domain = '';
            
            
            Severity: Minor
            Found in htdocs/include/functions.php - About 1 hr to fix

              Method b_system_admin_cp_new_show has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function b_system_admin_cp_new_show() {
                  global $icmsTpl, $icmsConfig;
              
                  $block['lang_cp'] = _CPHOME;
              
              
              Severity: Minor
              Found in htdocs/modules/system/blocks/system_admin_blocks.php - About 1 hr to fix

                Method easiestml has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function easiestml($s) {
                    global $easiestml_lang, $icmsConfigMultilang;
                
                    // all mode for debug (allowed to system admin only)
                    if (is_object(icms::$user) && icms::$user->isAdmin(1) && ! empty($_GET['lang']) && $_GET['lang'] == 'all') {
                Severity: Minor
                Found in htdocs/include/im_multilanguage.php - About 1 hr to fix

                  Method icms_getModuleHandler has 37 lines of code (exceeds 25 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 1 hr to fix

                    Method exec has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function exec() {
                            if (!$this->getVar('sat_enabled')) return FALSE;
                            if (((int) $this->getVar('sat_lastruntime') + (int) $this->getVar('sat_interval') * 60) > time()) return FALSE;
                            $code = $this->getVar('sat_code');
                            ignore_user_abort(TRUE);
                    Severity: Minor
                    Found in htdocs/modules/system/admin/autotasks/class/autotasks.php - About 1 hr to fix

                      Method displayGroups has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function displayGroups() {
                          icms_cp_header();
                          echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/groups/images/groups_big.png)">' . _AM_EDITADG . '</div><br />';
                          $member_handler = icms::handler('icms_member');
                          $groups = $member_handler->getGroups();
                      Severity: Minor
                      Found in htdocs/modules/system/admin/groups/groups.php - About 1 hr to fix

                        Method AllowedModules has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function AllowedModules($mimetype, $module) {
                                $mimetypeid_allowed = $dirname_allowed = FALSE;
                                $GrantedItems = $this->UserCanUpload();
                                $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('types', '%' . $mimetype . '%', 'LIKE'));
                        
                        
                        Severity: Minor
                        Found in htdocs/modules/system/admin/mimetype/class/mimetype.php - About 1 hr to fix

                          Method b_system_admin_cp_show has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function b_system_admin_cp_show() {
                              global $icmsTpl, $icmsConfig;
                          
                              $block['lang_cp'] = _CPHOME;
                              $block['lang_insmodules'] = _AD_INSTALLEDMODULES;
                          Severity: Minor
                          Found in htdocs/modules/system/blocks/system_admin_blocks.php - About 1 hr to fix

                            Method b_system_newmembers_show has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function b_system_newmembers_show($options) {
                                global $icmsConfigUser;
                            
                                $block = array();
                                $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('level', 0, '>'));
                            Severity: Minor
                            Found in htdocs/modules/system/blocks/system_blocks.php - About 1 hr to fix

                              Function serializeElements has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  serializeElements: function(elements, options) {
                                      if (typeof options != 'object') options = { hash: !!options };
                                      else if (Object.isUndefined(options.hash)) options.hash = true;
                                      var key, value, submitted = false, submit = options.submit, accumulator, initial;
                              
                              
                              Severity: Minor
                              Found in htdocs/install/prototype.js - About 1 hr to fix

                                Function update has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function update(element, content) {
                                        element = $(element);
                                
                                        var descendants = element.getElementsByTagName('*'),
                                            i = descendants.length;
                                Severity: Minor
                                Found in htdocs/install/prototype.js - About 1 hr to fix

                                  Method imcms_get_base_domain has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function imcms_get_base_domain($url)
                                  {
                                      $debug = 0;
                                      $base_domain = '';
                                  
                                  
                                  Severity: Minor
                                  Found in htdocs/install/include/functions.php - About 1 hr to fix

                                    Function selFilter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function selFilter(id,value){
                                        var div_arg1 = xoopsGetElementById(id+'_arg1');
                                        var div_arg2 = xoopsGetElementById(id+'_arg2');
                                        var div_arg3 = xoopsGetElementById(id+'_arg3');
                                        
                                    Severity: Minor
                                    Found in htdocs/modules/system/admin/images/js/imanager.js - About 1 hr 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