Showing 1,982 of 1,982 total issues

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

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

    function buildNamespaceReexport(metadata, namespace, loose) {
      return (loose
        ? template.statement`
            Object.keys(NAMESPACE).forEach(function(key) {
              if (key === "default" || key === "__esModule") return;
    Severity: Minor
    Found in packages/babel-helper-module-transforms/src/index.js - About 1 hr to fix

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

      function buildLiteralData<T>(
        formatter: Formatter<T>,
        tpl: Array<string>,
        opts: TemplateOpts,
      ) {
      Severity: Minor
      Found in packages/babel-template/src/literal.js - About 1 hr to fix

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

        function assertNoDuplicates(items: Array<UnloadedDescriptor>): void {
          const map = new Map();
        
          for (const item of items) {
            if (typeof item.value !== "function") continue;
        Severity: Minor
        Found in packages/babel-core/src/config/config-descriptors.js - About 1 hr to fix

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

            return function* cachedFunction(arg: ArgT, data: SideChannel) {
              const asyncContext = yield* isAsync();
              const callCache = asyncContext ? callCacheAsync : callCacheSync;
          
              const cached = yield* getCachedValueOrWait(
          Severity: Minor
          Found in packages/babel-core/src/config/caching.js - About 1 hr to fix

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

                  TemplateLiteral(path) {
                    const nodes = [];
                    const expressions = path.get("expressions");
            
                    let index = 0;
            Severity: Minor
            Found in packages/babel-plugin-transform-template-literals/src/index.js - About 1 hr to fix

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

                function _ForOfStatementArray(path) {
                  const { node, scope } = path;
              
                  const right = scope.generateUidIdentifierBasedOnNode(node.right, "arr");
                  const iterationKey = scope.generateUidIdentifier("i");
              Severity: Minor
              Found in packages/babel-plugin-transform-for-of/src/index.js - About 1 hr to fix

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

                export default function bindifyDecorators(
                  decorators: Array<NodePath>,
                ): Array<NodePath> {
                  for (const decoratorPath of decorators) {
                    const decorator = decoratorPath.node;
                Severity: Minor
                Found in packages/babel-helper-bindify-decorators/src/index.js - About 1 hr to fix

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

                    registerDeclaration(path: NodePath) {
                      if (path.isLabeledStatement()) {
                        this.registerLabel(path);
                      } else if (path.isFunctionDeclaration()) {
                        this.registerBinding("hoisted", path.get("id"), path);
                  Severity: Minor
                  Found in packages/babel-traverse/src/scope/index.js - About 1 hr to fix

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

                          Identifier(path) {
                            const { node, key } = path;
                            const { name } = node;
                            const replaced = name.replace(surrogate, c => {
                              return `_u${c.charCodeAt(0).toString(16)}`;
                    Severity: Minor
                    Found in packages/babel-plugin-transform-unicode-escapes/src/index.js - About 1 hr to fix

                      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

                      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(",");
                          } else {
                      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 162..166

                      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

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

                          type === tt.semi ||
                          type === tt.comma ||
                          type === tt.parenL ||
                          type === tt.parenR ||
                          type === tt.braceL ||
                      Severity: Major
                      Found in eslint/babel-eslint-parser/src/convert/convertTokens.js and 1 other location - About 1 hr to fix
                      packages/babel-parser/src/tokenizer/index.js on lines 1528..1532

                      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

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

                      const loadPresetOverridesEnvDescriptors = makeWeakCacheSync(
                        (preset: PresetInstance) =>
                          makeStrongCacheSync((index: number) =>
                            makeStrongCacheSync((envName: string) =>
                              buildOverrideEnvDescriptors(
                      Severity: Major
                      Found in packages/babel-core/src/config/config-chain.js and 1 other location - About 1 hr to fix
                      packages/babel-core/src/config/config-chain.js on lines 356..369

                      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

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

                                        path.replaceWith(
                                          t.expressionStatement(
                                            t.assignmentExpression(
                                              "=",
                                              t.cloneNode(declar.node.id),
                      packages/babel-plugin-transform-modules-systemjs/src/index.js on lines 289..297

                      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

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

                              case "number":
                                node.explicitType = true;
                                node.members = members.numberMembers;
                                this.expect(tt.braceR);
                                return this.finishNode(node, "EnumNumberBody");
                      Severity: Major
                      Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                      packages/babel-parser/src/plugins/flow.js on lines 3373..3377

                      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

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

                        resetStartLocation(node: NodeBase, start: number, startLoc: Position): void {
                          node.start = start;
                          node.loc.start = startLoc;
                          if (this.options.ranges) node.range[0] = start;
                        }
                      Severity: Major
                      Found in packages/babel-parser/src/parser/node.js and 1 other location - About 1 hr to fix
                      packages/babel-parser/src/parser/node.js on lines 106..114

                      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

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

                      export const SpreadProperty = {
                        types: ["RestElement"],
                        checkPath(path: NodePath): boolean {
                          return path.parentPath && path.parentPath.isObjectExpression();
                        },
                      Severity: Major
                      Found in packages/babel-traverse/src/path/lib/virtual-types.js and 1 other location - About 1 hr to fix
                      packages/babel-traverse/src/path/lib/virtual-types.js on lines 129..134

                      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

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

                              case "boolean":
                                node.explicitType = true;
                                node.members = members.booleanMembers;
                                this.expect(tt.braceR);
                                return this.finishNode(node, "EnumBooleanBody");
                      Severity: Major
                      Found in packages/babel-parser/src/plugins/flow.js and 1 other location - About 1 hr to fix
                      packages/babel-parser/src/plugins/flow.js on lines 3378..3382

                      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

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

                            prevType === tt._else ||
                            prevType === tt.semi ||
                            prevType === tt.eof ||
                            prevType === tt.parenR ||
                            prevType === tt.arrow
                      Severity: Major
                      Found in packages/babel-parser/src/tokenizer/index.js and 1 other location - About 1 hr to fix
                      eslint/babel-eslint-parser/src/convert/convertTokens.js on lines 101..105

                      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