ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      if (is_array($deltpl)) {
                          $xoopsDelTpl = new icms_view_Tpl();
                          // clear cache files
                          $xoopsDelTpl->clear_cache(null, 'mod_'.$dirname);
                          // delete template file entry in db
              Severity: Major
              Found in htdocs/install/modulesadmin.php and 1 other location - About 1 hr to fix
              htdocs/modules/system/admin/modulesadmin/modulesadmin.php on lines 986..997

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 110.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      if (is_array($deltpl)) {
                          $xoopsDelTpl = new icms_view_Tpl();
                          // clear cache files
                          $xoopsDelTpl->clear_cache(NULL, 'mod_' . $dirname);
                          // delete template file entry in db
              Severity: Major
              Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php and 1 other location - About 1 hr to fix
              htdocs/install/modulesadmin.php on lines 499..510

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 110.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        if ($confcount > 0) {
                            array_push($block['msg'], icms_core_Message::error(_TinyMCE_DEFAULT_WARNING), '', false);
                        } else {
                            if (in_array('tinymce', array_flip($editorhandler->getList()))) {
                                array_push($block['msg'], icms_core_Message::error(_TinyMCE_PRESENT_WARNING), '', false);
                    Severity: Major
                    Found in htdocs/modules/system/blocks/system_admin_blocks.php and 1 other location - About 1 hr to fix
                    htdocs/modules/system/blocks/system_admin_blocks.php on lines 86..92

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 109.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        if ($confcount > 0) {
                            array_push($block['msg'], icms_core_Message::error(_FCK_DEFAULT_WARNING), '', false);
                        } else {
                            if (in_array('FCKeditor', array_flip($editorhandler->getList()))) {
                                array_push($block['msg'], icms_core_Message::error(_FCK_PRESENT_WARNING), '', false);
                    Severity: Major
                    Found in htdocs/modules/system/blocks/system_admin_blocks.php and 1 other location - About 1 hr to fix
                    htdocs/modules/system/blocks/system_admin_blocks.php on lines 100..106

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 109.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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

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

                        function navigate(direction) {
                            // Check if any of the menu items is selected
                            if(jQuery("#suggestions ul li .itemhover").size() == 0) {
                                currentSelection = -1;
                            }
                    Severity: Minor
                    Found in htdocs/themes/reflex/js/quicksearch.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

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

                    function xoopsSmilies($textarea_id)
                    {
                        icms_core_Debug::setDeprecated('icms_form_elements_Dhtmltextarea.', sprintf(_CORE_REMOVE_IN_VERSION, '2.0'));
                        $smiles =& icms_core_DataFilter::getSmileys();
                        if (empty($smileys)) {
                    Severity: Minor
                    Found in htdocs/include/xoopscodes.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 getDirList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function getDirList($dirname) {
                        $dirlist = array();
                        if (is_dir($dirname) && $handle = opendir($dirname)) {
                            while (false !== ($file = readdir($handle))) {
                                if (substr( $file, 0, 1 ) != '.'  && strtolower($file) != 'cvs') {
                    Severity: Minor
                    Found in upgrade/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 xoops_getcss has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function xoops_getcss($theme = '')
                    {
                        if($theme == '') {$theme = $GLOBALS['icmsConfig']['theme_set'];}
                        $uagent = xoops_getenv('HTTP_USER_AGENT');
                        if(stristr($uagent, 'mac')) {$str_css = 'styleMAC.css';}
                    Severity: Minor
                    Found in htdocs/include/functions.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 getSystemHandlersList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getSystemHandlersList($checkIfItIsAvaibleOnCurrentSystem = TRUE) {
                            static $ret = NULL;
                            if ($ret === NULL) {
                                $files = glob($this->getSystemHandlerFileName('*'));
                                $ret = FALSE;
                    Severity: Minor
                    Found in htdocs/modules/system/admin/autotasks/class/autotasks.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 report has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function report() {
                            $commands = array( 'create', 'insert', 'alter', 'drop' );
                            $content = '<ul class="log">';
                            foreach ( $commands as $cmd) {
                                if (!@empty( $this->s_tables[$cmd] )) {
                    Severity: Minor
                    Found in htdocs/install/class/dbmanager.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

                    Severity
                    Category
                    Status
                    Source
                    Language