angular/angular.js

View on GitHub
src/ng/parse.js

Summary

Maintainability
F
3 wks
Test Coverage

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

'use strict';

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *     Any commits to this file should be reviewed with security in mind.  *
 *   Changes to this file can potentially create security vulnerabilities. *
Severity: Major
Found in src/ng/parse.js - About 4 days to fix

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

    function $ParseProvider() {
      var cache = createMap();
      var literals = {
        'true': true,
        'false': false,
    Severity: Minor
    Found in src/ng/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 recurse has 224 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
        var left, right, self = this, args, expression, computed;
        recursionFn = recursionFn || noop;
        if (!skipWatchIdCheck && isDefined(ast.watchId)) {
          intoId = intoId || this.nextId();
    Severity: Major
    Found in src/ng/parse.js - About 1 day to fix

      Function $ParseProvider has 187 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function $ParseProvider() {
        var cache = createMap();
        var literals = {
          'true': true,
          'false': false,
      Severity: Major
      Found in src/ng/parse.js - About 7 hrs to fix

        Function $get has 169 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          this.$get = ['$filter', function($filter) {
            var noUnsafeEval = csp().noUnsafeEval;
            var $parseOptions = {
                  csp: noUnsafeEval,
                  literals: copy(literals),
        Severity: Major
        Found in src/ng/parse.js - About 6 hrs to fix

          Function recurse has 126 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            recurse: function(ast, context, create) {
              var left, right, self = this, args;
              if (ast.input) {
                return this.inputs(ast.input, ast.watchId);
              }
          Severity: Major
          Found in src/ng/parse.js - About 5 hrs to fix

            Function findConstantAndWatchExpressions has 106 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
              var allConstants;
              var argsToWatch;
              var isStatelessFilter;
            
            
            Severity: Major
            Found in src/ng/parse.js - About 4 hrs to fix

              Function findConstantAndWatchExpressions has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

              function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {
                var allConstants;
                var argsToWatch;
                var isStatelessFilter;
              
              
              Severity: Minor
              Found in src/ng/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 recurse has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
                  var left, right, self = this, args, expression, computed;
                  recursionFn = recursionFn || noop;
                  if (!skipWatchIdCheck && isDefined(ast.watchId)) {
                    intoId = intoId || this.nextId();
              Severity: Minor
              Found in src/ng/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 recurse has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                recurse: function(ast, context, create) {
                  var left, right, self = this, args;
                  if (ast.input) {
                    return this.inputs(ast.input, ast.watchId);
                  }
              Severity: Minor
              Found in src/ng/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 lex has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                lex: function(text) {
                  this.text = text;
                  this.index = 0;
                  this.tokens = [];
              
              
              Severity: Minor
              Found in src/ng/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

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

              ASTCompiler.prototype = {
                compile: function(ast) {
                  var self = this;
                  this.state = {
                    nextId: 0,
              Severity: Minor
              Found in src/ng/parse.js - About 3 hrs to fix

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

                AST.prototype = {
                  ast: function(text) {
                    this.text = text;
                    this.tokens = this.lexer.lex(text);
                
                
                Severity: Minor
                Found in src/ng/parse.js - About 3 hrs to fix

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

                  ASTInterpreter.prototype = {
                    compile: function(ast) {
                      var self = this;
                      findConstantAndWatchExpressions(ast, self.$filter);
                      var assignable;
                  Severity: Minor
                  Found in src/ng/parse.js - About 3 hrs to fix

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

                      object: function() {
                        var properties = [], property;
                        if (this.peekToken().text !== '}') {
                          do {
                            if (this.peek('}')) {
                    Severity: Minor
                    Found in src/ng/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

                    Function compile has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      compile: function(ast) {
                        var self = this;
                        this.state = {
                          nextId: 0,
                          filters: {},
                    Severity: Major
                    Found in src/ng/parse.js - About 2 hrs to fix

                      Function readString has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        readString: function(quote) {
                          var start = this.index;
                          this.index++;
                          var string = '';
                          var rawString = quote;
                      Severity: Minor
                      Found in src/ng/parse.js - About 1 hr 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 readNumber has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        readNumber: function() {
                          var number = '';
                          var start = this.index;
                          while (this.index < this.text.length) {
                            var ch = lowercase(this.text.charAt(this.index));
                      Severity: Minor
                      Found in src/ng/parse.js - About 1 hr 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 primary has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                        primary: function() {
                          var primary;
                          if (this.expect('(')) {
                            primary = this.filterChain();
                            this.consume(')');
                      Severity: Minor
                      Found in src/ng/parse.js - About 1 hr 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 compile has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        compile: function(ast) {
                          var self = this;
                          findConstantAndWatchExpressions(ast, self.$filter);
                          var assignable;
                          var assign;
                      Severity: Minor
                      Found in src/ng/parse.js - About 1 hr to fix

                        Function readString has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          readString: function(quote) {
                            var start = this.index;
                            this.index++;
                            var string = '';
                            var rawString = quote;
                        Severity: Minor
                        Found in src/ng/parse.js - About 1 hr to fix

                          Function object has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            object: function() {
                              var properties = [], property;
                              if (this.peekToken().text !== '}') {
                                do {
                                  if (this.peek('}')) {
                          Severity: Minor
                          Found in src/ng/parse.js - About 1 hr to fix

                            Function computedMember has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                              computedMember: function(left, right, context, create) {
                                return function(scope, locals, assign, inputs) {
                                  var lhs = left(scope, locals, assign, inputs);
                                  var rhs;
                                  var value;
                            Severity: Minor
                            Found in src/ng/parse.js - About 1 hr 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 primary has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              primary: function() {
                                var primary;
                                if (this.expect('(')) {
                                  primary = this.filterChain();
                                  this.consume(')');
                            Severity: Minor
                            Found in src/ng/parse.js - About 1 hr to fix

                              Function inputsWatchDelegate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
                                    var inputExpressions = parsedExpression.inputs;
                                    var lastResult;
                              
                                    if (inputExpressions.length === 1) {
                              Severity: Minor
                              Found in src/ng/parse.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                      if (t === e1 || t === e2 || t === e3 || t === e4 ||
                                          (!e1 && !e2 && !e3 && !e4)) {
                                        return token;
                                      }
                                Severity: Critical
                                Found in src/ng/parse.js - About 1 hr to fix

                                  Function lex has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    lex: function(text) {
                                      this.text = text;
                                      this.index = 0;
                                      this.tokens = [];
                                  
                                  
                                  Severity: Minor
                                  Found in src/ng/parse.js - About 1 hr to fix

                                    Function readNumber has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      readNumber: function() {
                                        var number = '';
                                        var start = this.index;
                                        while (this.index < this.text.length) {
                                          var ch = lowercase(this.text.charAt(this.index));
                                    Severity: Minor
                                    Found in src/ng/parse.js - About 1 hr to fix

                                      Function addInterceptor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function addInterceptor(parsedExpression, interceptorFn) {
                                            if (!interceptorFn) return parsedExpression;
                                      
                                            // Extract any existing interceptors out of the parsedExpression
                                            // to ensure the original parsedExpression is always the $$intercepted
                                      Severity: Minor
                                      Found in src/ng/parse.js - About 1 hr to fix

                                        Function identifier has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          identifier: function(name, context, create) {
                                            return function(scope, locals, assign, inputs) {
                                              var base = locals && (name in locals) ? locals : scope;
                                              if (create && create !== 1 && base && base[name] == null) {
                                                base[name] = {};
                                        Severity: Minor
                                        Found in src/ng/parse.js - About 1 hr 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 nonComputedMember has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          nonComputedMember: function(left, right, context, create) {
                                            return function(scope, locals, assign, inputs) {
                                              var lhs = left(scope, locals, assign, inputs);
                                              if (create && create !== 1) {
                                                if (lhs && lhs[right] == null) {
                                        Severity: Minor
                                        Found in src/ng/parse.js - About 1 hr 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 recurse has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                          recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
                                        Severity: Minor
                                        Found in src/ng/parse.js - About 45 mins to fix

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

                                            lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
                                          Severity: Minor
                                          Found in src/ng/parse.js - About 45 mins to fix

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

                                              peekAhead: function(i, e1, e2, e3, e4) {
                                            Severity: Minor
                                            Found in src/ng/parse.js - About 35 mins to fix

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

                                                  function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
                                              Severity: Minor
                                              Found in src/ng/parse.js - About 35 mins to fix

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

                                                    function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
                                                Severity: Minor
                                                Found in src/ng/parse.js - About 35 mins to fix

                                                  Function compile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                  Open

                                                    compile: function(ast) {
                                                      var self = this;
                                                      findConstantAndWatchExpressions(ast, self.$filter);
                                                      var assignable;
                                                      var assign;
                                                  Severity: Minor
                                                  Found in src/ng/parse.js - About 35 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 too many return statements within this function.
                                                  Open

                                                        return function(scope, locals, assign, inputs) {
                                                          var value = [];
                                                          for (var i = 0; i < args.length; ++i) {
                                                            value.push(args[i](scope, locals, assign, inputs));
                                                          }
                                                  Severity: Major
                                                  Found in src/ng/parse.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                        if (value === null) return 'null';
                                                    Severity: Major
                                                    Found in src/ng/parse.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                            return ast.computed ?
                                                              this.computedMember(left, right, context, create) :
                                                              this.nonComputedMember(left, right, context, create);
                                                      Severity: Major
                                                      Found in src/ng/parse.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                            if (typeof value === 'undefined') return 'undefined';
                                                        Severity: Major
                                                        Found in src/ng/parse.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                return function(scope, locals, assign, inputs) {
                                                                  var value = {};
                                                                  for (var i = 0; i < args.length; ++i) {
                                                                    if (args[i].computed) {
                                                                      value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs);
                                                          Severity: Major
                                                          Found in src/ng/parse.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                  return function(scope, locals, assign, inputs) {
                                                                    var lhs = left(scope, locals, assign, inputs);
                                                                    var rhs = right(scope, locals, assign, inputs);
                                                                    lhs.context[lhs.name] = rhs;
                                                                    return context ? {value: rhs} : rhs;
                                                            Severity: Major
                                                            Found in src/ng/parse.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                    return ast.filter ?
                                                                      function(scope, locals, assign, inputs) {
                                                                        var values = [];
                                                                        for (var i = 0; i < args.length; ++i) {
                                                                          values.push(args[i](scope, locals, assign, inputs));
                                                              Severity: Major
                                                              Found in src/ng/parse.js - About 30 mins to fix

                                                                Function arrayDeclaration has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  arrayDeclaration: function() {
                                                                    var elements = [];
                                                                    if (this.peekToken().text !== ']') {
                                                                      do {
                                                                        if (this.peek(']')) {
                                                                Severity: Minor
                                                                Found in src/ng/parse.js - About 25 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 escape has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  escape: function(value) {
                                                                    if (isString(value)) return '\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\'';
                                                                    if (isNumber(value)) return value.toString();
                                                                    if (value === true) return 'true';
                                                                    if (value === false) return 'false';
                                                                Severity: Minor
                                                                Found in src/ng/parse.js - About 25 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 program has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  program: function() {
                                                                    var body = [];
                                                                    while (true) {
                                                                      if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))
                                                                        body.push(this.expressionStatement());
                                                                Severity: Minor
                                                                Found in src/ng/parse.js - About 25 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 isPure has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                function isPure(node, parentIsPure) {
                                                                  switch (node.type) {
                                                                    // Computed members might invoke a stateful toString()
                                                                    case AST.MemberExpression:
                                                                      if (node.computed) {
                                                                Severity: Minor
                                                                Found in src/ng/parse.js - About 25 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 binary- has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  'binary-': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var lhs = left(scope, locals, assign, inputs);
                                                                      var rhs = right(scope, locals, assign, inputs);
                                                                      var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
                                                                Severity: Minor
                                                                Found in src/ng/parse.js - About 25 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

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

                                                                  relational: function() {
                                                                    var left = this.additive();
                                                                    var token;
                                                                    while ((token = this.expect('<', '>', '<=', '>='))) {
                                                                      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 3 hrs to fix
                                                                src/ng/parse.js on lines 380..387

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

                                                                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

                                                                  equality: function() {
                                                                    var left = this.relational();
                                                                    var token;
                                                                    while ((token = this.expect('==','!=','===','!=='))) {
                                                                      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 3 hrs to fix
                                                                src/ng/parse.js on lines 389..396

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

                                                                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

                                                                  logicalAND: function() {
                                                                    var left = this.equality();
                                                                    while (this.expect('&&')) {
                                                                      left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};
                                                                    }
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 2 hrs to fix
                                                                src/ng/parse.js on lines 364..370

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

                                                                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

                                                                  logicalOR: function() {
                                                                    var left = this.logicalAND();
                                                                    while (this.expect('||')) {
                                                                      left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };
                                                                    }
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 2 hrs to fix
                                                                src/ng/parse.js on lines 372..378

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

                                                                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

                                                                    case AST.LogicalExpression:
                                                                      left = this.recurse(ast.left);
                                                                      right = this.recurse(ast.right);
                                                                      return this['binary' + ast.operator](left, right, context);
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1323..1326

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

                                                                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

                                                                  'binary==': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      // eslint-disable-next-line eqeqeq
                                                                      var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1522..1528

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

                                                                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

                                                                    case AST.BinaryExpression:
                                                                      left = this.recurse(ast.left);
                                                                      right = this.recurse(ast.right);
                                                                      return this['binary' + ast.operator](left, right, context);
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1327..1330

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

                                                                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

                                                                  'binary!=': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      // eslint-disable-next-line eqeqeq
                                                                      var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1515..1521

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

                                                                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

                                                                            forEach(ast.arguments, function(expr) {
                                                                              self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {
                                                                                args.push(argument);
                                                                              });
                                                                            });
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1071..1075

                                                                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

                                                                      forEach(ast.elements, function(expr) {
                                                                        self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {
                                                                          args.push(argument);
                                                                        });
                                                                      });
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1039..1043

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

                                                                  'binary*': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1541..1546
                                                                src/ng/parse.js on lines 1547..1552

                                                                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

                                                                  'binary&&': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1559..1564

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

                                                                  'binary%': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1541..1546
                                                                src/ng/parse.js on lines 1547..1552

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

                                                                  'binary!==': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1541..1546
                                                                src/ng/parse.js on lines 1547..1552

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

                                                                  'binary>': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1541..1546
                                                                src/ng/parse.js on lines 1547..1552

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

                                                                  'binary<=': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1547..1552

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

                                                                  'binary>=': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1541..1546

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

                                                                  'binary/': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1541..1546
                                                                src/ng/parse.js on lines 1547..1552

                                                                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

                                                                  'binary||': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 1553..1558

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

                                                                  'binary===': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1529..1534
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1541..1546
                                                                src/ng/parse.js on lines 1547..1552

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

                                                                  'binary<': function(left, right, context) {
                                                                    return function(scope, locals, assign, inputs) {
                                                                      var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);
                                                                      return context ? {value: arg} : arg;
                                                                    };
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 8 other locations - About 1 hr to fix
                                                                src/ng/parse.js on lines 1485..1490
                                                                src/ng/parse.js on lines 1491..1496
                                                                src/ng/parse.js on lines 1497..1502
                                                                src/ng/parse.js on lines 1503..1508
                                                                src/ng/parse.js on lines 1509..1514
                                                                src/ng/parse.js on lines 1535..1540
                                                                src/ng/parse.js on lines 1541..1546
                                                                src/ng/parse.js on lines 1547..1552

                                                                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

                                                                    forEach(ast.elements, function(expr) {
                                                                      findConstantAndWatchExpressions(expr, $filter, astIsPure);
                                                                      allConstants = allConstants && expr.constant;
                                                                      argsToWatch.push.apply(argsToWatch, expr.toWatch);
                                                                    });
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 714..718

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

                                                                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

                                                                    forEach(ast.arguments, function(expr) {
                                                                      findConstantAndWatchExpressions(expr, $filter, astIsPure);
                                                                      allConstants = allConstants && expr.constant;
                                                                      argsToWatch.push.apply(argsToWatch, expr.toWatch);
                                                                    });
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 731..735

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

                                                                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

                                                                  isIdentifierStart: function(ch) {
                                                                    return this.options.isIdentifierStart ?
                                                                        this.options.isIdentifierStart(ch, this.codePointAt(ch)) :
                                                                        this.isValidIdentifierStart(ch);
                                                                  },
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 137..141

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

                                                                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

                                                                  isIdentifierContinue: function(ch) {
                                                                    return this.options.isIdentifierContinue ?
                                                                        this.options.isIdentifierContinue(ch, this.codePointAt(ch)) :
                                                                        this.isValidIdentifierContinue(ch);
                                                                  },
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 1 other location - About 1 hr to fix
                                                                src/ng/parse.js on lines 125..129

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

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

                                                                            for (var i = 0; i < args.length; ++i) {
                                                                              values.push(args[i](scope, locals, assign, inputs));
                                                                            }
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 2 other locations - About 40 mins to fix
                                                                src/ng/parse.js on lines 1359..1361
                                                                src/ng/parse.js on lines 1393..1395

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

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

                                                                          for (var i = 0; i < args.length; ++i) {
                                                                            values.push(args[i](scope, locals, assign, inputs));
                                                                          }
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 2 other locations - About 40 mins to fix
                                                                src/ng/parse.js on lines 1370..1372
                                                                src/ng/parse.js on lines 1393..1395

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

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

                                                                        for (var i = 0; i < args.length; ++i) {
                                                                          value.push(args[i](scope, locals, assign, inputs));
                                                                        }
                                                                Severity: Major
                                                                Found in src/ng/parse.js and 2 other locations - About 40 mins to fix
                                                                src/ng/parse.js on lines 1359..1361
                                                                src/ng/parse.js on lines 1370..1372

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

                                                                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 constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
                                                                      var unwatch = scope.$watch(function constantWatch(scope) {
                                                                        unwatch();
                                                                        return parsedExpression(scope);
                                                                      }, listener, objectEquality);
                                                                Severity: Minor
                                                                Found in src/ng/parse.js and 1 other location - About 30 mins to fix
                                                                src/ng/interpolate.js on lines 114..120

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

                                                                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

                                                                There are no issues that match your filters.

                                                                Category
                                                                Status