Showing 1,251 of 1,982 total issues

Consider simplifying this complex logical expression.
Open

  if (
    nodeType === "Expression" ||
    "ArrayExpression" === nodeType ||
    "AssignmentExpression" === nodeType ||
    "BinaryExpression" === nodeType ||
Severity: Critical
Found in packages/babel-types/src/validators/generated/index.js - About 1 day to fix

    Function default has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (
      _: any,
      {
        corejs,
        include,
    Severity: Minor
    Found in packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function default has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (
      { types: t }: { types: Object },
      { include, exclude, polyfillTargets, debug }: InternalPluginOptions,
    ) {
      const polyfills = filterItems(
    Severity: Minor
    Found in packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    StatementParser has 86 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class StatementParser extends ExpressionParser {
      // ### Statement parsing
    
      // Parse a program. Initializes the parser, reads any number of
      // statements, and wraps them in a Program node.  Optionally takes a
    Severity: Major
    Found in packages/babel-parser/src/parser/statement.js - About 1 day to fix

      Function default has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function (opts) {
        const visitor = {};
      
        visitor.JSXNamespacedName = function (path) {
          if (opts.throwIfNamespace) {
      Severity: Minor
      Found in packages/babel-helper-builder-react-jsx/src/index.js - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File es2015.js has 694 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // @flow
      import defineType, {
        assertShape,
        assertNodeType,
        assertValueType,
      Severity: Major
      Found in packages/babel-types/src/definitions/es2015.js - About 1 day to fix

        File index.js has 683 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { declare } from "@babel/helper-plugin-utils";
        import type NodePath from "@babel/traverse";
        import type Scope from "@babel/traverse";
        import { visitor as tdzVisitor } from "./tdz";
        import values from "lodash/values";
        Severity: Major
        Found in packages/babel-plugin-transform-block-scoping/src/index.js - About 1 day to fix

          File index.js has 673 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import * as t from "@babel/types";
          import { addNamed, addNamespace, isModule } from "@babel/helper-module-imports";
          import annotateAsPure from "@babel/helper-annotate-as-pure";
          
          const DEFAULT = {
          Severity: Major
          Found in packages/babel-helper-builder-react-jsx-experimental/src/index.js - About 1 day to fix

            Function handle has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
            Open

              handle(member) {
                const { node, parent, parentPath } = member;
            
                if (member.isOptionalMemberExpression()) {
                  // Transforming optional chaining requires we replace ancestors.
            Severity: Minor
            Found in packages/babel-helper-member-expression-to-functions/src/index.js - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function createClassFeaturePlugin has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
            Open

            export function createClassFeaturePlugin({
              name,
              feature,
              loose,
              manipulateOptions,
            Severity: Minor
            Found in packages/babel-helper-create-class-features-plugin/src/index.js - About 1 day to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function exit has 300 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    exit(path, state) {
                      const undefinedIdent = path.scope.buildUndefinedNode();
                      const exportIdent = path.scope.generateUid("export");
                      const contextIdent = state.contextIdent;
            
            
            Severity: Major
            Found in packages/babel-plugin-transform-modules-systemjs/src/index.js - About 1 day to fix

              File fields.js has 662 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { template, traverse, types as t } from "@babel/core";
              import ReplaceSupers, {
                environmentVisitor,
              } from "@babel/helper-replace-supers";
              import memberExpressionToFunctions from "@babel/helper-member-expression-to-functions";
              Severity: Major
              Found in packages/babel-helper-create-class-features-plugin/src/fields.js - About 1 day to fix

                Function processComment has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
                Open

                  processComment(node: Node): void {
                    if (node.type === "Program" && node.body.length > 0) return;
                
                    const stack = this.state.commentStack;
                
                
                Severity: Minor
                Found in packages/babel-parser/src/parser/comments.js - About 1 day to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Consider simplifying this complex logical expression.
                Open

                  } else if (
                    type === tt.semi ||
                    type === tt.comma ||
                    type === tt.parenL ||
                    type === tt.parenR ||
                Severity: Critical
                Found in eslint/babel-eslint-parser/src/convert/convertTokens.js - About 1 day to fix

                  ExpressionParser has 76 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  export default class ExpressionParser extends LValParser {
                    // Forward-declaration: defined in statement.js
                    /*::
                    +parseBlock: (
                      allowDirectives?: boolean,
                  Severity: Major
                  Found in packages/babel-parser/src/parser/expression.js - About 1 day to fix

                    Function convertFunctionParams has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function convertFunctionParams(
                      path,
                      loose,
                      shouldTransformParam,
                      replaceRestElement,
                    Severity: Minor
                    Found in packages/babel-plugin-transform-parameters/src/params.js - About 1 day to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function _evaluate has 263 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function _evaluate(path, state) {
                      if (!state.confident) return;
                    
                      const { node } = path;
                    
                    
                    Severity: Major
                    Found in packages/babel-traverse/src/path/evaluation.js - About 1 day to fix

                      Consider simplifying this complex logical expression.
                      Open

                        if (
                          nodeType === "TSType" ||
                          "TSAnyKeyword" === nodeType ||
                          "TSBooleanKeyword" === nodeType ||
                          "TSBigIntKeyword" === nodeType ||
                      Severity: Critical
                      Found in packages/babel-types/src/validators/generated/index.js - About 1 day to fix

                        File config-chain.js has 596 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        // @flow
                        
                        import path from "path";
                        import buildDebug from "debug";
                        import type { Handler } from "gensync";
                        Severity: Major
                        Found in packages/babel-core/src/config/config-chain.js - About 1 day to fix

                          Function parseExprAtom has 239 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            parseExprAtom(refExpressionErrors?: ?ExpressionErrors): N.Expression {
                              // If a division operator appears in an expression position, the
                              // tokenizer got confused, and we force it to read a regexp instead.
                              if (this.state.type === tt.slash) this.readRegexp();
                          
                          
                          Severity: Major
                          Found in packages/babel-parser/src/parser/expression.js - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language