ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Avoid deeply nested control flow statements.
Open

                                if ( !(unmatched[i] || setMatched[i]) ) {
                                    setMatched[i] = pop.call( results );
                                }
Severity: Major
Found in htdocs/install/prototype.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (Element.getStyle(element, 'position') == 'absolute') break;
    Severity: Major
    Found in htdocs/install/prototype.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                              if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
                                                  return false;
                                              }
      Severity: Major
      Found in htdocs/install/prototype.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
                                                if ( useCache ) {
                                                    (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
                                                }
        
        
        Severity: Major
        Found in htdocs/install/prototype.js - About 45 mins to fix

          Function isApplied has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              function isApplied()
              {
                  if (!isset($_SESSION[__CLASS__]) || !is_array($_SESSION[__CLASS__])) {
                      $_SESSION[__CLASS__] = array();
                  }
          Severity: Minor
          Found in upgrade/cnt-2.2.x-to-2.0.x/index.php - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                                  if ( !selector ) {
                                      push.apply( results, seed );
                                      return results;
                                  }
          Severity: Major
          Found in htdocs/install/prototype.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

            } else if (this.type == "vertical") { box2.style.top = (box1.offsetTop + this.position.level1.top) + "px"; if (this.browser.ie5) { box2.style.left = (box1.offsetWidth + this.position.level1.left) + "px";} else { box2.style.left = (box1.offsetLeft + box1.offsetWidth + this.position.level1.Left) + "px";}
            }
            Severity: Major
            Found in htdocs/include/icms_rtl.js - About 45 mins to fix

              Function updateContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  updateContent: function(responseText) {
                      var receiver = this.container[this.success() ? 'success' : 'failure'],
                          options = this.options;
              
                      if (!options.evalScripts) responseText = responseText.stripScripts();
              Severity: Minor
              Found in htdocs/install/prototype.js - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                                          if ( (elem = matcherOut[i]) ) {
                                              temp.push( (matcherIn[i] = elem) );
                                          }
              Severity: Major
              Found in htdocs/install/prototype.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if(n<=14){
                                        r = 255-(n * 17);
                                        g=b=0;
                                    }else if(n>14 && n<=28){
                                        g = 255-((n-14) * 17);
                Severity: Major
                Found in htdocs/include/color-picker.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                  nodes[i].id = id + "-" + (tree.length - 1) + "-section"; var box1 = document.getElementById(id + "-" + (tree.length - 1)); var box2 = document.getElementById(nodes[i].id); var el = new Element(box1.id); if (el.level == 1) { if (this.type == "horizontal") { box2.style.top = (box1.offsetTop + box1.offsetHeight + this.position.level1.top) + "px"; if (this.browser.ie5) { box2.style.left = (this.position.level1.left) + "px";} else {
                  /* Start open menu from right_to_left - added by stranger @ www.impresscms.ir , Script & Original hack are made by irmtfan (www.jadoogaran.org) */
                  box2.style.Right = ( box1.offsetLeft + this.position.level1.left) + "px";}
                  Severity: Major
                  Found in htdocs/include/icms_rtl.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if ( elem && elem.parentNode ) {
                                                if ( elem.id === m ) {
                                                    results.push( elem );
                                                    return results;
                                                }
                    Severity: Major
                    Found in htdocs/install/prototype.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if ( Expr.relative[ tokens[j].type ] ) {
                                                  break;
                                              }
                      Severity: Major
                      Found in htdocs/install/prototype.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
                                                    contains( context, elem ) && elem.id === m ) {
                                                    results.push( elem );
                                                    return results;
                                                }
                        Severity: Major
                        Found in htdocs/install/prototype.js - About 45 mins to fix

                          Function $ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function $() {
                                  var elements = new Array();
                          
                                  for (var i = 0; i < arguments.length; i++) {
                                      var element = arguments[i];
                          Severity: Minor
                          Found in htdocs/include/xoops.js - About 45 mins 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

                          Avoid deeply nested control flow statements.
                          Open

                                                          if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
                                                              return true;
                                                          }
                          Severity: Major
                          Found in htdocs/install/prototype.js - About 45 mins to fix

                            Function addItem has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            function addItem(itemurl, name, target, cat, url, type) {
                            Severity: Minor
                            Found in htdocs/modules/system/admin/images/js/imanager.js - About 45 mins to fix

                              Function isApplied has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function isApplied() {
                                      if (!isset($_SESSION[__CLASS__]) || !is_array($_SESSION[__CLASS__])) {
                                          $_SESSION[__CLASS__] = array();
                                      }
                                      foreach ($this->tasks as $task) {
                              Severity: Minor
                              Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 45 mins 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 isApplied has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  function isApplied()
                                  {
                                      if (!isset($_SESSION[__CLASS__]) || !is_array($_SESSION[__CLASS__])) {
                                          $_SESSION[__CLASS__] = array();
                                      }
                              Severity: Minor
                              Found in upgrade/cnt-2.3.x-to-2.0.x/index.php - About 45 mins 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

                              Avoid deeply nested control flow statements.
                              Open

                                                          if ($template != '') {
                                                              $tplfile =& $tplfile_handler->find('default', 'block', $fblock['bid']);
                                                              if (count($tplfile) == 0) {
                                                                  $tplfile_new =& $tplfile_handler->create();
                                                                  $tplfile_new->setVar('tpl_module', $dirname);
                              Severity: Major
                              Found in htdocs/install/modulesadmin.php - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language