Showing 1,251 of 1,982 total issues

Function VariableDeclarator has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      VariableDeclarator(path, file) {
        if (!path.get("id").isObjectPattern()) {
          return;
        }

Severity: Major
Found in packages/babel-plugin-proposal-object-rest-spread/src/index.js - About 3 hrs to fix

    Function flowEnumBody has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        flowEnumBody(node: N.Node, { enumName, nameLoc }): N.Node {
          const explicitType = this.flowEnumParseExplicitType({ enumName });
          this.expect(tt.braceL);
          const members = this.flowEnumMembers({ enumName, explicitType });
    
    
    Severity: Major
    Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

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

          exit(path) {
            const {
              scope,
              seen,
              imported,

        Function buildJSXElementCall has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function buildJSXElementCall(path, file) {
            const openingPath = path.get("openingElement");
            openingPath.parent.children = t.react.buildChildren(openingPath.parent);
        
            const tagExpr = convertJSXIdentifier(
        Severity: Major
        Found in packages/babel-helper-builder-react-jsx-experimental/src/index.js - About 2 hrs to fix

          File options.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // @flow
          
          import fs from "fs";
          
          import commander from "commander";
          Severity: Minor
          Found in packages/babel-cli/src/babel/options.js - About 2 hrs to fix

            Function convertNodes has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function convertNodes(ast, code) {
              const astTransformVisitor = {
                noScope: true,
                enter(path) {
                  const { node } = path;
            Severity: Major
            Found in eslint/babel-eslint-parser/src/convert/convertAST.js - About 2 hrs to fix

              Function Program has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      Program(path, state) {
                        const { file } = state;
                        let fileJsxPragma = null;
              
                        if (!GLOBAL_TYPES.has(path.node)) {
              Severity: Major
              Found in packages/babel-plugin-transform-typescript/src/index.js - About 2 hrs to fix

                Function CallExpression has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      CallExpression(path) {
                        if (!hasArgumentPlaceholder(path.node)) {
                          return;
                        }
                        const { node, scope } = path;
                Severity: Major
                Found in packages/babel-plugin-proposal-partial-application/src/index.js - About 2 hrs to fix

                  Function isReactCall has a Cognitive Complexity of 21 (exceeds 5 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 2 hrs 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 parseSwitchStatement has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                    parseSwitchStatement(node: N.SwitchStatement): N.SwitchStatement {
                      this.next();
                      node.discriminant = this.parseHeaderExpression();
                      const cases = (node.cases = []);
                      this.expect(tt.braceL);
                  Severity: Minor
                  Found in packages/babel-parser/src/parser/statement.js - About 2 hrs 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 transformFile has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function* transformFile(file: File, pluginPasses: PluginPasses): Handler<void> {
                    for (const pluginPairs of pluginPasses) {
                      const passPairs = [];
                      const passes = [];
                      const visitors = [];
                  Severity: Minor
                  Found in packages/babel-core/src/transformation/index.js - About 2 hrs 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 resolveStandardizedName has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function resolveStandardizedName(
                    type: "plugin" | "preset",
                    name: string,
                    dirname: string = process.cwd(),
                  ) {
                  Severity: Minor
                  Found in packages/babel-core/src/config/files/plugins.js - About 2 hrs 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 applyTargetDecorators has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function applyTargetDecorators(path, state, decoratedProps) {
                    const name = path.scope.generateDeclaredUidIdentifier(
                      path.isClass() ? "class" : "obj",
                    );
                  
                  
                  Severity: Minor
                  Found in packages/babel-plugin-proposal-decorators/src/transformer-legacy.js - About 2 hrs 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 verify has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function verify(visitor) {
                    if (visitor._verified) return;
                  
                    if (typeof visitor === "function") {
                      throw new Error(
                  Severity: Minor
                  Found in packages/babel-traverse/src/visitors.js - About 2 hrs 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 config-descriptors.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // @flow
                  
                  import { loadPlugin, loadPreset } from "./files";
                  
                  import { getItemDescriptor } from "./item";
                  Severity: Minor
                  Found in packages/babel-core/src/config/config-descriptors.js - About 2 hrs to fix

                    Function parseImportSpecifier has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        parseImportSpecifier(node: N.ImportDeclaration): void {
                          const specifier = this.startNode();
                          const firstIdentLoc = this.state.start;
                          const firstIdent = this.parseIdentifier(true);
                    
                    
                    Severity: Major
                    Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

                      Function placeholderVisitorHandler has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function placeholderVisitorHandler(
                        node: BabelNode,
                        ancestors: TraversalAncestors,
                        state: MetadataState,
                      ) {
                      Severity: Major
                      Found in packages/babel-template/src/parse.js - About 2 hrs to fix

                        Function readEscapedChar has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          readEscapedChar(inTemplate: boolean): string | null {
                            const throwOnInvalid = !inTemplate;
                            const ch = this.input.charCodeAt(++this.state.pos);
                            ++this.state.pos;
                            switch (ch) {
                        Severity: Major
                        Found in packages/babel-parser/src/tokenizer/index.js - About 2 hrs to fix

                          Function convertTemplateType has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function convertTemplateType(tokens) {
                            let curlyBrace = null;
                            let templateTokens = [];
                            const result = [];
                          
                          
                          Severity: Major
                          Found in eslint/babel-eslint-parser/src/convert/convertTokens.js - About 2 hrs to fix

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

                              parseExprOp(
                                left: N.Expression,
                                leftStartPos: number,
                                leftStartLoc: Position,
                                minPrec: number,
                            Severity: Major
                            Found in packages/babel-parser/src/parser/expression.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language