ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

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

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

              function observeStandardEvent(element, eventName, responder) {
                  var actualEventName = getDOMEventName(eventName);
                  if (element.addEventListener) {
                      element.addEventListener(actualEventName, responder, false);
                  } else {
          Severity: Major
          Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
          htdocs/install/prototype.js on lines 7050..7057

          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 66.

          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

              function stopObservingStandardEvent(element, eventName, responder) {
                  var actualEventName = getDOMEventName(eventName);
                  if (element.removeEventListener) {
                      element.removeEventListener(actualEventName, responder, false);
                  } else {
          Severity: Major
          Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
          htdocs/install/prototype.js on lines 7010..7017

          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 66.

          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

          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

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

              if (('system' != icms::$module->getVar('dirname')
                      && XOOPS_COMMENT_APPROVENONE == icms::$module->config['com_rule'])
                      || (!is_object(icms::$user) && !icms::$module->config['com_anonpost'])
                      || !is_object(icms::$module)) {
                  redirect_header(ICMS_URL . '/user.php', 1, _NOPERM);
              Severity: Major
              Found in htdocs/include/comment_reply.php and 1 other location - About 1 hr to fix
              htdocs/include/comment_new.php on lines 49..54

              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 111.

              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 ($email) {
                              $sql = sprintf('SELECT COUNT(*) FROM %s WHERE email = %s',
                                      icms::$xoopsDB->prefix('users'), icms::$xoopsDB->quoteString(addslashes($email)));
                              $result = icms::$xoopsDB->query($sql);
                              list($count) = icms::$xoopsDB->fetchRow($result);
              Severity: Major
              Found in htdocs/edituser.php and 1 other location - About 1 hr to fix
              htdocs/edituser.php on lines 172..180

              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 111.

              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 (('system' != icms::$module->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == icms::$module->config['com_rule'])
                      || (!is_object(icms::$user) && !icms::$module->config['com_anonpost'])
                      || !is_object(icms::$module)
              ) {
                  redirect_header(ICMS_URL . '/user.php', 1, _NOPERM);
              Severity: Major
              Found in htdocs/include/comment_new.php and 1 other location - About 1 hr to fix
              htdocs/include/comment_reply.php on lines 50..55

              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 111.

              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 ($uname) {
                              $sql = sprintf('SELECT COUNT(*) FROM %s WHERE uname = %s',
                                      icms::$xoopsDB->prefix('users'), icms::$xoopsDB->quoteString(addslashes($uname)));
                              $result = icms::$xoopsDB->query($sql);
                              list($count) = icms::$xoopsDB->fetchRow($result);
              Severity: Major
              Found in htdocs/edituser.php and 1 other location - About 1 hr to fix
              htdocs/edituser.php on lines 137..145

              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 111.

              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 4 locations. Consider refactoring.
              Open

              function changeDisplay(id){
                  var elestyle = xoopsGetElementById(id).style;
                  if (elestyle.display == "block") {
                      elestyle.display = "none";
                  } else {
              Severity: Major
              Found in htdocs/include/xoops.js and 3 other locations - About 1 hr to fix
              htdocs/include/xoops.js on lines 96..103
              htdocs/include/xoops.js on lines 105..112
              htdocs/include/xoops.js on lines 114..121

              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 65.

              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

                          'border-box-width': function(element) {
                              if (!this._preComputing) this._begin();
                              var width = element.offsetWidth;
                              if (!this._preComputing) this._end();
                              return width;
              Severity: Major
              Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
              htdocs/install/prototype.js on lines 3835..3840

              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 65.

              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 4 locations. Consider refactoring.
              Open

              function makeLineThrough(id){
                  var eleStyle = xoopsGetElementById(id).style;
                  if (eleStyle.textDecoration != "line-through") {
                      eleStyle.textDecoration = "line-through";
                  } else {
              Severity: Major
              Found in htdocs/include/xoops.js and 3 other locations - About 1 hr to fix
              htdocs/include/xoops.js on lines 70..77
              htdocs/include/xoops.js on lines 96..103
              htdocs/include/xoops.js on lines 105..112

              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 65.

              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 4 locations. Consider refactoring.
              Open

              function makeItalic(id){
                  var eleStyle = xoopsGetElementById(id).style;
                  if (eleStyle.fontStyle != "italic") {
                      eleStyle.fontStyle = "italic";
                  } else {
              Severity: Major
              Found in htdocs/include/xoops.js and 3 other locations - About 1 hr to fix
              htdocs/include/xoops.js on lines 70..77
              htdocs/include/xoops.js on lines 105..112
              htdocs/include/xoops.js on lines 114..121

              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 65.

              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 4 locations. Consider refactoring.
              Open

              function makeUnderline(id){
                  var eleStyle = xoopsGetElementById(id).style;
                  if (eleStyle.textDecoration != "underline") {
                      eleStyle.textDecoration = "underline";
                  } else {
              Severity: Major
              Found in htdocs/include/xoops.js and 3 other locations - About 1 hr to fix
              htdocs/include/xoops.js on lines 70..77
              htdocs/include/xoops.js on lines 96..103
              htdocs/include/xoops.js on lines 114..121

              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 65.

              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

                          'border-box-height': function(element) {
                              if (!this._preComputing) this._begin();
                              var height = element.offsetHeight;
                              if (!this._preComputing) this._end();
                              return height;
              Severity: Major
              Found in htdocs/install/prototype.js and 1 other location - About 1 hr to fix
              htdocs/install/prototype.js on lines 3842..3847

              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 65.

              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

              The class Protector has 31 fields. Consider redesigning Protector to keep the number of fields under 15.
              Open

              class Protector {
                  var $mydirname;
                  var $_conn = null;
                  var $_conf = array();
                  var $_conf_serialized = '';

              TooManyFields

              Since: 0.1

              Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

              Example

              class Person {
                 protected $one;
                 private $two;
                 private $three;
                 [... many more fields ...]
              }

              Source https://phpmd.org/rules/codesize.html#toomanyfields

              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
                Severity
                Category
                Status
                Source
                Language