Showing 1,982 of 1,982 total issues

Function pushTask has 139 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function pushTask(taskName, taskDir, suite, suiteName) {
  const taskDirStats = fs.statSync(taskDir);
  let actualLoc = findFile(taskDir + "/input");
  let execLoc = findFile(taskDir + "/exec");

Severity: Major
Found in packages/babel-helper-fixtures/src/index.js - About 5 hrs 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 (
        (this.isNodeType("Expression") && !this.isJSXElement()) ||
        (parentPath.isForStatement() && this.key === "init")
      ) {
        if (this.node) nodes.push(this.node);
    Severity: Major
    Found in packages/babel-traverse/src/path/modification.js and 1 other location - About 5 hrs to fix
    packages/babel-traverse/src/path/modification.js on lines 117..155

    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 (
        (this.isNodeType("Expression") &&
          !this.isJSXElement() &&
          !parentPath.isJSXElement()) ||
        (parentPath.isForStatement() && this.key === "init")
    Severity: Major
    Found in packages/babel-traverse/src/path/modification.js and 1 other location - About 5 hrs to fix
    packages/babel-traverse/src/path/modification.js on lines 26..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 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

    Function checkExport has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

      checkExport(
        node: N.ExportNamedDeclaration,
        checkNames?: boolean,
        isDefault?: boolean,
        isFrom?: boolean,
    Severity: Minor
    Found in packages/babel-parser/src/parser/statement.js - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    File lval.js has 390 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // @flow
    
    import * as charCodes from "charcodes";
    import { types as tt, type TokenType } from "../tokenizer/types";
    import type {
    Severity: Minor
    Found in packages/babel-parser/src/parser/lval.js - About 5 hrs to fix

      Function processComment has 133 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        processComment(node: Node): void {
          if (node.type === "Program" && node.body.length > 0) return;
      
          const stack = this.state.commentStack;
      
      
      Severity: Major
      Found in packages/babel-parser/src/parser/comments.js - About 5 hrs to fix

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

            if (t.isJSXNamespacedName(node.name)) {
              node.name = t.stringLiteral(
                node.name.namespace.name + ":" + node.name.name.name,
              );
            } else if (t.isValidIdentifier(node.name.name, false)) {
        Severity: Major
        Found in packages/babel-helper-builder-react-jsx/src/index.js and 1 other location - About 5 hrs to fix
        packages/babel-helper-builder-react-jsx-experimental/src/index.js on lines 515..523

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

        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 isTerminatorless(node: ?Object, opts?: Object): boolean {
          if (!node) return false;
        
          const nodeType = node.type;
          if (
        Severity: Major
        Found in packages/babel-types/src/validators/generated/index.js and 3 other locations - About 5 hrs to fix
        packages/babel-types/src/validators/generated/index.js on lines 3852..3873
        packages/babel-types/src/validators/generated/index.js on lines 3874..3895
        packages/babel-types/src/validators/generated/index.js on lines 4262..4283

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

        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 isFunctionParent(node: ?Object, opts?: Object): boolean {
          if (!node) return false;
        
          const nodeType = node.type;
          if (
        Severity: Major
        Found in packages/babel-types/src/validators/generated/index.js and 3 other locations - About 5 hrs to fix
        packages/babel-types/src/validators/generated/index.js on lines 3697..3718
        packages/babel-types/src/validators/generated/index.js on lines 3852..3873
        packages/babel-types/src/validators/generated/index.js on lines 4262..4283

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

        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 isModuleSpecifier(node: ?Object, opts?: Object): boolean {
          if (!node) return false;
        
          const nodeType = node.type;
          if (
        Severity: Major
        Found in packages/babel-types/src/validators/generated/index.js and 3 other locations - About 5 hrs to fix
        packages/babel-types/src/validators/generated/index.js on lines 3697..3718
        packages/babel-types/src/validators/generated/index.js on lines 3852..3873
        packages/babel-types/src/validators/generated/index.js on lines 3874..3895

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

        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 (t.isJSXNamespacedName(node.name)) {
              node.name = t.stringLiteral(
                node.name.namespace.name + ":" + node.name.name.name,
              );
            } else if (t.isValidIdentifier(node.name.name, false)) {
        packages/babel-helper-builder-react-jsx/src/index.js on lines 102..110

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

        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 isFunction(node: ?Object, opts?: Object): boolean {
          if (!node) return false;
        
          const nodeType = node.type;
          if (
        Severity: Major
        Found in packages/babel-types/src/validators/generated/index.js and 3 other locations - About 5 hrs to fix
        packages/babel-types/src/validators/generated/index.js on lines 3697..3718
        packages/babel-types/src/validators/generated/index.js on lines 3874..3895
        packages/babel-types/src/validators/generated/index.js on lines 4262..4283

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

        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 parseSubscript has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

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

        Cognitive Complexity

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

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

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

        Further reading

        Function cloneNode has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function cloneNode<T: Object>(
          node: T,
          deep: boolean = true,
          withoutLoc: boolean = false,
        ): T {
        Severity: Minor
        Found in packages/babel-types/src/clone/cloneNode.js - About 5 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function buildFieldsInitNodes has 130 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function buildFieldsInitNodes(
          ref,
          superRef,
          props,
          privateNamesMap,
        Severity: Major
        Found in packages/babel-helper-create-class-features-plugin/src/fields.js - About 5 hrs to fix

          Function convertFunctionParams has 129 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function convertFunctionParams(
            path,
            loose,
            shouldTransformParam,
            replaceRestElement,
          Severity: Major
          Found in packages/babel-plugin-transform-parameters/src/params.js - About 5 hrs to fix

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

            export function isPattern(node: ?Object, opts?: Object): boolean {
              if (!node) return false;
            
              const nodeType = node.type;
              if (
            Severity: Major
            Found in packages/babel-types/src/validators/generated/index.js and 1 other location - About 5 hrs to fix
            packages/babel-types/src/validators/generated/index.js on lines 3610..3629

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

            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 isBlock(node: ?Object, opts?: Object): boolean {
              if (!node) return false;
            
              const nodeType = node.type;
              if (
            Severity: Major
            Found in packages/babel-types/src/validators/generated/index.js and 1 other location - About 5 hrs to fix
            packages/babel-types/src/validators/generated/index.js on lines 4185..4204

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

            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