lancew/DojoList

View on GitHub

Showing 388 of 1,940 total issues

Enumerable has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

var Enumerable = {
  each: function(iterator, context) {
    var index = 0;
    try {
      this._each(function(value) {
Severity: Minor
Found in js/prototype/prototype-1.6.0.3.js - About 2 hrs to fix

    Function toOpenLayers has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Marker.prototype.toOpenLayers = function() {
        var size, anchor, icon;
        if(this.iconSize) {
            size = new OpenLayers.Size(this.iconSize[0], this.iconSize[1]);
        }
    Severity: Major
    Found in js/mapstraction.js - About 2 hrs to fix

      Function setZoom has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Mapstraction.prototype.setZoom = function(zoom) {
          if(this.loaded[this.api] === false) {
              var me = this;
              this.onload[this.api].push( function() {
                  me.setZoom(zoom);
      Severity: Major
      Found in js/mapstraction.js - About 2 hrs to fix

        Function route_find has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        function route_find($method, $path)
        {
          $routes = route();
          $method = strtoupper($method);
          foreach($routes as $route)
        Severity: Minor
        Found in lib/limonade.php - About 2 hrs 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 has a complexity of 11.
        Open

        Mapstraction.prototype.doFilter = function(showCallback, hideCallback) {
        Severity: Minor
        Found in js/mapstraction.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 11.
        Open

        Mapstraction.prototype.getAttributeExtremes = function(field) {
        Severity: Minor
        Found in js/mapstraction.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Method 'respondToReadyState' has a complexity of 11.
        Open

          respondToReadyState: function(readyState) {
        Severity: Minor
        Found in js/prototype/prototype-1.6.0.3.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 11.
        Open

            function(proceed, element, style) {
        Severity: Minor
        Found in js/prototype/prototype-1.6.0.3.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 11.
        Open

          Element.Methods.getStyle = function(element, style) {
        Severity: Minor
        Found in js/prototype/prototype-1.6.0.3.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function has a complexity of 11.
        Open

        Element.addMethods = function(methods) {
        Severity: Minor
        Found in js/prototype/prototype-1.6.0.3.js by eslint

        Limit Cyclomatic Complexity (complexity)

        Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

        function a(x) {
            if (true) {
                return x; // 1st path
            } else if (false) {
                return x+1; // 2nd path
            } else {
                return 4; // 3rd path
            }
        }

        Rule Details

        This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

        Examples of incorrect code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else if (false) {
                return x+1;
            } else {
                return 4; // 3rd path
            }
        }

        Examples of correct code for a maximum of 2:

        /*eslint complexity: ["error", 2]*/
        
        function a(x) {
            if (true) {
                return x;
            } else {
                return 4;
            }
        }

        Options

        Optionally, you may specify a max object property:

        "complexity": ["error", 2]

        is equivalent to

        "complexity": ["error", { "max": 2 }]

        Deprecated: the object property maximum is deprecated. Please use the property max instead.

        When Not To Use It

        If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

        Further Reading

        Related Rules

        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md)
        • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

        Function addJSON has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Mapstraction.prototype.addJSON = function(json) {
            var features;
            if (typeof(json) == "string") {
                features = eval('(' + json + ')');
            } else {
        Severity: Major
        Found in js/mapstraction.js - About 2 hrs to fix

          Method http_response_status has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function http_response_status($num = null)
          {
            $status =  array(
                100 => 'Continue',
                101 => 'Switching Protocols',
          Severity: Major
          Found in lib/limonade.php - About 2 hrs to fix

            File create.html.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <script>
              $(document).ready(function(){
                $("#dojoform").validate();
              });
              </script>
            Severity: Minor
            Found in views/dojo/create.html.php - About 2 hrs to fix

              Function dragging has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Mapstraction.prototype.dragging = function(on) {
                  if(this.loaded[this.api] === false) {
                      var me = this;
                      this.onload[this.api].push( function() {
                          me.dragging(on);
              Severity: Major
              Found in js/mapstraction.js - About 2 hrs to fix

                Function getBounds has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                Mapstraction.prototype.getBounds = function () {
                    if(this.loaded[this.api] === false) {
                        return null;
                    }
                
                Severity: Major
                Found in js/mapstraction.js - About 2 hrs to fix

                  Function addImageOverlay has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Mapstraction.prototype.addImageOverlay = function(id, src, opacity, west, south, east, north) {
                      if(this.loaded[this.api] === false) {
                          var me = this;
                          this.onload[this.api].push( function() {
                              me.addImageOverlay(id, src, opacity, west, south, east, north);
                  Severity: Major
                  Found in js/mapstraction.js - About 2 hrs to fix

                    Function has a complexity of 10.
                    Open

                    Mapstraction.prototype.addMapListener = function(event, callback)
                    Severity: Minor
                    Found in js/mapstraction.js by eslint

                    Limit Cyclomatic Complexity (complexity)

                    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                    function a(x) {
                        if (true) {
                            return x; // 1st path
                        } else if (false) {
                            return x+1; // 2nd path
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Rule Details

                    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                    Examples of incorrect code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else if (false) {
                            return x+1;
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Examples of correct code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else {
                            return 4;
                        }
                    }

                    Options

                    Optionally, you may specify a max object property:

                    "complexity": ["error", 2]

                    is equivalent to

                    "complexity": ["error", { "max": 2 }]

                    Deprecated: the object property maximum is deprecated. Please use the property max instead.

                    When Not To Use It

                    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                    Further Reading

                    Related Rules

                    • [max-depth](max-depth.md)
                    • [max-len](max-len.md)
                    • [max-nested-callbacks](max-nested-callbacks.md)
                    • [max-params](max-params.md)
                    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                    Function has a complexity of 10.
                    Open

                    Mapstraction.prototype.getPixelRatio = function()
                    Severity: Minor
                    Found in js/mapstraction.js by eslint

                    Limit Cyclomatic Complexity (complexity)

                    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                    function a(x) {
                        if (true) {
                            return x; // 1st path
                        } else if (false) {
                            return x+1; // 2nd path
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Rule Details

                    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                    Examples of incorrect code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else if (false) {
                            return x+1;
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Examples of correct code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else {
                            return 4;
                        }
                    }

                    Options

                    Optionally, you may specify a max object property:

                    "complexity": ["error", 2]

                    is equivalent to

                    "complexity": ["error", { "max": 2 }]

                    Deprecated: the object property maximum is deprecated. Please use the property max instead.

                    When Not To Use It

                    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                    Further Reading

                    Related Rules

                    • [max-depth](max-depth.md)
                    • [max-len](max-len.md)
                    • [max-nested-callbacks](max-nested-callbacks.md)
                    • [max-params](max-params.md)
                    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                    Function has a complexity of 10.
                    Open

                    Mapstraction.prototype.getZoomLevelForBoundingBox = function( bbox ) {
                    Severity: Minor
                    Found in js/mapstraction.js by eslint

                    Limit Cyclomatic Complexity (complexity)

                    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                    function a(x) {
                        if (true) {
                            return x; // 1st path
                        } else if (false) {
                            return x+1; // 2nd path
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Rule Details

                    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                    Examples of incorrect code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else if (false) {
                            return x+1;
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Examples of correct code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else {
                            return 4;
                        }
                    }

                    Options

                    Optionally, you may specify a max object property:

                    "complexity": ["error", 2]

                    is equivalent to

                    "complexity": ["error", { "max": 2 }]

                    Deprecated: the object property maximum is deprecated. Please use the property max instead.

                    When Not To Use It

                    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                    Further Reading

                    Related Rules

                    • [max-depth](max-depth.md)
                    • [max-len](max-len.md)
                    • [max-nested-callbacks](max-nested-callbacks.md)
                    • [max-params](max-params.md)
                    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/

                    Function has a complexity of 10.
                    Open

                    Mapstraction.prototype.addSmallControls = function() {
                    Severity: Minor
                    Found in js/mapstraction.js by eslint

                    Limit Cyclomatic Complexity (complexity)

                    Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold.

                    function a(x) {
                        if (true) {
                            return x; // 1st path
                        } else if (false) {
                            return x+1; // 2nd path
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Rule Details

                    This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold (default is 20).

                    Examples of incorrect code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else if (false) {
                            return x+1;
                        } else {
                            return 4; // 3rd path
                        }
                    }

                    Examples of correct code for a maximum of 2:

                    /*eslint complexity: ["error", 2]*/
                    
                    function a(x) {
                        if (true) {
                            return x;
                        } else {
                            return 4;
                        }
                    }

                    Options

                    Optionally, you may specify a max object property:

                    "complexity": ["error", 2]

                    is equivalent to

                    "complexity": ["error", { "max": 2 }]

                    Deprecated: the object property maximum is deprecated. Please use the property max instead.

                    When Not To Use It

                    If you can't determine an appropriate complexity limit for your code, then it's best to disable this rule.

                    Further Reading

                    Related Rules

                    • [max-depth](max-depth.md)
                    • [max-len](max-len.md)
                    • [max-nested-callbacks](max-nested-callbacks.md)
                    • [max-params](max-params.md)
                    • [max-statements](max-statements.md) Source: http://eslint.org/docs/rules/
                    Severity
                    Category
                    Status
                    Source
                    Language