Showing 1,982 of 1,982 total issues

Consider simplifying this complex logical expression.
Open

  if (
    parent.type === "AssignmentExpression" &&
    parent.left.type === "MemberExpression" &&
    parent.left.object.type === "Identifier" &&
    parent.left.object.name === "module" &&
Severity: Major
Found in eslint/babel-eslint-plugin-development/src/utils/get-export-name.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

          if (
            this.match(tt.name) &&
            (this.state.value === "type" ||
              this.state.value === "interface" ||
              this.state.value === "opaque" ||
    Severity: Major
    Found in packages/babel-parser/src/plugins/flow.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

          if (
            (this.state.value === "of" &&
              !this.state.exprAllowed &&
              prevType !== tt._function &&
              prevType !== tt._class) ||
      Severity: Major
      Found in packages/babel-parser/src/tokenizer/context.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            } else if (
              isSimple &&
              (key.name === "get" || key.name === "set") &&
              !containsEsc &&
              !(this.match(tt.star) && this.isLineTerminator())
        Severity: Major
        Found in packages/babel-parser/src/parser/statement.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

              if (
                init.type === "VariableDeclaration" &&
                init.declarations[0].init != null &&
                (!isForIn ||
                  this.state.strict ||
          Severity: Major
          Found in packages/babel-parser/src/parser/statement.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

              } else if (
                (t.isNewExpression(parent) && key === "arguments") ||
                (t.isCallExpression(parent) && key === "arguments") ||
                (t.isFunction(parent) && key === "params")
              ) {
            Severity: Major
            Found in packages/babel-template/src/parse.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                if (
                  nodeType === "Block" ||
                  "BlockStatement" === nodeType ||
                  "Program" === nodeType ||
                  "TSModuleBlock" === nodeType ||
              Severity: Major
              Found in packages/babel-types/src/validators/generated/index.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                  if (
                    nodeType === "Loop" ||
                    "DoWhileStatement" === nodeType ||
                    "ForInStatement" === nodeType ||
                    "ForStatement" === nodeType ||
                Severity: Major
                Found in packages/babel-types/src/validators/generated/index.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                    if (
                      nodeType === "Pattern" ||
                      "AssignmentPattern" === nodeType ||
                      "ArrayPattern" === nodeType ||
                      "ObjectPattern" === nodeType ||
                  Severity: Major
                  Found in packages/babel-types/src/validators/generated/index.js - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                  if (
                                    (privateNames.has(name) &&
                                      !privateNames.has(getName) &&
                                      !privateNames.has(setName)) ||
                                    (privateNames.has(name) &&
                    Severity: Major
                    Found in packages/babel-helper-create-class-features-plugin/src/index.js - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                        if (
                          this.format.minified &&
                          node.arguments.length === 0 &&
                          !node.optional &&
                          !t.isCallExpression(parent, { callee: node }) &&
                      Severity: Major
                      Found in packages/babel-generator/src/generators/expressions.js - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                          if (
                            nodeType === "TSTypeElement" ||
                            "TSCallSignatureDeclaration" === nodeType ||
                            "TSConstructSignatureDeclaration" === nodeType ||
                            "TSPropertySignature" === nodeType ||
                        Severity: Major
                        Found in packages/babel-types/src/validators/generated/index.js - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                            if (
                              t.isUnaryLike(parent) ||
                              t.isBinary(parent) ||
                              t.isConditionalExpression(parent, { test: node }) ||
                              t.isAwaitExpression(parent) ||
                          Severity: Major
                          Found in packages/babel-generator/src/node/parentheses.js - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if (
                                  (parent.isIfStatement() &&
                                    (self.key === "consequent" || self.key === "alternate")) ||
                                  (self.key === "body" &&
                                    (parent.isLoop() || parent.isArrowFunctionExpression()))
                            Severity: Major
                            Found in packages/babel-traverse/src/path/lib/removal-hooks.js - About 40 mins to fix

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

                              defineType("TSTypeReference", {
                                aliases: ["TSType"],
                                visitor: ["typeName", "typeParameters"],
                                fields: {
                                  typeName: validateType("TSEntityName"),
                              Severity: Major
                              Found in packages/babel-types/src/definitions/typescript.js and 7 other locations - About 40 mins to fix
                              packages/babel-types/src/definitions/flow.js on lines 532..539
                              packages/babel-types/src/definitions/flow.js on lines 541..548
                              packages/babel-types/src/definitions/typescript.js on lines 66..73
                              packages/babel-types/src/definitions/typescript.js on lines 282..289
                              packages/babel-types/src/definitions/typescript.js on lines 315..322
                              packages/babel-types/src/definitions/typescript.js on lines 355..362
                              packages/babel-types/src/definitions/typescript.js on lines 364..371

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

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

                              defineType("TSTypeAssertion", {
                                aliases: ["Expression"],
                                visitor: ["typeAnnotation", "expression"],
                                fields: {
                                  typeAnnotation: validateType("TSType"),
                              Severity: Major
                              Found in packages/babel-types/src/definitions/typescript.js and 7 other locations - About 40 mins to fix
                              packages/babel-types/src/definitions/flow.js on lines 532..539
                              packages/babel-types/src/definitions/flow.js on lines 541..548
                              packages/babel-types/src/definitions/typescript.js on lines 66..73
                              packages/babel-types/src/definitions/typescript.js on lines 167..174
                              packages/babel-types/src/definitions/typescript.js on lines 282..289
                              packages/babel-types/src/definitions/typescript.js on lines 315..322
                              packages/babel-types/src/definitions/typescript.js on lines 355..362

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

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

                              defineType("EnumStringMember", {
                                aliases: ["EnumMember"],
                                visitor: ["id", "init"],
                                fields: {
                                  id: validateType("Identifier"),
                              Severity: Major
                              Found in packages/babel-types/src/definitions/flow.js and 7 other locations - About 40 mins to fix
                              packages/babel-types/src/definitions/flow.js on lines 532..539
                              packages/babel-types/src/definitions/typescript.js on lines 66..73
                              packages/babel-types/src/definitions/typescript.js on lines 167..174
                              packages/babel-types/src/definitions/typescript.js on lines 282..289
                              packages/babel-types/src/definitions/typescript.js on lines 315..322
                              packages/babel-types/src/definitions/typescript.js on lines 355..362
                              packages/babel-types/src/definitions/typescript.js on lines 364..371

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

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

                                    if (this.isRelational("<")) {
                                      node.typeParameters = this.flowParseTypeParameterInstantiation();
                                    } else {
                                      node.typeParameters = null;
                                    }
                              Severity: Major
                              Found in packages/babel-parser/src/plugins/flow.js and 4 other locations - About 40 mins to fix
                              packages/babel-parser/src/plugins/flow.js on lines 297..301
                              packages/babel-parser/src/plugins/flow.js on lines 577..581
                              packages/babel-parser/src/plugins/flow.js on lines 669..673
                              packages/babel-parser/src/plugins/flow.js on lines 2332..2336

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

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

                              defineType("TSAsExpression", {
                                aliases: ["Expression"],
                                visitor: ["expression", "typeAnnotation"],
                                fields: {
                                  expression: validateType("Expression"),
                              Severity: Major
                              Found in packages/babel-types/src/definitions/typescript.js and 7 other locations - About 40 mins to fix
                              packages/babel-types/src/definitions/flow.js on lines 532..539
                              packages/babel-types/src/definitions/flow.js on lines 541..548
                              packages/babel-types/src/definitions/typescript.js on lines 66..73
                              packages/babel-types/src/definitions/typescript.js on lines 167..174
                              packages/babel-types/src/definitions/typescript.js on lines 282..289
                              packages/babel-types/src/definitions/typescript.js on lines 315..322
                              packages/babel-types/src/definitions/typescript.js on lines 364..371

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

                              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 assertFunction(
                                loc: GeneralPath,
                                value: mixed,
                              ): Function | void {
                                if (value !== undefined && typeof value !== "function") {
                              Severity: Minor
                              Found in packages/babel-core/src/config/validation/option-assertions.js and 2 other locations - About 40 mins to fix
                              packages/babel-core/src/config/validation/option-assertions.js on lines 171..176
                              packages/babel-core/src/config/validation/option-assertions.js on lines 188..193

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

                              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