Showing 1,982 of 1,982 total issues

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

  parseMaybeUnary(refExpressionErrors: ?ExpressionErrors): N.Expression {
    if (this.isContextual("await") && this.isAwaitAllowed()) {
      return this.parseAwait();
    } else if (this.state.type.prefix) {
      const node = this.startNode();
Severity: Minor
Found in packages/babel-parser/src/parser/expression.js - About 1 hr to fix

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

    export function isTSType(node: ?Object, opts?: Object): boolean {
      if (!node) return false;
    
      const nodeType = node.type;
      if (
    Severity: Minor
    Found in packages/babel-types/src/validators/generated/index.js - About 1 hr to fix

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

          pushObjectPattern(pattern, objRef) {
            // https://github.com/babel/babel/issues/681
      
            if (!pattern.properties.length) {
              this.nodes.push(
      Severity: Minor
      Found in packages/babel-plugin-transform-destructuring/src/index.js - About 1 hr to fix

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

          function buildJSXFragmentCall(path, file) {
            const openingPath = path.get("openingElement");
            openingPath.parent.children = t.react.buildChildren(openingPath.parent);
        
            const args = [];
        Severity: Minor
        Found in packages/babel-helper-builder-react-jsx-experimental/src/index.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 parseCallExpressionArguments has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              parseCallExpressionArguments(
                close: TokenType,
                possibleAsyncArrow: boolean,
                dynamicImport?: boolean,
                allowPlaceholder?: boolean,
            Severity: Minor
            Found in packages/babel-parser/src/parser/expression.js - About 1 hr to fix

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

              export function buildDecoratedClass(ref, path, elements, file) {
                const { node, scope } = path;
                const initializeId = scope.generateUidIdentifier("initialize");
                const isDeclaration = node.id && path.isDeclaration();
                const isStrict = path.isInStrictMode();

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

                export function generateRegexpuOptions(node, features) {
                  let useUnicodeFlag = false,
                    dotAllFlag = false,
                    unicodePropertyEscape = false,
                    namedGroup = false;
                Severity: Minor
                Found in packages/babel-helper-create-regexp-features-plugin/src/util.js - About 1 hr to fix

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

                    async function write(
                      src: string,
                      base: string,
                    ): Promise<$Keys<typeof FILE_TYPE>> {
                      let relative = path.relative(base, src);
                  Severity: Minor
                  Found in packages/babel-cli/src/babel/dir.js - About 1 hr to fix

                    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

                          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

                        if (isTSUnionType(node)) {
                          if (typeGroups.indexOf(node.types) < 0) {
                            nodes = nodes.concat(node.types);
                            typeGroups.push(node.types);
                          }
                    packages/babel-types/src/modifications/flow/removeTypeDuplicates.js on lines 42..48

                    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/typescript/index.js and 1 other location - About 1 hr to fix
                    packages/babel-parser/src/plugins/flow.js on lines 2416..2422

                    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

                      try {
                        yield* transformFile(file, config.passes);
                      } catch (e) {
                        e.message = `${opts.filename ?? "unknown"}: ${e.message}`;
                        if (!e.code) {
                    Severity: Major
                    Found in packages/babel-core/src/transformation/index.js and 1 other location - About 1 hr to fix
                    packages/babel-core/src/transformation/index.js on lines 53..63

                    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

                      try {
                        if (opts.code !== false) {
                          ({ outputCode, outputMap } = generateCode(config.passes, file));
                        }
                      } catch (e) {
                    Severity: Major
                    Found in packages/babel-core/src/transformation/index.js and 1 other location - About 1 hr to fix
                    packages/babel-core/src/transformation/index.js on lines 42..50

                    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 (isUnionTypeAnnotation(node)) {
                          if (typeGroups.indexOf(node.types) < 0) {
                            nodes = nodes.concat(node.types);
                            typeGroups.push(node.types);
                          }
                    packages/babel-types/src/modifications/typescript/removeTypeDuplicates.js on lines 41..47

                    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

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

                        exit(path) {
                          const { node } = path;
                    
                          // Used internally by @babel/parser.
                          if (node.extra) {
                    Severity: Minor
                    Found in eslint/babel-eslint-parser/src/convert/convertAST.js - About 1 hr to fix

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

                      function ExportDeclaration(node: Object) {
                        if (node.declaration) {
                          const declar = node.declaration;
                          this.print(declar, node);
                          if (!t.isStatement(declar)) this.semicolon();
                      Severity: Minor
                      Found in packages/babel-generator/src/generators/modules.js - About 1 hr to fix

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

                        function optimiseIndexGetter(path, argsId, offset) {
                          const offsetLiteral = t.numericLiteral(offset);
                          let index;
                        
                          if (t.isNumericLiteral(path.parent.property)) {
                        Severity: Minor
                        Found in packages/babel-plugin-transform-parameters/src/rest.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language