Showing 1,982 of 1,982 total issues

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

function removeModuleDeclarations(programPath: NodePath) {
  programPath.get("body").forEach(child => {
    if (child.isImportDeclaration()) {
      child.remove();
    } else if (child.isExportNamedDeclaration()) {

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

    export function isJSX(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 traverseSimpleImpl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function traverseSimpleImpl<T>(
        node: Object,
        enter: ?Function,
        exit: ?Function,
        state: ?T,
      Severity: Minor
      Found in packages/babel-types/src/traverse/traverse.js - About 1 hr to fix

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

        export function injectInitialization(path, constructor, nodes, renamer) {
          if (!nodes.length) return;
        
          const isDerived = !!path.node.superClass;
        
        
        Severity: Minor
        Found in packages/babel-helper-create-class-features-plugin/src/misc.js - About 1 hr to fix

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

          export function ObjectProperty(node: Object) {
            this.printJoin(node.decorators, node);
          
            if (node.computed) {
              this.token("[");
          Severity: Minor
          Found in packages/babel-generator/src/generators/types.js - About 1 hr to fix

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

              _normalizePosition(
                prop: string,
                loc: Object,
                targetObj: Object,
                force?: boolean,
            Severity: Minor
            Found in packages/babel-generator/src/buffer.js - About 1 hr to fix

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

                    ExportNamedDeclaration(path) {
                      const { node, scope } = path;
                      const { specifiers } = node;
              
                      const index = t.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;
              Severity: Minor
              Found in packages/babel-plugin-proposal-export-namespace-from/src/index.js - About 1 hr to fix

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

                export function _guessExecutionStatusRelativeToDifferentFunctions(
                  target: NodePath,
                ): RelativeExecutionStatus {
                  if (
                    !target.isFunctionDeclaration() ||
                Severity: Minor
                Found in packages/babel-traverse/src/path/introspection.js - About 1 hr to fix

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

                  export function getEarliestCommonAncestorFrom(
                    paths: Array<NodePath>,
                  ): NodePath {
                    return this.getDeepestCommonAncestorFrom(paths, function (
                      deepest,
                  Severity: Minor
                  Found in packages/babel-traverse/src/path/ancestry.js - About 1 hr to fix

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

                    export function _getTypeAnnotation(): ?Object {
                      const node = this.node;
                    
                      if (!node) {
                        // handle initializerless variables, add in checks for loop initializers too
                    Severity: Minor
                    Found in packages/babel-traverse/src/path/inference/index.js - About 1 hr to fix

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

                        function pushComputedPropsSpec(info) {
                          const { objId, body, computedProps, state } = info;
                      
                          for (const prop of computedProps) {
                            const key = t.toComputedKey(prop);
                      Severity: Minor
                      Found in packages/babel-plugin-transform-computed-properties/src/index.js - About 1 hr to fix

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

                        export function TupleTypeAnnotation(node: Object) {
                          this.token("[");
                          this.printList(node.types, node);
                          this.token("]");
                        }
                        Severity: Major
                        Found in packages/babel-generator/src/generators/flow.js and 3 other locations - About 1 hr to fix
                        packages/babel-generator/src/generators/expressions.js on lines 27..31
                        packages/babel-generator/src/generators/jsx.js on lines 32..36
                        packages/babel-generator/src/generators/jsx.js on lines 89..93

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                        export function JSXExpressionContainer(node: Object) {
                          this.token("{");
                          this.print(node.expression, node);
                          this.token("}");
                        }
                        Severity: Major
                        Found in packages/babel-generator/src/generators/jsx.js and 3 other locations - About 1 hr to fix
                        packages/babel-generator/src/generators/expressions.js on lines 27..31
                        packages/babel-generator/src/generators/flow.js on lines 397..401
                        packages/babel-generator/src/generators/jsx.js on lines 89..93

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                        export function ParenthesizedExpression(node: Object) {
                          this.token("(");
                          this.print(node.expression, node);
                          this.token(")");
                        }
                        Severity: Major
                        Found in packages/babel-generator/src/generators/expressions.js and 3 other locations - About 1 hr to fix
                        packages/babel-generator/src/generators/flow.js on lines 397..401
                        packages/babel-generator/src/generators/jsx.js on lines 32..36
                        packages/babel-generator/src/generators/jsx.js on lines 89..93

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

                        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

                            } else if (t.isArrayExpression(node)) {
                              for (const elem of (node.elements: Array<Object>)) {
                                if (!this.isPure(elem, constantsOnly)) return false;
                              }
                              return true;
                        Severity: Major
                        Found in packages/babel-traverse/src/scope/index.js and 2 other locations - About 1 hr to fix
                        packages/babel-traverse/src/scope/index.js on lines 728..755
                        packages/babel-traverse/src/scope/index.js on lines 748..755

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

                        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

                        export function ObjectExpression(
                          node: Object,
                          parent: Object,
                          printStack: Array<Object>,
                        ): boolean {
                        Severity: Major
                        Found in packages/babel-generator/src/node/parentheses.js and 2 other locations - About 1 hr to fix
                        packages/babel-generator/src/node/parentheses.js on lines 207..213
                        packages/babel-generator/src/node/parentheses.js on lines 223..229

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

                        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

                            } else if (t.isTemplateLiteral(node)) {
                              for (const expression of (node.expressions: Array<Object>)) {
                                if (!this.isPure(expression, constantsOnly)) return false;
                              }
                              return true;
                        Severity: Major
                        Found in packages/babel-traverse/src/scope/index.js and 2 other locations - About 1 hr to fix
                        packages/babel-traverse/src/scope/index.js on lines 723..755
                        packages/babel-traverse/src/scope/index.js on lines 728..755

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                        export function JSXClosingElement(node: Object) {
                          this.token("</");
                          this.print(node.name, node);
                          this.token(">");
                        }
                        Severity: Major
                        Found in packages/babel-generator/src/generators/jsx.js and 3 other locations - About 1 hr to fix
                        packages/babel-generator/src/generators/expressions.js on lines 27..31
                        packages/babel-generator/src/generators/flow.js on lines 397..401
                        packages/babel-generator/src/generators/jsx.js on lines 32..36

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

                        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

                        export function ClassExpression(
                          node: Object,
                          parent: Object,
                          printStack: Array<Object>,
                        ): boolean {
                        Severity: Major
                        Found in packages/babel-generator/src/node/parentheses.js and 2 other locations - About 1 hr to fix
                        packages/babel-generator/src/node/parentheses.js on lines 72..78
                        packages/babel-generator/src/node/parentheses.js on lines 223..229

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

                        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

                        export function TSTypeParameterInstantiation(node): void {
                          this.token("<");
                          this.printList(node.params, node, {});
                          this.token(">");
                        }
                        Severity: Major
                        Found in packages/babel-generator/src/generators/typescript.js and 1 other location - About 1 hr to fix
                        packages/babel-generator/src/generators/flow.js on lines 428..432

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

                        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