lancew/DojoList

View on GitHub

Showing 388 of 1,940 total issues

Avoid deeply nested control flow statements.
Open

                        if (hideCallback) hideCallback(this.markers[m]);
                        else this.markers[m].hide();
Severity: Major
Found in js/mapstraction.js - About 45 mins to fix

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

        attr: function(nodes, root, attr, value, operator, combinator) {
    Severity: Minor
    Found in js/prototype/prototype-1.6.0.3.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 js/prototype/prototype-1.6.0.3.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

                  for (var i = 0, node; node = nodes[i]; i++)
                    if (Element.descendantOf(targetNode, node)) return [targetNode];
      Severity: Major
      Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                  } else if (combinator == 'adjacent') {
                    for (var i = 0, node; node = nodes[i]; i++)
                      if (Selector.handlers.previousElementSibling(targetNode) == node)
                        return [targetNode];
                  } else nodes = h[combinator](nodes);
        Severity: Major
        Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (node.nodeIndex == indices[j]) results.push(node);
          Severity: Major
          Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (showCallback) showCallback(this.markers[m]);
                                    else this.markers[m].show();
            Severity: Major
            Found in js/mapstraction.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                            if (targetNode.parentNode == node) return [targetNode];
              Severity: Major
              Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (! this.applyFilter(this.markers[m], this.filters[f])) {
                                            vis = false;
                                        }
                Severity: Major
                Found in js/mapstraction.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                        if(element.tagName.toUpperCase() == 'IMG' && element.width) {
                          element.width++; element.width--;
                        } else try {
                          var n = document.createTextNode(' ');
                          element.appendChild(n);
                  Severity: Major
                  Found in js/prototype/prototype-1.6.0.3.js - About 45 mins to fix

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

                    function Validate_field($data, $type)
                    {
                        // This function checks fields and returns the number of errors found.
                        // Check if the parameters have been sent.
                        //if(!$data or !$type) { return 1;}
                    Severity: Minor
                    Found in lib/data.model.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 http_ua_accepts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function http_ua_accepts($type, $env = null)
                    {
                      if(is_null($env)) $env = env();
                      $accept = array_key_exists('HTTP_ACCEPT', $env['SERVER']) ? $env['SERVER']['HTTP_ACCEPT'] : null;
                      
                    Severity: Minor
                    Found in lib/limonade.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 halt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function halt($errno = SERVER_ERROR, $msg = '', $debug_args = null)
                    {
                      $args = func_get_args();
                      $error = array_shift($args);
                    
                    
                    Severity: Minor
                    Found in lib/limonade.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 debug has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function debug($var, $output_as_html = true)
                    { 
                      if ( is_null($var) ) { return '<span class="null-value">[NULL]</span>'; };
                      $out = '';
                      switch ($var) 
                    Severity: Minor
                    Found in lib/limonade.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

                    Consider simplifying this complex logical expression.
                    Open

                        if (Object.isString(insertions) || Object.isNumber(insertions) ||
                            Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
                              insertions = {bottom:insertions};
                    Severity: Major
                    Found in js/prototype/prototype-1.6.0.3.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (this.closed    || this.points[0].equals(this.points[length-1])) {
                              m24poly = new Map24.Polygon({
                                  Longitudes: m24longs,
                                  Latitudes: m24lats,
                                  FillColor: [this.color || "grey", this.opacity || "0.5"],
                      Severity: Major
                      Found in js/mapstraction.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                              if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
                                  (classNames && classNames.all(function(name) {
                                    return !name.toString().blank() && cn.include(' ' + name + ' ');
                                  }))))
                                elements.push(Element.extend(child));
                        Severity: Major
                        Found in js/prototype/prototype-1.6.0.3.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (this.closed    || this.points[0].equals(this.points[length-1])) {
                                  var vmpoly = new VMPolygonShape(vmpoints, this.color, this.width || 5, this.fillColor, this.opacity || 0.2);
                              }
                              else {
                                  var vmpoly = new VMPolyLine(vmpoints, this.color, this.width || 5, this.opacity || 0.5);
                          Severity: Major
                          Found in js/mapstraction.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                    if(
                                        window.BoundingBox ||
                                        window.LatLonPoint ||
                                        window.Mapstraction ||
                                        window.Marker ||
                            Severity: Major
                            Found in js/mapstraction.js - About 40 mins to fix

                              Function nth has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  nth: function(nodes, formula, root, reverse, ofType) {
                              Severity: Minor
                              Found in js/prototype/prototype-1.6.0.3.js - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language