Showing 1,251 of 1,982 total issues

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

// @flow
/*
 * This file is auto-generated! Do not modify it directly.
 * To re-generate run 'make build'
 */
Severity: Major
Found in packages/babel-types/src/validators/generated/index.js - About 1 wk to fix

    File flow.js has 2874 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // @flow
    
    /*:: declare var invariant; */
    
    import type Parser from "../parser";
    Severity: Major
    Found in packages/babel-parser/src/plugins/flow.js - About 1 wk to fix

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

      // @flow
      
      /*:: declare var invariant; */
      
      import type { TokenType } from "../../tokenizer/types";
      Severity: Major
      Found in packages/babel-parser/src/plugins/typescript/index.js - About 5 days to fix

        File expression.js has 1967 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // @flow
        
        // A recursive descent parser operates by defining functions for all
        // syntactic elements, and recursively calling those, each function
        // advancing the input stream and returning an AST node. Precedence
        Severity: Major
        Found in packages/babel-parser/src/parser/expression.js - About 5 days to fix

          Function helper has a Cognitive Complexity of 244 (exceeds 5 allowed). Consider refactoring.
          Open

          export function helper(babel, options) {
            const FILE_NAME_VAR = "_jsxFileName";
          
            const JSX_SOURCE_ANNOTATION_REGEX = /\*?\s*@jsxImportSource\s+([^\s]+)/;
            const JSX_RUNTIME_ANNOTATION_REGEX = /\*?\s*@jsxRuntime\s+([^\s]+)/;
          Severity: Minor
          Found in packages/babel-helper-builder-react-jsx-experimental/src/index.js - About 5 days 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 statement.js has 1765 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // @flow
          
          import * as N from "../types";
          import { types as tt, type TokenType } from "../tokenizer/types";
          import ExpressionParser from "./expression";
          Severity: Major
          Found in packages/babel-parser/src/parser/statement.js - About 4 days to fix

            File helpers.js has 1587 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // @flow
            
            import template from "@babel/template";
            
            const helpers = Object.create(null);
            Severity: Major
            Found in packages/babel-helpers/src/helpers.js - About 4 days to fix

              Function helper has 662 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function helper(babel, options) {
                const FILE_NAME_VAR = "_jsxFileName";
              
                const JSX_SOURCE_ANNOTATION_REGEX = /\*?\s*@jsxImportSource\s+([^\s]+)/;
                const JSX_RUNTIME_ANNOTATION_REGEX = /\*?\s*@jsxRuntime\s+([^\s]+)/;
              Severity: Major
              Found in packages/babel-helper-builder-react-jsx-experimental/src/index.js - About 3 days to fix

                Function transformClass has a Cognitive Complexity of 160 (exceeds 5 allowed). Consider refactoring.
                Open

                export default function transformClass(
                  path: NodePath,
                  file: any,
                  builtinClasses: ReadonlySet<string>,
                  isLoose: boolean,
                Severity: Minor
                Found in packages/babel-plugin-transform-classes/src/transformClass.js - About 3 days 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 index.js has 1242 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // @flow
                
                /*:: declare var invariant; */
                
                import type { Options } from "../options";
                Severity: Major
                Found in packages/babel-parser/src/tokenizer/index.js - About 3 days to fix

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

                  // @flow
                  /*
                   * This file is auto-generated! Do not modify it directly.
                   * To re-generate run 'make build'
                   */
                  Severity: Major
                  Found in packages/babel-types/src/asserts/generated/index.js - About 3 days to fix

                    File types.js has 1100 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // @flow
                    
                    import type { SourceType } from "./options";
                    import type { Token } from "./tokenizer";
                    import type { SourceLocation } from "./util/location";
                    Severity: Major
                    Found in packages/babel-parser/src/types.js - About 2 days to fix

                      Function transformClass has 532 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function transformClass(
                        path: NodePath,
                        file: any,
                        builtinClasses: ReadonlySet<string>,
                        isLoose: boolean,
                      Severity: Major
                      Found in packages/babel-plugin-transform-classes/src/transformClass.js - About 2 days to fix

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

                        // @flow
                        /*
                         * This file is auto-generated! Do not modify it directly.
                         * To re-generate run 'make build'
                         */
                        Severity: Major
                        Found in packages/babel-types/src/builders/generated/index.js - About 2 days to fix

                          Function _evaluate has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function _evaluate(path, state) {
                            if (!state.confident) return;
                          
                            const { node } = path;
                          
                          
                          Severity: Minor
                          Found in packages/babel-traverse/src/path/evaluation.js - About 2 days 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 core.js has 1046 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          // @flow
                          
                          import is from "../validators/is";
                          import isValidIdentifier from "../validators/isValidIdentifier";
                          import { isKeyword, isReservedWord } from "@babel/helper-validator-identifier";
                          Severity: Major
                          Found in packages/babel-types/src/definitions/core.js - About 2 days to fix

                            Consider simplifying this complex logical expression.
                            Open

                              if (
                                nodeType === "Flow" ||
                                "AnyTypeAnnotation" === nodeType ||
                                "ArrayTypeAnnotation" === nodeType ||
                                "BooleanTypeAnnotation" === nodeType ||
                            Severity: Critical
                            Found in packages/babel-types/src/validators/generated/index.js - About 2 days to fix

                              Function _generateImport has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
                              Open

                                _generateImport(opts, importName) {
                                  const isDefault = importName === "default";
                                  const isNamed = !!importName && !isDefault;
                                  const isNamespace = importName === null;
                              
                              
                              Severity: Minor
                              Found in packages/babel-helper-module-imports/src/import-injector.js - About 2 days 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

                                if (
                                  nodeType === "Statement" ||
                                  "BlockStatement" === nodeType ||
                                  "BreakStatement" === nodeType ||
                                  "ContinueStatement" === nodeType ||
                              Severity: Critical
                              Found in packages/babel-types/src/validators/generated/index.js - About 2 days to fix

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

                                import includes from "lodash/includes";
                                import repeat from "lodash/repeat";
                                import Renamer from "./lib/renamer";
                                import type NodePath from "../path";
                                import traverse from "../index";
                                Severity: Major
                                Found in packages/babel-traverse/src/scope/index.js - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language