Showing 1,251 of 1,982 total issues

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

        exit(path, { requireId }) {
          if (!isModule(path)) {
            if (requireId) {
              injectWrapper(
                path,
Severity: Major
Found in packages/babel-plugin-transform-modules-amd/src/index.js - About 2 hrs to fix

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

            exit(path, state) {
              const { node, parent, scope } = path;
              let hasComputed = false;
              for (const prop of (node.properties: Array<Object>)) {
                hasComputed = prop.computed === true;
    Severity: Major
    Found in packages/babel-plugin-transform-computed-properties/src/index.js - About 2 hrs to fix

      Function parseForStatement has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        parseForStatement(node: N.Node): N.ForLike {
          this.next();
          this.state.labels.push(loopLabel);
      
          let awaitAt = -1;
      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 exit has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

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

      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 19 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function ({ node, parent, scope, id }, localBinding = false) {
        // has an `id` so we don't need to infer one
        if (node.id) return;
      
        if (
      Severity: Minor
      Found in packages/babel-helper-function-name/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 createDescriptor has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      export function createDescriptor(
        pair: PluginItem,
        dirname: string,
        {
          type,
      Severity: Minor
      Found in packages/babel-core/src/config/config-descriptors.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 assertPluginItem has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      function assertPluginItem(loc: GeneralPath, value: mixed): PluginItem {
        if (Array.isArray(value)) {
          if (value.length === 0) {
            throw new Error(`${msg(loc)} must include an object`);
          }
      Severity: Minor
      Found in packages/babel-core/src/config/validation/option-assertions.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 registerBinding has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

        registerBinding(kind: string, path: NodePath, bindingPath = path) {
          if (!kind) throw new ReferenceError("no `kind`");
      
          if (path.isVariableDeclaration()) {
            const declarators: Array<NodePath> = path.get("declarations");
      Severity: Minor
      Found in packages/babel-traverse/src/scope/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 getDeepestCommonAncestorFrom has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      export function getDeepestCommonAncestorFrom(
        paths: Array<NodePath>,
        filter?: Function,
      ): NodePath {
        if (!paths.length) {
      Severity: Minor
      Found in packages/babel-traverse/src/path/ancestry.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 plugins.js has 274 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: Minor
      Found in packages/babel-standalone/src/generated/plugins.js - About 2 hrs to fix

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

                exit(path, state) {
                  if (!isModule(path)) return;
        
                  // Rename the bindings auto-injected into the scope so there is no
                  // risk of conflict between the bindings.
        Severity: Major
        Found in packages/babel-plugin-transform-modules-commonjs/src/index.js - About 2 hrs to fix

          Function validatePlugins has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function validatePlugins(plugins: PluginList) {
            if (hasPlugin(plugins, "decorators")) {
              if (hasPlugin(plugins, "decorators-legacy")) {
                throw new Error(
                  "Cannot use the decorators and decorators-legacy plugin together",
          Severity: Major
          Found in packages/babel-parser/src/plugin-utils.js - About 2 hrs to fix

            Function explode has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function explode(visitor) {
              if (visitor._exploded) return visitor;
              visitor._exploded = true;
            
              // normalise pipes
            Severity: Major
            Found in packages/babel-traverse/src/visitors.js - About 2 hrs to fix

              Function flowParseObjectTypeProperty has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  flowParseObjectTypeProperty(
                    node: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,
                    isStatic: boolean,
                    protoStart: ?number,
                    variance: ?N.FlowVariance,
              Severity: Major
              Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

                Function toAssignable has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  toAssignable(node: Node): Node {
                    let parenthesized = undefined;
                    if (node.type === "ParenthesizedExpression" || node.extra?.parenthesized) {
                      parenthesized = unwrapParenthesizedExpression(node);
                      if (
                Severity: Major
                Found in packages/babel-parser/src/parser/lval.js - About 2 hrs to fix

                  Function isStatement has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function isStatement(node: ?Object, opts?: Object): boolean {
                    if (!node) return false;
                  
                    const nodeType = node.type;
                    if (
                  Severity: Major
                  Found in packages/babel-types/src/validators/generated/index.js - About 2 hrs to fix

                    Function cloneNode has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function cloneNode<T: Object>(
                      node: T,
                      deep: boolean = true,
                      withoutLoc: boolean = false,
                    ): T {
                    Severity: Major
                    Found in packages/babel-types/src/clone/cloneNode.js - About 2 hrs to fix

                      Function flowParseDeclareModule has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule {
                            this.scope.enter(SCOPE_OTHER);
                      
                            if (this.match(tt.string)) {
                              node.id = this.parseExprAtom();
                      Severity: Major
                      Found in packages/babel-parser/src/plugins/flow.js - About 2 hrs to fix

                        File utils.js has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        // @flow
                        import is from "../validators/is";
                        import { validateField, validateChild } from "../validators/validate";
                        
                        export const VISITOR_KEYS: { [string]: Array<string> } = {};
                        Severity: Minor
                        Found in packages/babel-types/src/definitions/utils.js - About 2 hrs to fix

                          Function VariableDeclaration has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                VariableDeclaration(path) {
                                  const { node, scope, parent } = path;
                                  if (t.isForXStatement(parent)) return;
                                  if (!parent || !path.container) return; // i don't know why this is necessary - TODO
                                  if (!variableDeclarationHasPattern(node)) return;
                          Severity: Major
                          Found in packages/babel-plugin-transform-destructuring/src/index.js - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language