packages/babel-parser/src/tokenizer/index.js

Summary

Maintainability
F
2 wks
Test Coverage

File index.js has 1242 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// @flow

/*:: declare var invariant; */

import type { Options } from "../options";
Severity: Major
Found in packages/babel-parser/src/tokenizer/index.js - About 3 days to fix

    Function getTokenFromCode has 162 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getTokenFromCode(code: number): void {
        switch (code) {
          // The interpretation of a dot depends on whether it is followed
          // by a digit or another two dots.
    
    
    Severity: Major
    Found in packages/babel-parser/src/tokenizer/index.js - About 6 hrs to fix

      Function readInt has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

        readInt(
          radix: number,
          len?: number,
          forceLen?: boolean,
          allowNumSeparator: boolean = true,
      Severity: Minor
      Found in packages/babel-parser/src/tokenizer/index.js - About 6 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Tokenizer has 45 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default class Tokenizer extends ParserErrors {
        // Forward-declarations
        // parser/util.js
        /*::
        +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty;
      Severity: Minor
      Found in packages/babel-parser/src/tokenizer/index.js - About 6 hrs to fix

        Function readTmplToken has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

          readTmplToken(): void {
            let out = "",
              chunkStart = this.state.pos,
              containsInvalid = false;
            for (;;) {
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function readNumber has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

          readNumber(startsWithDot: boolean): void {
            const start = this.state.pos;
            let isFloat = false;
            let isBigInt = false;
            let isNonOctalDecimalInt = false;
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function getTokenFromCode has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
        Open

          getTokenFromCode(code: number): void {
            switch (code) {
              // The interpretation of a dot depends on whether it is followed
              // by a digit or another two dots.
        
        
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function readEscapedChar has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

          readEscapedChar(inTemplate: boolean): string | null {
            const throwOnInvalid = !inTemplate;
            const ch = this.input.charCodeAt(++this.state.pos);
            ++this.state.pos;
            switch (ch) {
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

          readRegexp(): void {
            const start = this.state.pos;
            let escaped, inClass;
            for (;;) {
              if (this.state.pos >= this.length) {
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

          readWord1(): string {
            let word = "";
            this.state.containsEsc = false;
            const start = this.state.pos;
            let chunkStart = this.state.pos;
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function readToken_pipe_amp has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

          readToken_pipe_amp(code: number): void {
            // '||' '&&' '||=' '&&='
            const next = this.input.charCodeAt(this.state.pos + 1);
        
            if (next === code) {
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function readEscapedChar has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          readEscapedChar(inTemplate: boolean): string | null {
            const throwOnInvalid = !inTemplate;
            const ch = this.input.charCodeAt(++this.state.pos);
            ++this.state.pos;
            switch (ch) {
        Severity: Major
        Found in packages/babel-parser/src/tokenizer/index.js - About 2 hrs to fix

          Function readInt has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            readInt(
              radix: number,
              len?: number,
              forceLen?: boolean,
              allowNumSeparator: boolean = true,
          Severity: Major
          Found in packages/babel-parser/src/tokenizer/index.js - About 2 hrs to fix

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

              readNumber(startsWithDot: boolean): void {
                const start = this.state.pos;
                let isFloat = false;
                let isBigInt = false;
                let isNonOctalDecimalInt = false;
            Severity: Major
            Found in packages/babel-parser/src/tokenizer/index.js - About 2 hrs to fix

              Function readTmplToken has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                readTmplToken(): void {
                  let out = "",
                    chunkStart = this.state.pos,
                    containsInvalid = false;
                  for (;;) {
              Severity: Major
              Found in packages/babel-parser/src/tokenizer/index.js - About 2 hrs to fix

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

                  readToken_pipe_amp(code: number): void {
                    // '||' '&&' '||=' '&&='
                    const next = this.input.charCodeAt(this.state.pos + 1);
                
                    if (next === code) {
                Severity: Major
                Found in packages/babel-parser/src/tokenizer/index.js - About 2 hrs to fix

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

                    readRegexp(): void {
                      const start = this.state.pos;
                      let escaped, inClass;
                      for (;;) {
                        if (this.state.pos >= this.length) {
                  Severity: Minor
                  Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                    Function skipSpace has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                      skipSpace(): void {
                        loop: while (this.state.pos < this.length) {
                          const ch = this.input.charCodeAt(this.state.pos);
                          switch (ch) {
                            case charCodes.space:
                    Severity: Minor
                    Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                      readToken_numberSign(): void {
                        if (this.state.pos === 0 && this.readToken_interpreter()) {
                          return;
                        }
                    
                    
                    Severity: Minor
                    Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function braceIsBlock has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      braceIsBlock(prevType: TokenType): boolean {
                        const parent = this.curContext();
                        if (parent === ct.functionExpression || parent === ct.functionStatement) {
                          return true;
                        }
                    Severity: Minor
                    Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                      Function skipSpace has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        skipSpace(): void {
                          loop: while (this.state.pos < this.length) {
                            const ch = this.input.charCodeAt(this.state.pos);
                            switch (ch) {
                              case charCodes.space:
                      Severity: Minor
                      Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

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

                          braceIsBlock(prevType: TokenType): boolean {
                            const parent = this.curContext();
                            if (parent === ct.functionExpression || parent === ct.functionStatement) {
                              return true;
                            }
                        Severity: Minor
                        Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                          readWord1(): string {
                            let word = "";
                            this.state.containsEsc = false;
                            const start = this.state.pos;
                            let chunkStart = this.state.pos;
                        Severity: Minor
                        Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

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

                            readString(quote: number): void {
                              let out = "",
                                chunkStart = ++this.state.pos;
                              for (;;) {
                                if (this.state.pos >= this.length) {
                          Severity: Minor
                          Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

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

                            readToken_lt_gt(code: number): void {
                              // '<>'
                              const next = this.input.charCodeAt(this.state.pos + 1);
                              let size = 1;
                          
                          
                          Severity: Minor
                          Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

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

                              readToken_numberSign(): void {
                                if (this.state.pos === 0 && this.readToken_interpreter()) {
                                  return;
                                }
                            
                            
                            Severity: Minor
                            Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

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

                                readString(quote: number): void {
                                  let out = "",
                                    chunkStart = ++this.state.pos;
                                  for (;;) {
                                    if (this.state.pos >= this.length) {
                              Severity: Minor
                              Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                                Function readCodePoint has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  readCodePoint(throwOnInvalid: boolean): number | null {
                                    const ch = this.input.charCodeAt(this.state.pos);
                                    let code;
                                
                                    if (ch === charCodes.leftCurlyBrace) {
                                Severity: Minor
                                Found in packages/babel-parser/src/tokenizer/index.js - About 55 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Avoid deeply nested control flow statements.
                                Open

                                            if (this.input.charCodeAt(this.state.pos) === charCodes.lineFeed) {
                                              ++this.state.pos;
                                            }
                                Severity: Major
                                Found in packages/babel-parser/src/tokenizer/index.js - About 45 mins to fix

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

                                    readToken_lt_gt(code: number): void {
                                      // '<>'
                                      const next = this.input.charCodeAt(this.state.pos + 1);
                                      let size = 1;
                                  
                                  
                                  Severity: Minor
                                  Found in packages/babel-parser/src/tokenizer/index.js - About 45 mins to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Avoid too many return statements within this function.
                                  Open

                                          return;
                                  Severity: Major
                                  Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                              return;
                                    Severity: Major
                                    Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return;
                                      Severity: Major
                                      Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                return;
                                        Severity: Major
                                        Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return;
                                          Severity: Major
                                          Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return;
                                            Severity: Major
                                            Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                      return;
                                              Severity: Major
                                              Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                        return;
                                                Severity: Major
                                                Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                          return;
                                                  Severity: Major
                                                  Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                              return;
                                                    Severity: Major
                                                    Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return;
                                                      Severity: Major
                                                      Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                  return;
                                                        Severity: Major
                                                        Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return;
                                                          Severity: Major
                                                          Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                    return;
                                                            Severity: Major
                                                            Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                      return;
                                                              Severity: Major
                                                              Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                        return;
                                                                Severity: Major
                                                                Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                        return;
                                                                  Severity: Major
                                                                  Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                            return;
                                                                    Severity: Major
                                                                    Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                              return;
                                                                      Severity: Major
                                                                      Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                return String.fromCharCode(ch);
                                                                        Severity: Major
                                                                        Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                  return;
                                                                          Severity: Major
                                                                          Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                  return false;
                                                                            Severity: Major
                                                                            Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                      return;
                                                                              Severity: Major
                                                                              Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                      return parent === ct.braceStatement;
                                                                                Severity: Major
                                                                                Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                          return;
                                                                                  Severity: Major
                                                                                  Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                            return;
                                                                                    Severity: Major
                                                                                    Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                return;
                                                                                      Severity: Major
                                                                                      Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                return;
                                                                                        Severity: Major
                                                                                        Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                    return String.fromCharCode(octal);
                                                                                          Severity: Major
                                                                                          Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                  return true;
                                                                                            Severity: Major
                                                                                            Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                  return !this.state.exprAllowed;
                                                                                              Severity: Major
                                                                                              Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                        return;
                                                                                                Severity: Major
                                                                                                Found in packages/babel-parser/src/tokenizer/index.js - About 30 mins to fix

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

                                                                                                    readToken_plus_min(code: number): void {
                                                                                                      // '+-'
                                                                                                      const next = this.input.charCodeAt(this.state.pos + 1);
                                                                                                  
                                                                                                      if (next === code) {
                                                                                                  Severity: Minor
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js - About 25 mins to fix

                                                                                                  Cognitive Complexity

                                                                                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                                                  A method's cognitive complexity is based on a few simple rules:

                                                                                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                                                  • Code is considered more complex for each "break in the linear flow of the code"
                                                                                                  • Code is considered more complex when "flow breaking structures are nested"

                                                                                                  Further reading

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

                                                                                                    readToken_question(): void {
                                                                                                      // '?'
                                                                                                      const next = this.input.charCodeAt(this.state.pos + 1);
                                                                                                      const next2 = this.input.charCodeAt(this.state.pos + 2);
                                                                                                      if (next === charCodes.questionMark && !this.state.inType) {
                                                                                                  Severity: Minor
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js - About 25 mins to fix

                                                                                                  Cognitive Complexity

                                                                                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                                                  A method's cognitive complexity is based on a few simple rules:

                                                                                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                                                  • Code is considered more complex for each "break in the linear flow of the code"
                                                                                                  • Code is considered more complex when "flow breaking structures are nested"

                                                                                                  Further reading

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

                                                                                                        case charCodes.leftSquareBracket:
                                                                                                          if (
                                                                                                            this.hasPlugin("recordAndTuple") &&
                                                                                                            this.input.charCodeAt(this.state.pos + 1) === charCodes.verticalBar
                                                                                                          ) {
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 6 hrs to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 765..784

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

                                                                                                  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 charCodes.leftCurlyBrace:
                                                                                                          if (
                                                                                                            this.hasPlugin("recordAndTuple") &&
                                                                                                            this.input.charCodeAt(this.state.pos + 1) === charCodes.verticalBar
                                                                                                          ) {
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 6 hrs to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 741..760

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

                                                                                                  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 (
                                                                                                          this.hasPlugin("recordAndTuple") &&
                                                                                                          next === charCodes.rightSquareBracket
                                                                                                        ) {
                                                                                                          if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 544..557

                                                                                                  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

                                                                                                        if (
                                                                                                          this.hasPlugin("recordAndTuple") &&
                                                                                                          next === charCodes.rightCurlyBrace
                                                                                                        ) {
                                                                                                          if (this.getPluginOption("recordAndTuple", "syntaxType") !== "bar") {
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 560..573

                                                                                                  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

                                                                                                        while (!isNewLine(ch) && ++this.state.pos < this.length) {
                                                                                                          ch = this.input.charCodeAt(this.state.pos);
                                                                                                        }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 488..490

                                                                                                  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

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

                                                                                                      while (!isNewLine(ch) && ++this.state.pos < this.length) {
                                                                                                        ch = this.input.charCodeAt(this.state.pos);
                                                                                                      }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 306..308

                                                                                                  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

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

                                                                                                            case charCodes.carriageReturn:
                                                                                                              if (this.input.charCodeAt(this.state.pos) === charCodes.lineFeed) {
                                                                                                                ++this.state.pos;
                                                                                                              }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 1347..1350

                                                                                                  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

                                                                                                        case charCodes.carriageReturn:
                                                                                                          if (this.input.charCodeAt(this.state.pos) === charCodes.lineFeed) {
                                                                                                            ++this.state.pos;
                                                                                                          }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 1299..1302

                                                                                                  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

                                                                                                        prevType === tt._else ||
                                                                                                        prevType === tt.semi ||
                                                                                                        prevType === tt.eof ||
                                                                                                        prevType === tt.parenR ||
                                                                                                        prevType === tt.arrow
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                                                                                                  eslint/babel-eslint-parser/src/convert/convertTokens.js on lines 101..105

                                                                                                  Duplicated Code

                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                  Tuning

                                                                                                  This issue has a mass of 57.

                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                  Refactorings

                                                                                                  Further Reading

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

                                                                                                      if (next === charCodes.equalsTo) {
                                                                                                        this.finishOp(tt.assign, 2);
                                                                                                      } else {
                                                                                                        this.finishOp(tt.slash, 1);
                                                                                                      }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 2 other locations - About 50 mins to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 590..594
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 621..625

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

                                                                                                      if (next === charCodes.equalsTo) {
                                                                                                        this.finishOp(tt.assign, 2);
                                                                                                      } else {
                                                                                                        this.finishOp(tt.plusMin, 1);
                                                                                                      }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 2 other locations - About 50 mins to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 472..476
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 590..594

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

                                                                                                      if (next === charCodes.equalsTo) {
                                                                                                        this.finishOp(tt.assign, 2);
                                                                                                      } else {
                                                                                                        this.finishOp(tt.bitwiseXOR, 1);
                                                                                                      }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 2 other locations - About 50 mins to fix
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 472..476
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 621..625

                                                                                                  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

                                                                                                        if (this.state.pos >= this.length) {
                                                                                                          throw this.raise(this.state.start, Errors.UnterminatedTemplate);
                                                                                                        }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 3 other locations - About 35 mins to fix
                                                                                                  packages/babel-parser/src/plugins/jsx/index.js on lines 98..100
                                                                                                  packages/babel-parser/src/plugins/jsx/index.js on lines 158..160
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 1227..1229

                                                                                                  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 (this.state.pos >= this.length) {
                                                                                                          throw this.raise(this.state.start, Errors.UnterminatedString);
                                                                                                        }
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 3 other locations - About 35 mins to fix
                                                                                                  packages/babel-parser/src/plugins/jsx/index.js on lines 98..100
                                                                                                  packages/babel-parser/src/plugins/jsx/index.js on lines 158..160
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 1261..1263

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

                                                                                                          code === charCodes.greaterThan &&
                                                                                                          this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan
                                                                                                            ? 3
                                                                                                            : 2;
                                                                                                  Severity: Minor
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 2 other locations - About 35 mins to fix
                                                                                                  packages/babel-parser/src/plugins/placeholders.js on lines 85..90
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 451..460

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

                                                                                                      if (
                                                                                                        next === charCodes.dot &&
                                                                                                        this.input.charCodeAt(this.state.pos + 2) === charCodes.dot
                                                                                                      ) {
                                                                                                        this.state.pos += 3;
                                                                                                  Severity: Minor
                                                                                                  Found in packages/babel-parser/src/tokenizer/index.js and 2 other locations - About 35 mins to fix
                                                                                                  packages/babel-parser/src/plugins/placeholders.js on lines 85..90
                                                                                                  packages/babel-parser/src/tokenizer/index.js on lines 635..638

                                                                                                  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