packages/babel-parser/src/plugins/flow.js

Summary

Maintainability
F
3 wks
Test Coverage

File flow.js has 2874 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// @flow

/*:: declare var invariant; */

import type Parser from "../parser";
Severity: Major
Found in packages/babel-parser/src/plugins/flow.js - About 1 wk to fix

    Function flowParsePrimaryType has 160 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        flowParsePrimaryType(): N.FlowTypeAnnotation {
          const startPos = this.state.start;
          const startLoc = this.state.startLoc;
          const node = this.startNode();
          let tmp;
    Severity: Major
    Found in packages/babel-parser/src/plugins/flow.js - About 6 hrs to fix

      Function flowParseObjectType has 115 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          flowParseObjectType({
            allowStatic,
            allowExact,
            allowSpread,
            allowProto,
      Severity: Major
      Found in packages/babel-parser/src/plugins/flow.js - About 4 hrs to fix

        Function flowEnumMembers has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            flowEnumMembers({
              enumName,
              explicitType,
            }: {
              enumName: string,
        Severity: Major
        Found in packages/babel-parser/src/plugins/flow.js - About 3 hrs to fix

          Function flowEnumBody has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              flowEnumBody(node: N.Node, { enumName, nameLoc }): N.Node {
                const explicitType = this.flowEnumParseExplicitType({ enumName });
                this.expect(tt.braceL);
                const members = this.flowEnumMembers({ enumName, explicitType });
          
          
          Severity: Major
          Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

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

                parseImportSpecifier(node: N.ImportDeclaration): void {
                  const specifier = this.startNode();
                  const firstIdentLoc = this.state.start;
                  const firstIdent = this.parseIdentifier(true);
            
            
            Severity: Major
            Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

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

                  parseMaybeAssign(
                    noIn?: ?boolean,
                    refExpressionErrors?: ?ExpressionErrors,
                    afterLeftParse?: Function,
                    refNeedsArrowPos?: ?Pos,
              Severity: Major
              Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

                Function flowParseObjectTypeProperty has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    flowParseObjectTypeProperty(
                      node: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,
                      isStatic: boolean,
                      protoStart: ?number,
                      variance: ?N.FlowVariance,
                Severity: Major
                Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

                  Function flowParseDeclareModule has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule {
                        this.scope.enter(SCOPE_OTHER);
                  
                        if (this.match(tt.string)) {
                          node.id = this.parseExprAtom();
                  Severity: Major
                  Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

                    Function flowParseDeclareExportDeclaration has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        flowParseDeclareExportDeclaration(
                          node: N.FlowDeclareExportDeclaration,
                          insideModule: ?boolean,
                        ): N.FlowDeclareExportDeclaration {
                          this.expect(tt._export);
                    Severity: Major
                    Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

                      Function parseConditional has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          parseConditional(
                            expr: N.Expression,
                            noIn: ?boolean,
                            startPos: number,
                            startLoc: Position,
                      Severity: Minor
                      Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

                        Function parseSubscript has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            parseSubscript(
                              base: N.Expression,
                              startPos: number,
                              startLoc: Position,
                              noCalls: ?boolean,
                        Severity: Minor
                        Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                              flowParseInterfaceish(
                                node: N.FlowDeclare,
                                isClass?: boolean = false,
                              ): void {
                                node.id = this.flowParseRestrictedIdentifier(
                          Severity: Minor
                          Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                                parseSubscripts(
                                  base: N.Expression,
                                  startPos: number,
                                  startLoc: Position,
                                  noCalls?: ?boolean,
                            Severity: Minor
                            Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                                  isAssignable(node: N.Node, isBinding?: boolean): boolean {
                                    switch (node.type) {
                                      case "Identifier":
                                      case "ObjectPattern":
                                      case "ArrayPattern":
                              Severity: Minor
                              Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                                    flowEnumMemberInit(): EnumMemberInit {
                                      const startPos = this.state.start;
                                      const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);
                                      switch (this.state.type) {
                                        case tt.num: {
                                Severity: Minor
                                Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                                      parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {
                                        if (this.isContextual("type")) {
                                          node.exportKind = "type";
                                  
                                          const declarationNode = this.startNode();
                                  Severity: Minor
                                  Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                                        flowParseDeclareFunction(
                                          node: N.FlowDeclareFunction,
                                        ): N.FlowDeclareFunction {
                                          this.next();
                                    
                                    
                                    Severity: Minor
                                    Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                                          skipFlowComment(): number | boolean {
                                            const { pos } = this.state;
                                            let shiftToFirstNonWhiteSpace = 2;
                                            while (
                                              [charCodes.space, charCodes.tab].includes(
                                      Severity: Minor
                                      Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

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

                                            flowParseDeclare(
                                              node: N.FlowDeclare,
                                              insideModule?: boolean,
                                            ): N.FlowDeclare {
                                              if (this.match(tt._class)) {
                                        Severity: Minor
                                        Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

                                          Consider simplifying this complex logical expression.
                                          Open

                                                if (
                                                  (node.type === "ImportDeclaration" &&
                                                    (node.importKind === "type" || node.importKind === "typeof")) ||
                                                  (node.type === "ExportNamedDeclaration" &&
                                                    node.exportKind === "type") ||
                                          Severity: Major
                                          Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                        if (
                                                          lookahead.type === tt.name ||
                                                          lookahead.type === tt.string ||
                                                          lookahead.type === tt.num
                                                        ) {
                                            Severity: Major
                                            Found in packages/babel-parser/src/plugins/flow.js - About 45 mins to fix

                                              Consider simplifying this complex logical expression.
                                              Open

                                                    if (
                                                      this.match(tt.name) &&
                                                      (this.state.value === "type" ||
                                                        this.state.value === "interface" ||
                                                        this.state.value === "opaque" ||
                                              Severity: Major
                                              Found in packages/babel-parser/src/plugins/flow.js - About 40 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                      return super.parseExpressionStatement(node, expr);
                                                Severity: Major
                                                Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                              return empty();
                                                  Severity: Major
                                                  Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                return this.finishNode(node, "EnumNumberBody");
                                                    Severity: Major
                                                    Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                              return this.flowParseDeclareExportDeclaration(node, insideModule);
                                                      Severity: Major
                                                      Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                  return this.finishNode(node, "FunctionTypeAnnotation");
                                                        Severity: Major
                                                        Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return this.flowParseEnumDeclaration(declarationNode);
                                                          Severity: Major
                                                          Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                    return this.flowParseDeclareTypeAlias(node);
                                                            Severity: Major
                                                            Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                            return this.parseLiteral(
                                                                              -this.state.value,
                                                                              "BigIntLiteralTypeAnnotation",
                                                                              node.start,
                                                                              node.loc.start,
                                                              Severity: Major
                                                              Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                            return this.finishNode(node, "EnumStringBody");
                                                                Severity: Major
                                                                Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                                return this.parseLiteral(
                                                                                  -this.state.value,
                                                                                  "NumberLiteralTypeAnnotation",
                                                                                  node.start,
                                                                                  node.loc.start,
                                                                  Severity: Major
                                                                  Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                              return this.finishNode(node, "NullLiteralTypeAnnotation");
                                                                    Severity: Major
                                                                    Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                                  return super.createIdentifier(node, label);
                                                                      Severity: Major
                                                                      Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                  return this.finishNode(node, "VoidTypeAnnotation");
                                                                        Severity: Major
                                                                        Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                  return this.flowParseDeclareOpaqueType(node);
                                                                          Severity: Major
                                                                          Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                    return this.flowParseDeclareInterface(node);
                                                                            Severity: Major
                                                                            Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                        return this.finishNode(node, "ExistsTypeAnnotation");
                                                                              Severity: Major
                                                                              Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                            return {
                                                                                              type: "boolean",
                                                                                              pos: literal.start,
                                                                                              value: literal,
                                                                                            };
                                                                                Severity: Major
                                                                                Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                              return empty();
                                                                                  Severity: Major
                                                                                  Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                              return { type: "invalid", pos: startPos };
                                                                                    Severity: Major
                                                                                    Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                return this.finishNode(node, "ThisTypeAnnotation");
                                                                                      Severity: Major
                                                                                      Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

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

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                      return this.flowParseTypeofType();
                                                                                          Severity: Major
                                                                                          Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                    return super.parseExportDeclaration(node);
                                                                                            Severity: Major
                                                                                            Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                        return this.finishNode(node, "BooleanLiteralTypeAnnotation");
                                                                                              Severity: Major
                                                                                              Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                      return super.parseSubscripts(base, startPos, startLoc, noCalls);
                                                                                                Severity: Major
                                                                                                Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                            return this.flowParseDeclareModule(node);
                                                                                                  Severity: Major
                                                                                                  Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                          return super.parseMaybeAssign(
                                                                                                            noIn,
                                                                                                            refExpressionErrors,
                                                                                                            afterLeftParse,
                                                                                                            refNeedsArrowPos,
                                                                                                    Severity: Major
                                                                                                    Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                                  return this.finishNode(node, "EnumBooleanBody");
                                                                                                      Severity: Major
                                                                                                      Found in packages/babel-parser/src/plugins/flow.js - About 30 mins to fix

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

                                                                                                            flowParseUnionType(): N.FlowTypeAnnotation {
                                                                                                              const node = this.startNode();
                                                                                                              this.eat(tt.bitwiseOR);
                                                                                                              const type = this.flowParseIntersectionType();
                                                                                                              node.types = [type];
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 5 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1588..1599

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

                                                                                                        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

                                                                                                            flowParseIntersectionType(): N.FlowTypeAnnotation {
                                                                                                              const node = this.startNode();
                                                                                                              this.eat(tt.bitwiseAND);
                                                                                                              const type = this.flowParseAnonFunctionWithoutParens();
                                                                                                              node.types = [type];
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 5 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1601..1612

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                  } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
                                                                                                                    for (const member of members.defaultedMembers) {
                                                                                                                      this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
                                                                                                                        enumName,
                                                                                                                        memberName: member.id.name,
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 3 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3430..3443

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                  } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
                                                                                                                    for (const member of members.defaultedMembers) {
                                                                                                                      this.flowEnumErrorNumberMemberNotInitialized(member.start, {
                                                                                                                        enumName,
                                                                                                                        memberName: member.id.name,
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 3 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3420..3443

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

                                                                                                        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

                                                                                                            typeCastToParameter(node: N.Node): N.Node {
                                                                                                              node.expression.typeAnnotation = node.typeAnnotation;
                                                                                                        
                                                                                                              this.resetEndLocation(
                                                                                                                node.expression,
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 2 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 2604..2614

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 92.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              if (this.eat(tt.question)) {
                                                                                                                if (param.type !== "Identifier") {
                                                                                                                  this.raise(param.start, FlowErrors.OptionalBindingPattern);
                                                                                                                }
                                                                                                        
                                                                                                        
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 2 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 2450..2456

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

                                                                                                        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 tt.string: {
                                                                                                                  const literal = this.parseLiteral(this.state.value, "StringLiteral");
                                                                                                                  if (endOfInit()) {
                                                                                                                    return { type: "string", pos: literal.start, value: literal };
                                                                                                                  }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 2 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3153..3159

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 82.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                case tt.num: {
                                                                                                                  const literal = this.parseLiteral(this.state.value, "NumericLiteral");
                                                                                                                  if (endOfInit()) {
                                                                                                                    return { type: "number", pos: literal.start, value: literal };
                                                                                                                  }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 2 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3160..3166

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 82.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if (context[context.length - 1] === tc.j_oTag) {
                                                                                                                  context.length -= 2;
                                                                                                                } else if (context[context.length - 1] === tc.j_expr) {
                                                                                                                  context.length -= 1;
                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 2 hrs to fix
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 2339..2343

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              while (!this.isRelational(">")) {
                                                                                                                node.params.push(this.flowParseType());
                                                                                                                if (!this.isRelational(">")) {
                                                                                                                  this.expect(tt.comma);
                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 807..812

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              while (!this.isRelational(">")) {
                                                                                                                node.params.push(this.flowParseTypeOrImplicitInstantiation());
                                                                                                                if (!this.isRelational(">")) {
                                                                                                                  this.expect(tt.comma);
                                                                                                                }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 785..790

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

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              if (
                                                                                                                node.type === "AssignmentPattern" &&
                                                                                                                node.typeAnnotation &&
                                                                                                                node.right.start < node.typeAnnotation.start
                                                                                                              ) {
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 2560..2569

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

                                                                                                        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.isContextual("implements")) {
                                                                                                                this.next();
                                                                                                                do {
                                                                                                                  node.implements.push(this.flowParseInterfaceExtends());
                                                                                                                } while (this.eat(tt.comma));
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 593..598

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 66.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              if (this.isContextual("mixins")) {
                                                                                                                this.next();
                                                                                                                do {
                                                                                                                  node.mixins.push(this.flowParseInterfaceExtends());
                                                                                                                } while (this.eat(tt.comma));
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 600..605

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 66.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            flowEnumErrorDuplicateMemberName(
                                                                                                              pos: number,
                                                                                                              { enumName, memberName }: { enumName: string, memberName: string },
                                                                                                            ): void {
                                                                                                              this.raise(pos, FlowErrors.EnumDuplicateMemberName, memberName, enumName);
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3126..3136

                                                                                                        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

                                                                                                            flowEnumErrorNumberMemberNotInitialized(
                                                                                                              pos: number,
                                                                                                              { enumName, memberName }: { enumName: string, memberName: string },
                                                                                                            ): void {
                                                                                                              this.raise(
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3074..3079

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

                                                                                                                  case "boolean": {
                                                                                                                    this.flowEnumCheckExplicitTypeMismatch(
                                                                                                                      init.pos,
                                                                                                                      context,
                                                                                                                      "boolean",
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3261..3268
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3269..3276

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

                                                                                                        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

                                                                                                                  case "number": {
                                                                                                                    this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
                                                                                                                    memberNode.init = init.value;
                                                                                                                    members.numberMembers.push(
                                                                                                                      this.finishNode(memberNode, "EnumNumberMember"),
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3249..3260
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3269..3276

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

                                                                                                        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

                                                                                                                  case "string": {
                                                                                                                    this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
                                                                                                                    memberNode.init = init.value;
                                                                                                                    members.stringMembers.push(
                                                                                                                      this.finishNode(memberNode, "EnumStringMember"),
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3249..3260
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3261..3268

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

                                                                                                        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

                                                                                                                    this.match(tt._class) ||
                                                                                                                    this.match(tt.name) ||
                                                                                                                    this.match(tt._function) ||
                                                                                                                    this.match(tt._var) ||
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1101..1104
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 946..949

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

                                                                                                        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

                                                                                                                  this.match(tt.comma) ||
                                                                                                                  this.match(tt.semi) ||
                                                                                                                  this.match(tt.braceR) ||
                                                                                                                  this.match(tt.braceBarR);
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1757..1760
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 946..949

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

                                                                                                        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.match(tt.string)) {
                                                                                                                node.id = this.parseExprAtom();
                                                                                                              } else {
                                                                                                                node.id = this.parseIdentifier();
                                                                                                              }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/jsx/index.js on lines 341..345

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

                                                                                                        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 "boolean":
                                                                                                                  node.explicitType = true;
                                                                                                                  node.members = members.booleanMembers;
                                                                                                                  this.expect(tt.braceR);
                                                                                                                  return this.finishNode(node, "EnumBooleanBody");
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3378..3382

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 57.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                case "number":
                                                                                                                  node.explicitType = true;
                                                                                                                  node.members = members.numberMembers;
                                                                                                                  this.expect(tt.braceR);
                                                                                                                  return this.finishNode(node, "EnumNumberBody");
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3373..3377

                                                                                                        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 (length !== paramCount) {
                                                                                                                if (property.kind === "get") {
                                                                                                                  this.raise(start, Errors.BadGetterArity);
                                                                                                                } else {
                                                                                                                  this.raise(start, Errors.BadSetterArity);
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 1 hr to fix
                                                                                                        packages/babel-parser/src/parser/expression.js on lines 1688..1694
                                                                                                        packages/babel-parser/src/plugins/estree.js on lines 102..113

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 55.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if (this.match(tt.num)) {
                                                                                                                      return this.parseLiteral(
                                                                                                                        -this.state.value,
                                                                                                                        "NumberLiteralTypeAnnotation",
                                                                                                                        node.start,
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1493..1500

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 55.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                    if (this.match(tt.bigint)) {
                                                                                                                      return this.parseLiteral(
                                                                                                                        -this.state.value,
                                                                                                                        "BigIntLiteralTypeAnnotation",
                                                                                                                        node.start,
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1484..1491

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 55.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            flowEnumErrorStringMemberInconsistentlyInitailized(
                                                                                                              pos: number,
                                                                                                              { enumName }: { enumName: string },
                                                                                                            ): void {
                                                                                                              this.raise(
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 55 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3081..3086

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

                                                                                                        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

                                                                                                            flowEnumErrorInconsistentMemberValues(
                                                                                                              pos: number,
                                                                                                              { enumName }: { enumName: string },
                                                                                                            ): void {
                                                                                                              this.raise(pos, FlowErrors.EnumInconsistentMemberValues, enumName);
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 55 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 3138..3147

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

                                                                                                        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

                                                                                                            parseClassPrivateProperty(
                                                                                                              node: N.ClassPrivateProperty,
                                                                                                            ): N.ClassPrivateProperty {
                                                                                                              if (this.match(tt.colon)) {
                                                                                                                node.typeAnnotation = this.flowParseTypeAnnotation();
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 50 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2246..2251

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 52.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                            parseClassProperty(node: N.ClassProperty): N.ClassProperty {
                                                                                                              if (this.match(tt.colon)) {
                                                                                                                node.typeAnnotation = this.flowParseTypeAnnotation();
                                                                                                              }
                                                                                                              return super.parseClassProperty(node);
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 50 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2253..2260

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 52.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                !this.eat(tt.semi) &&
                                                                                                                !this.eat(tt.comma) &&
                                                                                                                !this.match(tt.braceR) &&
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 50 mins to fix
                                                                                                        packages/babel-parser/src/parser/expression.js on lines 913..915

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 51.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              } else if (this.isContextual("interface")) {
                                                                                                                node.exportKind = "type";
                                                                                                                const declarationNode = this.startNode();
                                                                                                                this.next();
                                                                                                                return this.flowParseInterface(declarationNode);
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 45 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2052..2059

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 50.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              } else if (this.shouldParseEnums() && this.isContextual("enum")) {
                                                                                                                node.exportKind = "value";
                                                                                                                const declarationNode = this.startNode();
                                                                                                                this.next();
                                                                                                                return this.flowParseEnumDeclaration(declarationNode);
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 45 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2047..2059

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 50.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                              if (this.eat(tt.question)) {
                                                                                                                node.optional = true;
                                                                                                                // Include questionmark in location of node
                                                                                                                // Don't use this.finishNode() as otherwise we might process comments twice and
                                                                                                                // include already consumed parens
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 40 mins to fix
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 2119..2125

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 49.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                if (!result.node) {
                                                                                                                  // $FlowIgnore
                                                                                                                  refNeedsArrowPos.start = result.error.pos || this.state.start;
                                                                                                                  return expr;
                                                                                                                }
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 40 mins to fix
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 2102..2106

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 49.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                  if (this.isRelational("<")) {
                                                                                                                    node.typeParameters = this.flowParseTypeParameterInstantiation();
                                                                                                                  } else {
                                                                                                                    node.typeParameters = null;
                                                                                                                  }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 4 other locations - About 40 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 297..301
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 577..581
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 620..624
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 669..673

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

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

                                                                                                              if (this.isRelational("<")) {
                                                                                                                node.typeParameters = this.flowParseTypeParameterDeclaration();
                                                                                                              } else {
                                                                                                                node.typeParameters = null;
                                                                                                              }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 4 other locations - About 40 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 297..301
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 577..581
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 620..624
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2332..2336

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

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

                                                                                                              if (this.isRelational("<")) {
                                                                                                                node.typeParameters = this.flowParseTypeParameterDeclaration();
                                                                                                              } else {
                                                                                                                node.typeParameters = null;
                                                                                                              }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 4 other locations - About 40 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 297..301
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 620..624
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 669..673
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2332..2336

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

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

                                                                                                              if (this.isRelational("<")) {
                                                                                                                node.typeParameters = this.flowParseTypeParameterInstantiation();
                                                                                                              } else {
                                                                                                                node.typeParameters = null;
                                                                                                              }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 4 other locations - About 40 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 297..301
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 577..581
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 669..673
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2332..2336

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

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

                                                                                                              if (this.isRelational("<")) {
                                                                                                                typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
                                                                                                              } else {
                                                                                                                typeNode.typeParameters = null;
                                                                                                              }
                                                                                                        Severity: Major
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 4 other locations - About 40 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 577..581
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 620..624
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 669..673
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2332..2336

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

                                                                                                        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 ((prop: $FlowFixMe).variance) {
                                                                                                                this.unexpected((prop: $FlowFixMe).variance.start);
                                                                                                              }
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 35 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2285..2287
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2309..2311

                                                                                                        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 ((method: $FlowFixMe).variance) {
                                                                                                                this.unexpected((method: $FlowFixMe).variance.start);
                                                                                                              }
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 35 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2285..2287
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2364..2366

                                                                                                        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

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

                                                                                                            checkLVal(
                                                                                                              expr: N.Expression,
                                                                                                              bindingType: BindingTypes = BIND_NONE,
                                                                                                              checkClashes: ?{ [key: string]: boolean },
                                                                                                              contextDescription: string,
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 35 mins to fix
                                                                                                        packages/babel-parser/src/plugins/typescript/index.js on lines 2480..2514

                                                                                                        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 ((method: $FlowFixMe).variance) {
                                                                                                                this.unexpected((method: $FlowFixMe).variance.start);
                                                                                                              }
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 2 other locations - About 35 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2309..2311
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 2364..2366

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 46.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                case tt.braceBarL:
                                                                                                                  return this.flowParseObjectType({
                                                                                                                    allowStatic: false,
                                                                                                                    allowExact: true,
                                                                                                                    allowSpread: true,
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 30 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1373..1380

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 45.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                      lookahead.type === tt.name ||
                                                                                                                      lookahead.type === tt.string ||
                                                                                                                      lookahead.type === tt.num
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 30 mins to fix
                                                                                                        packages/babel-core/src/config/config-descriptors.js on lines 49..51

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 45.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

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

                                                                                                                case tt.braceL:
                                                                                                                  return this.flowParseObjectType({
                                                                                                                    allowStatic: false,
                                                                                                                    allowExact: false,
                                                                                                                    allowSpread: true,
                                                                                                        Severity: Minor
                                                                                                        Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 30 mins to fix
                                                                                                        packages/babel-parser/src/plugins/flow.js on lines 1382..1389

                                                                                                        Duplicated Code

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

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

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

                                                                                                        Tuning

                                                                                                        This issue has a mass of 45.

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

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

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

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

                                                                                                        Refactorings

                                                                                                        Further Reading

                                                                                                        There are no issues that match your filters.

                                                                                                        Category
                                                                                                        Status