mohayonao/SCScript

View on GitHub
assets/esprima.js

Summary

Maintainability
F
3 wks
Test Coverage

File esprima.js has 2993 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
  Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
  Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
  Copyright (C) 2013 Mathias Bynens <mathias@qiwi.be>
  Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
Severity: Major
Found in assets/esprima.js - About 1 wk to fix

    Function scanPunctuator has 142 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function scanPunctuator() {
            var start = index,
                code = source.charCodeAt(index),
                code2,
                ch1 = source[index],
    Severity: Major
    Found in assets/esprima.js - About 5 hrs to fix

      Function scanStringLiteral has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function scanStringLiteral() {
              var str = '', quote, start, ch, code, unescaped, restore, octal = false;
      
              quote = source[index];
              assert((quote === '\'' || quote === '"'),
      Severity: Major
      Found in assets/esprima.js - About 3 hrs to fix

        Function scanRegExp has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function scanRegExp() {
                var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false;
        
                lookahead = null;
                skipComment();
        Severity: Major
        Found in assets/esprima.js - About 3 hrs to fix

          Function tokenize has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function tokenize(code, options) {
                  var toString,
                      token,
                      tokens;
          
          
          Severity: Major
          Found in assets/esprima.js - About 3 hrs to fix

            Function parse has 72 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function parse(code, options) {
                    var program, toString;
            
                    toString = String;
                    if (typeof code !== 'string' && !(code instanceof String)) {
            Severity: Major
            Found in assets/esprima.js - About 2 hrs to fix

              Function parseStatement has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function parseStatement() {
                      var type = lookahead.type,
                          expr,
                          labeledBody,
                          key;
              Severity: Major
              Found in assets/esprima.js - About 2 hrs to fix

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

                    function scanNumericLiteral() {
                        var number, start, ch;
                
                        ch = source[index];
                        assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
                Severity: Major
                Found in assets/esprima.js - About 2 hrs to fix

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

                      function binaryPrecedence(token, allowIn) {
                          var prec = 0;
                  
                          if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
                              return 0;
                  Severity: Major
                  Found in assets/esprima.js - About 2 hrs to fix

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

                        function parseForStatement() {
                            var init, test, update, left, right, body, oldInIteration;
                    
                            init = test = update = null;
                    
                    
                    Severity: Major
                    Found in assets/esprima.js - About 2 hrs to fix

                      Function parseFunctionSourceElements has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function parseFunctionSourceElements() {
                              var sourceElement, sourceElements = [], token, directive, firstRestricted,
                                  oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody;
                      
                              delegate.markStart();
                      Severity: Minor
                      Found in assets/esprima.js - About 2 hrs to fix

                        Function advanceSlash has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function advanceSlash() {
                                var prevToken,
                                    checkToken;
                                // Using the following algorithm:
                                // https://github.com/mozilla/sweet.js/wiki/design
                        Severity: Minor
                        Found in assets/esprima.js - About 1 hr to fix

                          Function skipComment has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function skipComment() {
                                  var ch, start;
                          
                                  start = (index === 0);
                                  while (index < length) {
                          Severity: Minor
                          Found in assets/esprima.js - About 1 hr to fix

                            Function parseBinaryExpression has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function parseBinaryExpression() {
                                    var marker, markers, expr, token, prec, stack, right, operator, left, i;
                            
                                    marker = createLocationMarker();
                                    left = parseUnaryExpression();
                            Severity: Minor
                            Found in assets/esprima.js - About 1 hr to fix

                              Function parsePrimaryExpression has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function parsePrimaryExpression() {
                                      var type, token, expr;
                              
                                      if (match('(')) {
                                          return parseGroupExpression();
                              Severity: Minor
                              Found in assets/esprima.js - About 1 hr to fix

                                Function parseParams has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function parseParams(firstRestricted) {
                                        var param, params = [], token, stricted, paramSet, key, message;
                                        expect('(');
                                
                                        if (!match(')')) {
                                Severity: Minor
                                Found in assets/esprima.js - About 1 hr to fix

                                  Function skipMultiLineComment has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function skipMultiLineComment() {
                                          var start, loc, ch, comment;
                                  
                                          if (extra.comments) {
                                              start = index - 2;
                                  Severity: Minor
                                  Found in assets/esprima.js - About 1 hr to fix

                                    Function parseObjectProperty has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function parseObjectProperty() {
                                            var token, key, id, value, param;
                                    
                                            token = lookahead;
                                            delegate.markStart();
                                    Severity: Minor
                                    Found in assets/esprima.js - About 1 hr to fix

                                      Function parseFunctionExpression has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function parseFunctionExpression() {
                                              var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict;
                                      
                                              delegate.markStart();
                                              expectKeyword('function');
                                      Severity: Minor
                                      Found in assets/esprima.js - About 1 hr to fix

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

                                            function skipSingleLineComment(offset) {
                                                var start, loc, ch, comment;
                                        
                                                start = index - offset;
                                                loc = {
                                        Severity: Minor
                                        Found in assets/esprima.js - About 1 hr to fix

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

                                              function parseObjectInitialiser() {
                                                  var properties = [], property, name, key, kind, map = {}, toString = String;
                                          
                                                  expect('{');
                                          
                                          
                                          Severity: Minor
                                          Found in assets/esprima.js - About 1 hr to fix

                                            Function parseFunctionDeclaration has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                function parseFunctionDeclaration() {
                                                    var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict;
                                            
                                                    delegate.markStart();
                                            
                                            
                                            Severity: Minor
                                            Found in assets/esprima.js - About 1 hr to fix

                                              Function getEscapedIdentifier has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  function getEscapedIdentifier() {
                                                      var ch, id;
                                              
                                                      ch = source.charCodeAt(index++);
                                                      id = String.fromCharCode(ch);
                                              Severity: Minor
                                              Found in assets/esprima.js - About 1 hr to fix

                                                Function advance has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                    function advance() {
                                                        var ch;
                                                
                                                        skipComment();
                                                
                                                
                                                Severity: Minor
                                                Found in assets/esprima.js - About 1 hr to fix

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

                                                          processComment: function (node) {
                                                              var i, attacher, pos, len, candidate;
                                                  
                                                              if (typeof node.type === 'undefined' || node.type === Syntax.Program) {
                                                                  return;
                                                  Severity: Minor
                                                  Found in assets/esprima.js - About 1 hr to fix

                                                    Function parseSourceElements has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        function parseSourceElements() {
                                                            var sourceElement, sourceElements = [], token, directive, firstRestricted;
                                                    
                                                            while (index < length) {
                                                                token = lookahead;
                                                    Severity: Minor
                                                    Found in assets/esprima.js - About 1 hr to fix

                                                      Function collectRegex has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          function collectRegex() {
                                                              var pos, loc, regex, token;
                                                      
                                                              skipComment();
                                                      
                                                      
                                                      Severity: Minor
                                                      Found in assets/esprima.js - About 1 hr to fix

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

                                                            function parseSwitchStatement() {
                                                                var discriminant, cases, clause, oldInSwitch, defaultFound;
                                                        
                                                                expectKeyword('switch');
                                                        
                                                        
                                                        Severity: Minor
                                                        Found in assets/esprima.js - About 1 hr to fix

                                                          Function parseUnaryExpression has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              function parseUnaryExpression() {
                                                                  var token, expr;
                                                          
                                                                  delegate.markStart();
                                                          
                                                          
                                                          Severity: Minor
                                                          Found in assets/esprima.js - About 1 hr to fix

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

                                                                function isKeyword(id) {
                                                                    if (strict && isStrictModeReservedWord(id)) {
                                                                        return true;
                                                                    }
                                                            
                                                            
                                                            Severity: Minor
                                                            Found in assets/esprima.js - About 1 hr to fix

                                                              Function parseContinueStatement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                  function parseContinueStatement() {
                                                                      var label = null, key;
                                                              
                                                                      expectKeyword('continue');
                                                              
                                                              
                                                              Severity: Minor
                                                              Found in assets/esprima.js - About 1 hr to fix

                                                                Function parseBreakStatement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                    function parseBreakStatement() {
                                                                        var label = null, key;
                                                                
                                                                        expectKeyword('break');
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in assets/esprima.js - About 1 hr to fix

                                                                  Function addComment has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                      function addComment(type, value, start, end, loc) {
                                                                          var comment, attacher;
                                                                  
                                                                          assert(typeof start === 'number', 'Comment must have valid position');
                                                                  
                                                                  
                                                                  Severity: Minor
                                                                  Found in assets/esprima.js - About 1 hr to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                            for (str += '\\u'; restore < index; ++restore) {
                                                                                                str += source[restore];
                                                                                            }
                                                                    Severity: Major
                                                                    Found in assets/esprima.js - About 45 mins to fix

                                                                      Avoid deeply nested control flow statements.
                                                                      Open

                                                                                          if (!checkToken) {
                                                                                              return collectRegex();
                                                                                          }
                                                                      Severity: Major
                                                                      Found in assets/esprima.js - About 45 mins to fix

                                                                        Avoid deeply nested control flow statements.
                                                                        Open

                                                                                    } else if (ch === 0x3C) { // U+003C is '<'
                                                                                        if (source.slice(index + 1, index + 4) === '!--') {
                                                                                            ++index; // `<`
                                                                                            ++index; // `!`
                                                                                            ++index; // `-`
                                                                        Severity: Major
                                                                        Found in assets/esprima.js - About 45 mins to fix

                                                                          Avoid deeply nested control flow statements.
                                                                          Open

                                                                                              if (extra.comments) {
                                                                                                  comment = source.slice(start + 2, index - 2);
                                                                                                  loc.end = {
                                                                                                      line: lineNumber,
                                                                                                      column: index - lineStart
                                                                          Severity: Major
                                                                          Found in assets/esprima.js - About 45 mins to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                    if (isOctalDigit(ch)) {
                                                                                                        code = '01234567'.indexOf(ch);
                                                                            
                                                                                                        // \0 is not octal escape sequence
                                                                                                        if (code !== 0) {
                                                                            Severity: Major
                                                                            Found in assets/esprima.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                      if (unescaped) {
                                                                                                          str += unescaped;
                                                                                                      } else {
                                                                                                          index = restore;
                                                                                                          str += ch;
                                                                              Severity: Major
                                                                              Found in assets/esprima.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
                                                                                                    // '-->' is a single-line comment
                                                                                                    index += 3;
                                                                                                    skipSingleLineComment(3);
                                                                                                } else {
                                                                                Severity: Major
                                                                                Found in assets/esprima.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                      if (isRestrictedWord(token.value)) {
                                                                                                          firstRestricted = token;
                                                                                                          message = Messages.StrictParamName;
                                                                                                      } else if (isStrictModeReservedWord(token.value)) {
                                                                                                          firstRestricted = token;
                                                                                  Severity: Major
                                                                                  Found in assets/esprima.js - About 45 mins to fix

                                                                                    Consider simplifying this complex logical expression.
                                                                                    Open

                                                                                                    if (checkToken &&
                                                                                                            checkToken.type === 'Keyword' &&
                                                                                                            (checkToken.value === 'if' ||
                                                                                                             checkToken.value === 'while' ||
                                                                                                             checkToken.value === 'for' ||
                                                                                    Severity: Major
                                                                                    Found in assets/esprima.js - About 40 mins to fix

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

                                                                                          function addComment(type, value, start, end, loc) {
                                                                                      Severity: Minor
                                                                                      Found in assets/esprima.js - About 35 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                            return scanPunctuator();
                                                                                        Severity: Major
                                                                                        Found in assets/esprima.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                          return collectRegex();
                                                                                          Severity: Major
                                                                                          Found in assets/esprima.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                        return scanNumericLiteral();
                                                                                            Severity: Major
                                                                                            Found in assets/esprima.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                                      return scanPunctuator();
                                                                                              Severity: Major
                                                                                              Found in assets/esprima.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                                    return scanPunctuator();
                                                                                                Severity: Major
                                                                                                Found in assets/esprima.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                              return {
                                                                                                                  type: Token.Punctuator,
                                                                                                                  value: '<<=',
                                                                                                                  lineNumber: lineNumber,
                                                                                                                  lineStart: lineStart,
                                                                                                  Severity: Major
                                                                                                  Found in assets/esprima.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                                    return scanNumericLiteral();
                                                                                                    Severity: Major
                                                                                                    Found in assets/esprima.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                                  return {
                                                                                                                      type: Token.Punctuator,
                                                                                                                      value: '>>=',
                                                                                                                      lineNumber: lineNumber,
                                                                                                                      lineStart: lineStart,
                                                                                                      Severity: Major
                                                                                                      Found in assets/esprima.js - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                    return {
                                                                                                                        type: Token.Punctuator,
                                                                                                                        value: ch1,
                                                                                                                        lineNumber: lineNumber,
                                                                                                                        lineStart: lineStart,
                                                                                                        Severity: Major
                                                                                                        Found in assets/esprima.js - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                                  return collectRegex();
                                                                                                          Severity: Major
                                                                                                          Found in assets/esprima.js - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                    return scanPunctuator();
                                                                                                            Severity: Major
                                                                                                            Found in assets/esprima.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                          return scanPunctuator();
                                                                                                              Severity: Major
                                                                                                              Found in assets/esprima.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                            return collectRegex();
                                                                                                                Severity: Major
                                                                                                                Found in assets/esprima.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                              return advanceSlash();
                                                                                                                  Severity: Major
                                                                                                                  Found in assets/esprima.js - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                                return {
                                                                                                                                    type: Token.Punctuator,
                                                                                                                                    value: ch1 + ch2,
                                                                                                                                    lineNumber: lineNumber,
                                                                                                                                    lineStart: lineStart,
                                                                                                                    Severity: Major
                                                                                                                    Found in assets/esprima.js - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                                  return collectRegex();
                                                                                                                      Severity: Major
                                                                                                                      Found in assets/esprima.js - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                return scanPunctuator();
                                                                                                                        Severity: Major
                                                                                                                        Found in assets/esprima.js - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                      return {
                                                                                                                                          type: Token.Punctuator,
                                                                                                                                          value: '>>>',
                                                                                                                                          lineNumber: lineNumber,
                                                                                                                                          lineStart: lineStart,
                                                                                                                          Severity: Major
                                                                                                                          Found in assets/esprima.js - About 30 mins to fix

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

                                                                                                                                            if (node.range[1] <= attacher.comment.range[0]) {
                                                                                                                                                candidate = attacher.trailing;
                                                                                                                                                if (candidate) {
                                                                                                                                                    pos = candidate.range[0];
                                                                                                                                                    len = candidate.range[1] - pos;
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 6 hrs to fix
                                                                                                                            assets/esprima.js on lines 1390..1401

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

                                                                                                                            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

                                                                                                                                            if (node.range[0] >= attacher.comment.range[1]) {
                                                                                                                                                candidate = attacher.leading;
                                                                                                                                                if (candidate) {
                                                                                                                                                    pos = candidate.range[0];
                                                                                                                                                    len = candidate.range[1] - pos;
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 6 hrs to fix
                                                                                                                            assets/esprima.js on lines 1402..1413

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

                                                                                                                            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

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

                                                                                                                                    if (strict) {
                                                                                                                                        if (isRestrictedWord(token.value)) {
                                                                                                                                            throwErrorTolerant(token, Messages.StrictFunctionName);
                                                                                                                                        }
                                                                                                                                    } else {
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 3 hrs to fix
                                                                                                                            assets/esprima.js on lines 3425..3437

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

                                                                                                                            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

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

                                                                                                                                        if (strict) {
                                                                                                                                            if (isRestrictedWord(token.value)) {
                                                                                                                                                throwErrorTolerant(token, Messages.StrictFunctionName);
                                                                                                                                            }
                                                                                                                                        } else {
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 3 hrs to fix
                                                                                                                            assets/esprima.js on lines 3381..3393

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

                                                                                                                            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

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

                                                                                                                                    if (lookahead.type === Token.Identifier) {
                                                                                                                                        label = parseVariableIdentifier();
                                                                                                                            
                                                                                                                                        key = '$' + label.name;
                                                                                                                                        if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 2 hrs to fix
                                                                                                                            assets/esprima.js on lines 2951..2958

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

                                                                                                                            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

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

                                                                                                                                    if (lookahead.type === Token.Identifier) {
                                                                                                                                        label = parseVariableIdentifier();
                                                                                                                            
                                                                                                                                        key = '$' + label.name;
                                                                                                                                        if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 2 hrs to fix
                                                                                                                            assets/esprima.js on lines 2907..2914

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

                                                                                                                            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 isWhiteSpace(ch) {
                                                                                                                                    return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||
                                                                                                                                        (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);
                                                                                                                                }
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 2 hrs to fix
                                                                                                                            assets/escodegen.js on lines 3446..3466

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

                                                                                                                            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

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

                                                                                                                                        if (match('[')) {
                                                                                                                                            property = parseComputedMember();
                                                                                                                                            expr = delegate.createMemberExpression('[', expr, property);
                                                                                                                                        } else {
                                                                                                                                            property = parseNonComputedMember();
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 2271..2277

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

                                                                                                                            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

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

                                                                                                                                        } else if (match('[')) {
                                                                                                                                            property = parseComputedMember();
                                                                                                                                            expr = delegate.createMemberExpression('[', expr, property);
                                                                                                                                        } else {
                                                                                                                                            property = parseNonComputedMember();
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 2296..2302

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

                                                                                                                            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 5:
                                                                                                                                        return (id === 'while') || (id === 'break') || (id === 'catch') ||
                                                                                                                                            (id === 'throw') || (id === 'const') || (id === 'yield') ||
                                                                                                                                            (id === 'class') || (id === 'super');
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/escodegen.js on lines 3387..3388

                                                                                                                            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

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

                                                                                                                                        if (directive === 'use strict') {
                                                                                                                                            strict = true;
                                                                                                                                            if (firstRestricted) {
                                                                                                                                                throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);
                                                                                                                                            }
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 3280..3289

                                                                                                                            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

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

                                                                                                                                        if (directive === 'use strict') {
                                                                                                                                            strict = true;
                                                                                                                                            if (firstRestricted) {
                                                                                                                                                throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);
                                                                                                                                            }
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 3497..3506

                                                                                                                            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

                                                                                                                                    createFunctionExpression: function (id, params, defaults, body) {
                                                                                                                                        return {
                                                                                                                                            type: Syntax.FunctionExpression,
                                                                                                                                            id: id,
                                                                                                                                            params: params,
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 1582..1593

                                                                                                                            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

                                                                                                                                    createFunctionDeclaration: function (id, params, defaults, body) {
                                                                                                                                        return {
                                                                                                                                            type: Syntax.FunctionDeclaration,
                                                                                                                                            id: id,
                                                                                                                                            params: params,
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 1595..1606

                                                                                                                            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

                                                                                                                                    while (index < length) {
                                                                                                                                        if (match('}')) {
                                                                                                                                            break;
                                                                                                                                        }
                                                                                                                                        sourceElement = parseSourceElement();
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 2601..2610

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

                                                                                                                            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

                                                                                                                                    while (index < length) {
                                                                                                                                        if (match('}')) {
                                                                                                                                            break;
                                                                                                                                        }
                                                                                                                                        statement = parseSourceElement();
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 3302..3311

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

                                                                                                                            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

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

                                                                                                                                    if (length > 0) {
                                                                                                                                        if (typeof source[0] === 'undefined') {
                                                                                                                                            // Try first to convert to a string. This is good as fast path
                                                                                                                                            // for old IE which understands string indexing for string
                                                                                                                                            // literals only and not for string object.
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 3665..3674

                                                                                                                            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

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

                                                                                                                                    if (length > 0) {
                                                                                                                                        if (typeof source[0] === 'undefined') {
                                                                                                                                            // Try first to convert to a string. This is good as fast path
                                                                                                                                            // for old IE which understands string indexing for string
                                                                                                                                            // literals only and not for string object.
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 3766..3775

                                                                                                                            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

                                                                                                                                        if (trailing) {
                                                                                                                                            if (typeof trailing.trailingComments === 'undefined') {
                                                                                                                                                trailing.trailingComments = [];
                                                                                                                                            }
                                                                                                                                            trailing.trailingComments.push(attacher.comment);
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 3536..3541

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

                                                                                                                            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

                                                                                                                                        if (leading) {
                                                                                                                                            if (typeof leading.leadingComments === 'undefined') {
                                                                                                                                                leading.leadingComments = [];
                                                                                                                                            }
                                                                                                                                            leading.leadingComments.push(attacher.comment);
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 1 other location - About 1 hr to fix
                                                                                                                            assets/esprima.js on lines 3543..3548

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

                                                                                                                            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 expectKeyword(keyword) {
                                                                                                                                    var token = lex();
                                                                                                                                    if (token.type !== Token.Keyword || token.value !== keyword) {
                                                                                                                                        throwUnexpected(token);
                                                                                                                                    }
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 50 mins to fix
                                                                                                                            assets/esprima.js on lines 1887..1892

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

                                                                                                                            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 expect(value) {
                                                                                                                                    var token = lex();
                                                                                                                                    if (token.type !== Token.Punctuator || token.value !== value) {
                                                                                                                                        throwUnexpected(token);
                                                                                                                                    }
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 50 mins to fix
                                                                                                                            assets/esprima.js on lines 1897..1902

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

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

                                                                                                                                    case 6:
                                                                                                                                        return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
                                                                                                                                            (id === 'switch') || (id === 'export') || (id === 'import');
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 3 other locations - About 50 mins to fix
                                                                                                                            assets/escodegen.js on lines 3385..3386
                                                                                                                            assets/escodegen.js on lines 3389..3390
                                                                                                                            assets/esprima.js on lines 315..317

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

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

                                                                                                                                    case 4:
                                                                                                                                        return (id === 'this') || (id === 'else') || (id === 'case') ||
                                                                                                                                            (id === 'void') || (id === 'with') || (id === 'enum');
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 3 other locations - About 50 mins to fix
                                                                                                                            assets/escodegen.js on lines 3385..3386
                                                                                                                            assets/escodegen.js on lines 3389..3390
                                                                                                                            assets/esprima.js on lines 322..324

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

                                                                                                                            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

                                                                                                                                            if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                                                                                                                                                throwErrorTolerant({}, Messages.StrictLHSPostfix);
                                                                                                                                            }
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 45 mins to fix
                                                                                                                            assets/esprima.js on lines 2351..2353

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

                                                                                                                            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

                                                                                                                                    return (ch === 0x24) || (ch === 0x5F) ||  // $ (dollar) and _ (underscore)
                                                                                                                                        (ch >= 0x41 && ch <= 0x5A) ||         // A..Z
                                                                                                                                        (ch >= 0x61 && ch <= 0x7A) ||         // a..z
                                                                                                                                        (ch >= 0x30 && ch <= 0x39) ||         // 0..9
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 45 mins to fix
                                                                                                                            assets/esprima.js on lines 245..248

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

                                                                                                                            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

                                                                                                                                    return (ch === 0x24) || (ch === 0x5F) ||  // $ (dollar) and _ (underscore)
                                                                                                                                        (ch >= 0x41 && ch <= 0x5A) ||         // A..Z
                                                                                                                                        (ch >= 0x61 && ch <= 0x7A) ||         // a..z
                                                                                                                                        (ch === 0x5C) ||                      // \ (backslash)
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 45 mins to fix
                                                                                                                            assets/esprima.js on lines 253..256

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

                                                                                                                            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

                                                                                                                                        if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
                                                                                                                                            throwErrorTolerant({}, Messages.StrictLHSPrefix);
                                                                                                                                        }
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 45 mins to fix
                                                                                                                            assets/esprima.js on lines 2322..2324

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

                                                                                                                            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

                                                                                                                                            if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) {
                                                                                                                                                throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                                                                                                                                            }
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 40 mins to fix
                                                                                                                            assets/esprima.js on lines 550..552

                                                                                                                            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

                                                                                                                                        if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) {
                                                                                                                                            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                                                                                                                                        }
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 40 mins to fix
                                                                                                                            assets/esprima.js on lines 572..574

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

                                                                                                                                    if (ch1 === '<' && ch2 === '<' && ch3 === '=') {
                                                                                                                                        index += 3;
                                                                                                                                        return {
                                                                                                                                            type: Token.Punctuator,
                                                                                                                                            value: '<<=',
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 3 other locations - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 733..742
                                                                                                                            assets/esprima.js on lines 747..756
                                                                                                                            assets/esprima.js on lines 769..778

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

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

                                                                                                                                        if (ch4 === '=') {
                                                                                                                                            index += 4;
                                                                                                                                            return {
                                                                                                                                                type: Token.Punctuator,
                                                                                                                                                value: '>>>=',
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 3 other locations - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 747..756
                                                                                                                            assets/esprima.js on lines 758..767
                                                                                                                            assets/esprima.js on lines 769..778

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

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

                                                                                                                                    if (ch1 === '>' && ch2 === '>' && ch3 === '=') {
                                                                                                                                        index += 3;
                                                                                                                                        return {
                                                                                                                                            type: Token.Punctuator,
                                                                                                                                            value: '>>=',
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 3 other locations - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 733..742
                                                                                                                            assets/esprima.js on lines 747..756
                                                                                                                            assets/esprima.js on lines 758..767

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

                                                                                                                            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

                                                                                                                                    createForStatement: function (init, test, update, body) {
                                                                                                                                        return {
                                                                                                                                            type: Syntax.ForStatement,
                                                                                                                                            init: init,
                                                                                                                                            test: test,
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 1732..1740

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

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

                                                                                                                                    if (ch1 === '>' && ch2 === '>' && ch3 === '>') {
                                                                                                                                        index += 3;
                                                                                                                                        return {
                                                                                                                                            type: Token.Punctuator,
                                                                                                                                            value: '>>>',
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/esprima.js and 3 other locations - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 733..742
                                                                                                                            assets/esprima.js on lines 758..767
                                                                                                                            assets/esprima.js on lines 769..778

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

                                                                                                                            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

                                                                                                                                    createTryStatement: function (block, guardedHandlers, handlers, finalizer) {
                                                                                                                                        return {
                                                                                                                                            type: Syntax.TryStatement,
                                                                                                                                            block: block,
                                                                                                                                            guardedHandlers: guardedHandlers,
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 1562..1570

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

                                                                                                                            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

                                                                                                                                            } else if (extra.tokens[extra.openCurlyToken - 4] &&
                                                                                                                                                    extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {
                                                                                                                                                // Named function.
                                                                                                                                                checkToken = extra.tokens[extra.openCurlyToken - 5];
                                                                                                                                                if (!checkToken) {
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 1217..1233

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

                                                                                                                            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

                                                                                                                                            if (extra.tokens[extra.openCurlyToken - 3] &&
                                                                                                                                                    extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {
                                                                                                                                                // Anonymous function.
                                                                                                                                                checkToken = extra.tokens[extra.openCurlyToken - 4];
                                                                                                                                                if (!checkToken) {
                                                                                                                            Severity: Minor
                                                                                                                            Found in assets/esprima.js and 1 other location - About 35 mins to fix
                                                                                                                            assets/esprima.js on lines 1224..1233

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

                                                                                                                            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