angular/angular-hint

View on GitHub

Showing 90 of 90 total issues

File debug-parse.js has 1509 lines of code (exceeds 250 allowed). Consider refactoring.
Open


'use strict';

////////////////////////////////////

Severity: Major
Found in src/lib/debug-parse.js - About 4 days to fix

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

    module.exports = function $ParseProvider() {
      var cacheDefault = createMap();
      var cacheExpensive = createMap();
    
    
    
    Severity: Minor
    Found in src/lib/debug-parse.js - About 2 days 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 equals has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
    Open

    function equals(o1, o2) {
      if (o1 === o2) return true;
      if (o1 === null || o2 === null) return false;
      if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
      var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
    Severity: Minor
    Found in src/lib/debug-parse.js - About 1 day 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 $ParseProvider has 192 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function $ParseProvider() {
      var cacheDefault = createMap();
      var cacheExpensive = createMap();
    
    
    
    Severity: Major
    Found in src/lib/debug-parse.js - About 7 hrs to fix

      Function copy has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

      function copy(source, destination, stackSource, stackDest) {
        if (isWindow(source) || isScope(source)) {
          throw ngMinErr('cpws',
            "Can't copy! Making copies of Window or Scope instances is not supported.");
        }
      Severity: Minor
      Found in src/lib/debug-parse.js - About 7 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 $get has 188 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        this.$get = ['$filter', '$sniffer', function($filter, $sniffer) {
          var $parseOptions = {
                csp: $sniffer.csp,
                expensiveChecks: false
              },
      Severity: Major
      Found in src/lib/debug-parse.js - About 7 hrs to fix

        Function decorateRootScope has 181 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function decorateRootScope($delegate, $parse) {
        
          var perf = window.performance || { now: function () { return 0; } };
        
          var scopes = {},
        Severity: Major
        Found in src/modules/scopes.js - About 7 hrs to fix

          Function forEach has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          function forEach(obj, iterator, context) {
            var key, length;
            if (obj) {
              if (isFunction(obj)) {
                for (key in obj) {
          Severity: Minor
          Found in src/lib/debug-parse.js - About 4 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 decorateRootScope has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          function decorateRootScope($delegate, $parse) {
          
            var perf = window.performance || { now: function () { return 0; } };
          
            var scopes = {},
          Severity: Minor
          Found in src/modules/scopes.js - About 4 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 cspSafeGetterFn has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, expensiveChecks) {
            ensureSafeMemberName(key0, fullExp);
            ensureSafeMemberName(key1, fullExp);
            ensureSafeMemberName(key2, fullExp);
            ensureSafeMemberName(key3, fullExp);
          Severity: Minor
          Found in src/lib/debug-parse.js - About 4 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

          prototype has 30 functions (exceeds 20 allowed). Consider refactoring.
          Open

          Parser.prototype = {
            constructor: Parser,
          
            parse: function(text) {
              this.text = text;
          Severity: Minor
          Found in src/lib/debug-parse.js - About 3 hrs to fix

            Function lex has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

              lex: function(text) {
                this.text = text;
                this.index = 0;
                this.tokens = [];
            
            
            Severity: Minor
            Found in src/lib/debug-parse.js - About 3 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 functionCall has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

              functionCall: function(fnGetter, contextGetter) {
                var argsFn = [];
                if (this.peekToken().text !== ')') {
                  do {
                    argsFn.push(this.expression());
            Severity: Minor
            Found in src/lib/debug-parse.js - 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

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

                    arguments[1] = function() {
                      var start = perf.now();
                      var ret = reactionFunction.apply(this, arguments);
                      var end = perf.now();
                      _digestEvents.push({
            Severity: Major
            Found in src/modules/scopes.js and 1 other location - About 2 hrs to fix
            src/modules/scopes.js on lines 93..104

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

            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

                  arguments[0] = simpleExtend(function() {
                    var start = perf.now();
                    var ret = parsedExpression.apply(this, arguments);
                    var end = perf.now();
                    _digestEvents.push({
            Severity: Major
            Found in src/modules/scopes.js and 1 other location - About 2 hrs to fix
            src/modules/scopes.js on lines 108..119

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

            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 scopeDescriptor has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            function scopeDescriptor (elt, scope) {
              var val,
                  theseTypes = [],
                  noDataDefault = 'scope.$id=' + scope.$id,
                  type;
            Severity: Minor
            Found in src/modules/scopes.js - 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 copy has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function copy(source, destination, stackSource, stackDest) {
              if (isWindow(source) || isScope(source)) {
                throw ngMinErr('cpws',
                  "Can't copy! Making copies of Window or Scope instances is not supported.");
              }
            Severity: Major
            Found in src/lib/debug-parse.js - About 2 hrs to fix

              File scopes.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              'use strict';
              
              var summarize = require('../lib/summarize-model');
              var debounceOn = require('debounce-on');
              
              
              Severity: Minor
              Found in src/modules/scopes.js - About 2 hrs to fix

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

                  equality: function() {
                    var left = this.relational();
                    var token;
                    while ((token = this.expect('==','!=','===','!=='))) {
                      left = this.binaryFn(left, token.text, this.relational());
                Severity: Major
                Found in src/lib/debug-parse.js and 1 other location - About 2 hrs to fix
                src/lib/debug-parse.js on lines 1849..1856

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

                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

                  relational: function() {
                    var left = this.additive();
                    var token;
                    while ((token = this.expect('<', '>', '<=', '>='))) {
                      left = this.binaryFn(left, token.text, this.additive());
                Severity: Major
                Found in src/lib/debug-parse.js and 1 other location - About 2 hrs to fix
                src/lib/debug-parse.js on lines 1840..1847

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

                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

                Severity
                Category
                Status
                Source
                Language