Showing 1,251 of 1,982 total issues

Function parseMaybeAssign has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  parseMaybeAssign(
    noIn?: ?boolean,
    refExpressionErrors?: ?ExpressionErrors,
    afterLeftParse?: Function,
    refNeedsArrowPos?: ?Pos,
Severity: Major
Found in packages/babel-parser/src/parser/expression.js - About 2 hrs to fix

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

    import * as t from "@babel/types";
    
    class AssignmentMemoiser {
      constructor() {
        this._map = new WeakMap();
    Severity: Minor
    Found in packages/babel-helper-member-expression-to-functions/src/index.js - About 2 hrs to fix

      Function push has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function push(
        mutatorMap: Object,
        node: Object,
        kind: string,
        file,
      Severity: Major
      Found in packages/babel-helper-define-map/src/index.js - About 2 hrs to fix

        Function codeFrameColumns has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function codeFrameColumns(
          rawLines: string,
          loc: NodeLocation,
          opts: Object = {},
        ): string {
        Severity: Major
        Found in packages/babel-code-frame/src/index.js - About 2 hrs to fix

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

                Function(path) {
                  const params = path.get("params");
                  const paramsWithRestElement = new Set();
                  const idsInRestParams = new Set();
                  for (let i = 0; i < params.length; ++i) {
          Severity: Major
          Found in packages/babel-plugin-proposal-object-rest-spread/src/index.js - About 2 hrs to fix

            Function plainFunction has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function plainFunction(path: NodePath, callId: Object) {
              const node = path.node;
              const isDeclaration = path.isFunctionDeclaration();
              const functionId = node.id;
              const wrapper = isDeclaration
            Severity: Minor
            Found in packages/babel-helper-wrap-function/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 convertToken has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function convertToken(token, source) {
              const type = token.type;
              token.range = [token.start, token.end];
            
              if (type === tt.name) {
            Severity: Minor
            Found in eslint/babel-eslint-parser/src/convert/convertTokens.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 checkReservedWord has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              checkReservedWord(
                word: string,
                startLoc: number,
                checkKeywords: boolean,
                isBinding: boolean,
            Severity: Minor
            Found in packages/babel-parser/src/parser/expression.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 parseObjectMember has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              parseObjectMember(
                isPattern: boolean,
                refExpressionErrors?: ?ExpressionErrors,
              ): N.ObjectMember | N.SpreadElement | N.RestElement {
                let decorators = [];
            Severity: Minor
            Found in packages/babel-parser/src/parser/expression.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 toAssignable has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              toAssignable(node: Node): Node {
                let parenthesized = undefined;
                if (node.type === "ParenthesizedExpression" || node.extra?.parenthesized) {
                  parenthesized = unwrapParenthesizedExpression(node);
                  if (
            Severity: Minor
            Found in packages/babel-parser/src/parser/lval.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 toAssignableList has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              toAssignableList(
                exprList: Expression[],
                trailingCommaPos?: ?number,
              ): $ReadOnlyArray<Pattern> {
                let end = exprList.length;
            Severity: Minor
            Found in packages/babel-parser/src/parser/lval.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 isBinding has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function isBinding(
              node: Object,
              parent: Object,
              grandparent?: Object,
            ): boolean {
            Severity: Minor
            Found in packages/babel-types/src/validators/isBinding.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 verifyUsedFeatures has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            export function verifyUsedFeatures(path, file) {
              if (hasOwnDecorators(path.node)) {
                if (!hasFeature(file, FEATURES.decorators)) {
                  throw path.buildCodeFrameError(
                    "Decorators are not enabled." +
            Severity: Minor
            Found in packages/babel-helper-create-class-features-plugin/src/features.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 ObjectTypeAnnotation has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            export function ObjectTypeAnnotation(node: Object) {
              if (node.exact) {
                this.token("{|");
              } else {
                this.token("{");
            Severity: Minor
            Found in packages/babel-generator/src/generators/flow.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 crawl has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              crawl() {
                const path = this.path;
            
                this.references = Object.create(null);
                this.bindings = Object.create(null);
            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 replaceWith has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            export function replaceWith(replacement) {
              this.resync();
            
              if (this.removed) {
                throw new Error("You can't replace this node, we've already removed it");
            Severity: Minor
            Found in packages/babel-traverse/src/path/replacement.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 getScopeInformation has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            function getScopeInformation(fnPath) {
              const thisPaths = [];
              const argumentsPaths = [];
              const newTargetPaths = [];
              const superProps = [];
            Severity: Minor
            Found in packages/babel-traverse/src/path/conversion.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 wrapClosure has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              wrapClosure() {
                if (this.throwIfClosureRequired) {
                  throw this.blockPath.buildCodeFrameError(
                    "Compiling let/const in this block would add a closure " +
                      "(throwIfClosureRequired).",
            Severity: Minor
            Found in packages/babel-plugin-transform-block-scoping/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 parseMaybeAssign has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                parseMaybeAssign(...args): N.Expression {
                  // Note: When the JSX plugin is on, type assertions (`<T> x`) aren't valid syntax.
            
                  let state: ?State;
                  let jsx;
            Severity: Major
            Found in packages/babel-parser/src/plugins/typescript/index.js - About 2 hrs to fix

              Function checkExport has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                checkExport(
                  node: N.ExportNamedDeclaration,
                  checkNames?: boolean,
                  isDefault?: boolean,
                  isFrom?: boolean,
              Severity: Major
              Found in packages/babel-parser/src/parser/statement.js - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language