Showing 1,982 of 1,982 total issues

Function results has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      _filenames.map(async function (filename: string): Promise<Object> {
        let sourceFilename = filename;
        if (cliOptions.outFile) {
          sourceFilename = path.relative(
            path.dirname(cliOptions.outFile),
Severity: Minor
Found in packages/babel-cli/src/babel/file.js - About 1 hr to fix

    Function isConstantExpression has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function isConstantExpression() {
      if (this.isIdentifier()) {
        const binding = this.scope.getBinding(this.node.name);
        if (!binding) return false;
        return binding.constant;
    Severity: Minor
    Found in packages/babel-traverse/src/path/introspection.js - About 1 hr to fix

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

      export default declare(api => {
        api.assertVersion(7);
      
        return {
          name: "syntax-partial-application",
      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-numeric-separator/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.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 10 locations. Consider refactoring.
      Open

      export default declare(api => {
        api.assertVersion(7);
      
        return {
          name: "syntax-top-level-await",
      Severity: Major
      Found in packages/babel-plugin-syntax-top-level-await/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-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

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

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

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

      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.implements) {
          this.space();
          this.word("implements");
          this.space();
          this.printList(node.implements, 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 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
      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.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-bind",
      Severity: Major
      Found in packages/babel-plugin-syntax-function-bind/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-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

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

      export default declare(api => {
        api.assertVersion(7);
      
        return {
          name: "syntax-throw-expressions",
      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-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-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

          JSXAttribute(path) {
            if (t.isJSXElement(path.node.value)) {
              path.node.value = t.jsxExpressionContainer(path.node.value);
            }
          },
      packages/babel-plugin-transform-react-jsx/src/transform-classic.js on lines 95..99

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

      export default declare(api => {
        api.assertVersion(7);
      
        return {
          name: "syntax-import-meta",
      Severity: Major
      Found in packages/babel-plugin-syntax-import-meta/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-function-sent/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

      Severity
      Category
      Status
      Source
      Language