Showing 1,982 of 1,982 total issues

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

export default declare(api => {
  api.assertVersion(7);

  return {
    name: "syntax-logical-assignment-operators",
packages/babel-plugin-syntax-do-expressions/src/index.js on lines 3..13
packages/babel-plugin-syntax-export-default-from/src/index.js on lines 3..13
packages/babel-plugin-syntax-function-bind/src/index.js on lines 3..13
packages/babel-plugin-syntax-function-sent/src/index.js on lines 3..13
packages/babel-plugin-syntax-import-meta/src/index.js on lines 3..13
packages/babel-plugin-syntax-numeric-separator/src/index.js on lines 3..13
packages/babel-plugin-syntax-partial-application/src/index.js on lines 3..13
packages/babel-plugin-syntax-throw-expressions/src/index.js on lines 3..13
packages/babel-plugin-syntax-top-level-await/src/index.js on lines 3..13

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

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

  if (node.constraint) {
    this.space();
    this.word("extends");
    this.space();
    this.print(node.constraint, node);
Severity: Major
Found in packages/babel-generator/src/generators/typescript.js and 10 other locations - About 1 hr to fix
packages/babel-generator/src/generators/classes.js on lines 41..46
packages/babel-generator/src/generators/classes.js on lines 94..99
packages/babel-generator/src/generators/classes.js on lines 110..115
packages/babel-generator/src/generators/flow.js on lines 237..242
packages/babel-generator/src/generators/flow.js on lines 445..450
packages/babel-generator/src/generators/flow.js on lines 465..470
packages/babel-generator/src/generators/modules.js on lines 129..134
packages/babel-generator/src/generators/statements.js on lines 163..168
packages/babel-generator/src/generators/statements.js on lines 295..300
packages/babel-generator/src/generators/typescript.js on lines 26..31

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

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

  if (node.default) {
    this.space();
    this.token("=");
    this.space();
    this.print(node.default, node);
Severity: Major
Found in packages/babel-generator/src/generators/typescript.js and 10 other locations - About 1 hr to fix
packages/babel-generator/src/generators/classes.js on lines 41..46
packages/babel-generator/src/generators/classes.js on lines 94..99
packages/babel-generator/src/generators/classes.js on lines 110..115
packages/babel-generator/src/generators/flow.js on lines 237..242
packages/babel-generator/src/generators/flow.js on lines 445..450
packages/babel-generator/src/generators/flow.js on lines 465..470
packages/babel-generator/src/generators/modules.js on lines 129..134
packages/babel-generator/src/generators/statements.js on lines 163..168
packages/babel-generator/src/generators/statements.js on lines 295..300
packages/babel-generator/src/generators/typescript.js on lines 19..24

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

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

  if (node.init) {
    this.space();
    this.token("=");
    this.space();
    this.print(node.init, node);
Severity: Major
Found in packages/babel-generator/src/generators/statements.js and 10 other locations - About 1 hr to fix
packages/babel-generator/src/generators/classes.js on lines 41..46
packages/babel-generator/src/generators/classes.js on lines 94..99
packages/babel-generator/src/generators/classes.js on lines 110..115
packages/babel-generator/src/generators/flow.js on lines 237..242
packages/babel-generator/src/generators/flow.js on lines 445..450
packages/babel-generator/src/generators/flow.js on lines 465..470
packages/babel-generator/src/generators/modules.js on lines 129..134
packages/babel-generator/src/generators/statements.js on lines 163..168
packages/babel-generator/src/generators/typescript.js on lines 19..24
packages/babel-generator/src/generators/typescript.js on lines 26..31

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

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

          case charCodes.carriageReturn:
            if (this.input.charCodeAt(this.state.pos) === charCodes.lineFeed) {
              ++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 1347..1350

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

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

  if (node.impltype) {
    this.space();
    this.token("=");
    this.space();
    this.print(node.impltype, node);
Severity: Major
Found in packages/babel-generator/src/generators/flow.js and 10 other locations - About 1 hr to fix
packages/babel-generator/src/generators/classes.js on lines 41..46
packages/babel-generator/src/generators/classes.js on lines 94..99
packages/babel-generator/src/generators/classes.js on lines 110..115
packages/babel-generator/src/generators/flow.js on lines 237..242
packages/babel-generator/src/generators/flow.js on lines 445..450
packages/babel-generator/src/generators/modules.js on lines 129..134
packages/babel-generator/src/generators/statements.js on lines 163..168
packages/babel-generator/src/generators/statements.js on lines 295..300
packages/babel-generator/src/generators/typescript.js on lines 19..24
packages/babel-generator/src/generators/typescript.js on lines 26..31

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

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

export default declare(api => {
  api.assertVersion(7);

  return {
    name: "syntax-export-default-from",
packages/babel-plugin-syntax-do-expressions/src/index.js on lines 3..13
packages/babel-plugin-syntax-function-bind/src/index.js on lines 3..13
packages/babel-plugin-syntax-function-sent/src/index.js on lines 3..13
packages/babel-plugin-syntax-import-meta/src/index.js on lines 3..13
packages/babel-plugin-syntax-logical-assignment-operators/src/index.js on lines 3..13
packages/babel-plugin-syntax-numeric-separator/src/index.js on lines 3..13
packages/babel-plugin-syntax-partial-application/src/index.js on lines 3..13
packages/babel-plugin-syntax-throw-expressions/src/index.js on lines 3..13
packages/babel-plugin-syntax-top-level-await/src/index.js on lines 3..13

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

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

export default declare(api => {
  api.assertVersion(7);

  return {
    name: "syntax-function-sent",
Severity: Major
Found in packages/babel-plugin-syntax-function-sent/src/index.js and 9 other locations - About 1 hr to fix
packages/babel-plugin-syntax-do-expressions/src/index.js on lines 3..13
packages/babel-plugin-syntax-export-default-from/src/index.js on lines 3..13
packages/babel-plugin-syntax-function-bind/src/index.js on lines 3..13
packages/babel-plugin-syntax-import-meta/src/index.js on lines 3..13
packages/babel-plugin-syntax-logical-assignment-operators/src/index.js on lines 3..13
packages/babel-plugin-syntax-numeric-separator/src/index.js on lines 3..13
packages/babel-plugin-syntax-partial-application/src/index.js on lines 3..13
packages/babel-plugin-syntax-throw-expressions/src/index.js on lines 3..13
packages/babel-plugin-syntax-top-level-await/src/index.js on lines 3..13

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

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

  visitor.JSXAttribute = function (path) {
    if (t.isJSXElement(path.node.value)) {
      path.node.value = t.jsxExpressionContainer(path.node.value);
    }
  };
packages/babel-helper-builder-react-jsx-experimental/src/index.js on lines 108..112

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

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.typeParameters) {
          attachComment({
            ofPath: path.get("typeParameters"),
            toPath: path.get("id"),
            optional: node.typeParameters.optional,
Severity: Major
Found in packages/babel-plugin-transform-flow-comments/src/index.js and 1 other location - About 1 hr to fix
packages/babel-plugin-transform-flow-comments/src/index.js on lines 156..162

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

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

        const destructuring = new DestructuringTransformer({
          operator: node.operator,
          scope: scope,
          nodes: nodes,
          arrayOnlySpread,
Severity: Major
Found in packages/babel-plugin-transform-destructuring/src/index.js and 1 other location - About 1 hr to fix
packages/babel-plugin-transform-destructuring/src/index.js on lines 526..533

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

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 (node.typeAnnotation) {
          attachComment({
            ofPath: path.get("typeAnnotation"),
            toPath: path.get("key"),
            optional: node.typeAnnotation.optional,
Severity: Major
Found in packages/babel-plugin-transform-flow-comments/src/index.js and 1 other location - About 1 hr to fix
packages/babel-plugin-transform-flow-comments/src/index.js on lines 134..140

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

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

        const destructuring = new DestructuringTransformer({
          kind: left.kind,
          scope: scope,
          nodes: nodes,
          arrayOnlySpread,
Severity: Major
Found in packages/babel-plugin-transform-destructuring/src/index.js and 1 other location - About 1 hr to fix
packages/babel-plugin-transform-destructuring/src/index.js on lines 571..578

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

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 getOpts has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function getOpts(self) {
    const newOpts = merge(
      {
        cwd: path.dirname(self.loc),
        filename: self.loc,
Severity: Minor
Found in packages/babel-helper-transform-fixture-test-runner/src/index.js - About 1 hr to fix

    Function parseAssignableListItem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        parseAssignableListItem(
          allowModifiers: ?boolean,
          decorators: N.Decorator[],
        ): N.Pattern | N.TSParameterProperty {
          // Store original location/position to include modifiers in range
    Severity: Minor
    Found in packages/babel-parser/src/plugins/typescript/index.js - About 1 hr to fix

      Function parseImport has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          parseImport(node: N.Node): N.AnyImport {
            if (this.match(tt.name) || this.match(tt.star) || this.match(tt.braceL)) {
              const ahead = this.lookahead();
      
              if (this.match(tt.name) && ahead.type === tt.eq) {
      Severity: Minor
      Found in packages/babel-parser/src/plugins/typescript/index.js - About 1 hr to fix

        Function parseNew has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          parseNew(): N.NewExpression | N.MetaProperty {
            const node = this.startNode();
        
            let meta = this.startNode();
            this.next();
        Severity: Minor
        Found in packages/babel-parser/src/parser/expression.js - About 1 hr to fix

          Function parseExprListItem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            parseExprListItem(
              allowEmpty: ?boolean,
              refExpressionErrors?: ?ExpressionErrors,
              refNeedsArrowPos: ?Pos,
              allowPlaceholder: ?boolean,
          Severity: Minor
          Found in packages/babel-parser/src/parser/expression.js - About 1 hr to fix

            Function pushAssignmentPattern has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                pushAssignmentPattern({ left, right }, valueRef) {
                  // we need to assign the current value of the assignment to avoid evaluating
                  // it more than once
                  const tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef);
            
            
            Severity: Minor
            Found in packages/babel-plugin-transform-destructuring/src/index.js - About 1 hr to fix

              Function cleanJSXElementLiteralChild has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function cleanJSXElementLiteralChild(
                child: { value: string },
                args: Array<Object>,
              ) {
                const lines = child.value.split(/\r\n|\n|\r/);
              Severity: Minor
              Found in packages/babel-types/src/utils/react/cleanJSXElementLiteralChild.js - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language