Showing 731 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-numeric-separator",
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-logical-assignment-operators/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-do-expressions",
Severity: Major
Found in packages/babel-plugin-syntax-do-expressions/src/index.js and 9 other locations - About 1 hr to fix
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-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 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

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

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

  if (node.finalizer) {
    this.space();
    this.word("finally");
    this.space();
    this.print(node.finalizer, 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 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-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

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

    if (node.source) {
      this.space();
      this.word("from");
      this.space();
      this.print(node.source, node);
Severity: Major
Found in packages/babel-generator/src/generators/modules.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/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 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 11 locations. Consider refactoring.
Open

  if (node.value) {
    this.space();
    this.token("=");
    this.space();
    this.print(node.value, node);
Severity: Major
Found in packages/babel-generator/src/generators/classes.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 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
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.value) {
    this.space();
    this.token("=");
    this.space();
    this.print(node.value, node);
Severity: Major
Found in packages/babel-generator/src/generators/classes.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/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
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 1299..1302

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

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

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

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

  } else if (typeof corejs === "object" && corejs !== null) {
    rawVersion = corejs.version;
    proposals = Boolean(corejs.proposals);
  } else {
    rawVersion = corejs;
Severity: Major
Found in packages/babel-preset-env/src/normalize-options.js and 1 other location - About 1 hr to fix
packages/babel-plugin-transform-runtime/src/index.js on lines 29..34

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

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

    if (elem) {
      if (i > 0) this.space();
      this.print(elem, node);
      if (i < len - 1) this.token(",");
    }
Severity: Major
Found in packages/babel-generator/src/generators/types.js and 1 other location - About 1 hr to fix
packages/babel-generator/src/generators/types.js on lines 90..101

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

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