Showing 1,982 of 1,982 total issues

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

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

for (const plugin of Object.keys(plugins)) {
  if (Object.hasOwnProperty.call(availablePlugins, plugin)) {
    pluginsFiltered[plugin] = plugins[plugin];
  }
}
Severity: Major
Found in packages/babel-preset-env/src/plugins-compat-data.js and 1 other location - About 1 hr to fix
packages/babel-preset-env/src/plugins-compat-data.js on lines 16..20

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

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

for (const plugin of Object.keys(bugfixPlugins)) {
  if (Object.hasOwnProperty.call(availablePlugins, plugin)) {
    bugfixPluginsFiltered[plugin] = bugfixPlugins[plugin];
  }
}
Severity: Major
Found in packages/babel-preset-env/src/plugins-compat-data.js and 1 other location - About 1 hr to fix
packages/babel-preset-env/src/plugins-compat-data.js on lines 10..14

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

Function isReactCall has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function isReactCall(path) {
  // If the callee is not a member expression, then check if it matches
  // a named import, e.g. `import {forwardRef} from 'react'`.
  if (!t.isMemberExpression(path.node.callee)) {
    const callee = path.get("callee");
Severity: Minor
Found in packages/babel-plugin-transform-react-pure-annotations/src/index.js - About 1 hr to fix

    Function getPlugins has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getPlugins(test) {
      const flowOptions = { all: true };
    
      const plugins = [
        "dynamicImport",
    Severity: Minor
    Found in scripts/parser-tests/flow/index.js - About 1 hr to fix

      Function skipFlowComment has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          skipFlowComment(): number | boolean {
            const { pos } = this.state;
            let shiftToFirstNonWhiteSpace = 2;
            while (
              [charCodes.space, charCodes.tab].includes(
      Severity: Minor
      Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

        Function parseExprOp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            parseExprOp(
              left: N.Expression,
              leftStartPos: number,
              leftStartLoc: Position,
              minPrec: number,
        Severity: Minor
        Found in packages/babel-parser/src/plugins/typescript/index.js - About 1 hr to fix

          Function flowParseDeclare has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              flowParseDeclare(
                node: N.FlowDeclare,
                insideModule?: boolean,
              ): N.FlowDeclare {
                if (this.match(tt._class)) {
          Severity: Minor
          Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

            Function isWhitespace has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function isWhitespace(code: number): boolean {
              switch (code) {
                case 0x0009: // CHARACTER TABULATION
                case 0x000b: // LINE TABULATION
                case 0x000c: // FORM FEED
            Severity: Minor
            Found in packages/babel-parser/src/util/whitespace.js - About 1 hr to fix

              Function parseClass has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  parseClass<T: N.Class>(
                    node: T,
                    isStatement: /* T === ClassDeclaration */ boolean,
                    optionalId?: boolean,
                  ): T {
              Severity: Minor
              Found in packages/babel-parser/src/plugins/placeholders.js - About 1 hr to fix

                Function parseClassMemberWithIsStatic has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    parseClassMemberWithIsStatic(
                      classBody: N.ClassBody,
                      member: N.ClassMember | N.TsIndexSignature,
                      state: { hadConstructor: boolean },
                      isStatic: boolean,
                Severity: Minor
                Found in packages/babel-parser/src/plugins/typescript/index.js - About 1 hr to fix

                  Function flowParseDeclareFunction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      flowParseDeclareFunction(
                        node: N.FlowDeclareFunction,
                      ): N.FlowDeclareFunction {
                        this.next();
                  
                  
                  Severity: Minor
                  Found in packages/babel-parser/src/plugins/flow.js - About 1 hr to fix

                    Function body has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            (hasStrictModeDirective: boolean) => {
                              const nonSimple = !this.isSimpleParamList(node.params);
                    
                              if (hasStrictModeDirective && nonSimple) {
                                // This logic is here to align the error location with the ESTree plugin.
                    Severity: Minor
                    Found in packages/babel-parser/src/parser/expression.js - About 1 hr to fix

                      Function toStatement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function toStatement(node: Object, ignore?: boolean) {
                        if (isStatement(node)) {
                          return node;
                        }
                      
                      
                      Severity: Minor
                      Found in packages/babel-types/src/converters/toStatement.js - About 1 hr to fix

                        Function maybeCreateConstructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function maybeCreateConstructor() {
                            let hasConstructor = false;
                            const paths = classState.path.get("body.body");
                            for (const path of paths) {
                              hasConstructor = path.equals("kind", "constructor");
                        Severity: Minor
                        Found in packages/babel-plugin-transform-classes/src/transformClass.js - About 1 hr to fix

                          Function isTSBaseType has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function isTSBaseType(node: ?Object, opts?: Object): boolean {
                            if (!node) return false;
                          
                            const nodeType = node.type;
                            if (
                          Severity: Minor
                          Found in packages/babel-types/src/validators/generated/index.js - About 1 hr to fix

                            Function buildCreateElementFragmentCall has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function buildCreateElementFragmentCall(path, file) {
                                if (options.filter && !options.filter(path.node, file)) {
                                  return;
                                }
                            
                            
                            Severity: Minor
                            Found in packages/babel-helper-builder-react-jsx-experimental/src/index.js - About 1 hr to fix

                              Function createUncachedDescriptors has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function createUncachedDescriptors(
                                dirname: string,
                                options: ValidatedOptions,
                                alias: string,
                              ): OptionsAndDescriptors {
                              Severity: Minor
                              Found in packages/babel-core/src/config/config-descriptors.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language