Showing 1,982 of 1,982 total issues

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

export default function (
  path: NodePath,
  helpers: { wrapAsync: Object, wrapAwait: Object },
) {
  path.traverse(awaitVisitor, {
Severity: Minor
Found in packages/babel-helper-remap-async-to-generator/src/index.js - About 1 hr to fix

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

      function evalBinaryExpression(expr): number | typeof undefined {
        const left = evalConstant(expr.left);
        if (left === undefined) {
          return undefined;
        }
    Severity: Minor
    Found in packages/babel-plugin-transform-typescript/src/enum.js - About 1 hr to fix

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

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

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

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

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

            parseLabeledStatement(
              node: N.LabeledStatement,
              maybeName: string,
              expr: N.Identifier,
              context: ?string,
          Severity: Minor
          Found in packages/babel-parser/src/parser/statement.js - About 1 hr to fix

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

            function privateNameVisitorFactory(visitor) {
              const privateNameVisitor = {
                ...visitor,
            
                Class(path) {
            Severity: Minor
            Found in packages/babel-helper-create-class-features-plugin/src/fields.js - About 1 hr to fix

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

                addHelper(name: string): Object {
                  const declar = this.declarations[name];
                  if (declar) return t.cloneNode(declar);
              
                  const generator = this.get("helperGenerator");
              Severity: Minor
              Found in packages/babel-core/src/transformation/file/file.js - About 1 hr to fix

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

                      RegExpLiteral(path) {
                        const { node } = path;
                        const { file } = this;
                        const features = file.get(featuresKey);
                        const runtime = file.get(runtimeKey) ?? true;
                Severity: Minor
                Found in packages/babel-helper-create-regexp-features-plugin/src/index.js - About 1 hr to fix

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

                    function addAutoImports(path, state) {
                      const imports = getImportNames(path, state);
                      if (isModule(path)) {
                        // import {jsx} from "react";
                        // import {createElement} from "react";
                  Severity: Minor
                  Found in packages/babel-helper-builder-react-jsx-experimental/src/index.js - About 1 hr to fix

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

                      function buildCreateElementCall(path, file) {
                        const openingPath = path.get("openingElement");
                        openingPath.parent.children = t.react.buildChildren(openingPath.parent);
                    
                        const tagExpr = convertJSXIdentifier(
                    Severity: Minor
                    Found in packages/babel-helper-builder-react-jsx-experimental/src/index.js - About 1 hr to fix

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

                      export default function () {
                        const visitor = {
                          ImportDeclaration(path: NodePath) {
                            if (isRegeneratorSource(getImportSource(path))) {
                              this.regeneratorImportExcluded = true;
                      Severity: Minor
                      Found in packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js - About 1 hr to fix

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

                        function getTypeAnnotationBindingConstantViolations(binding, path, name) {
                          const types = [];
                        
                          const functionConstantViolations = [];
                          let constantViolations = getConstantViolationsBefore(
                        Severity: Minor
                        Found in packages/babel-traverse/src/path/inference/inferer-reference.js - About 1 hr to fix

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

                            addContinuations(fn) {
                              const state = {
                                reassignments: {},
                                returnStatements: [],
                                outsideReferences: this.outsideLetReferences,
                          Severity: Minor
                          Found in packages/babel-plugin-transform-block-scoping/src/index.js - About 1 hr to fix

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

                                    if (names.has(moduleName)) {
                                      namespaceTopLevel[i] = transformed;
                                    } else {
                                      names.add(moduleName);
                                      namespaceTopLevel.splice(
                            Severity: Major
                            Found in packages/babel-plugin-transform-typescript/src/namespace.js and 1 other location - About 1 hr to fix
                            packages/babel-plugin-transform-typescript/src/namespace.js on lines 63..73

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 62.

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

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

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

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

                            Refactorings

                            Further Reading

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

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

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 62.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                    if (names.has(moduleName)) {
                                      namespaceTopLevel[i] = transformed;
                                    } else {
                                      names.add(moduleName);
                                      namespaceTopLevel.splice(
                            Severity: Major
                            Found in packages/babel-plugin-transform-typescript/src/namespace.js and 1 other location - About 1 hr to fix
                            packages/babel-plugin-transform-typescript/src/namespace.js on lines 140..150

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 62.

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

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

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

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

                            Refactorings

                            Further Reading

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

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

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 62.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                argumentsPaths.forEach(argumentsChild => {
                                  const argsRef = t.identifier(argumentsBinding);
                                  argsRef.loc = argumentsChild.node.loc;
                            
                                  argumentsChild.replaceWith(argsRef);
                            Severity: Major
                            Found in packages/babel-traverse/src/path/conversion.js and 1 other location - About 1 hr to fix
                            packages/babel-traverse/src/path/conversion.js on lines 239..244

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 62.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                newTargetPaths.forEach(targetChild => {
                                  const targetRef = t.identifier(newTargetBinding);
                                  targetRef.loc = targetChild.node.loc;
                            
                                  targetChild.replaceWith(targetRef);
                            Severity: Major
                            Found in packages/babel-traverse/src/path/conversion.js and 1 other location - About 1 hr to fix
                            packages/babel-traverse/src/path/conversion.js on lines 225..230

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 62.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                jsxParseSpreadChild(node: N.JSXSpreadChild): N.JSXSpreadChild {
                                  this.next(); // ellipsis
                                  node.expression = this.parseExpression();
                                  this.expect(tt.braceR);
                            
                            
                            Severity: Major
                            Found in packages/babel-parser/src/plugins/jsx/index.js and 1 other location - About 1 hr to fix
                            packages/babel-parser/src/parser/expression.js on lines 1614..1620

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 62.

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

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

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

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

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language