Showing 1,982 of 1,982 total issues

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

function pushComputedPropsSpec(path, file) {
  const { node, scope, parent } = path;
  const left = node.left;
  let declar;

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

    export function getBindingIdentifierPaths(
      duplicates?: boolean = false,
      outerOnly?: boolean = false,
    ): { [string]: NodePath } {
      const path = this;
    Severity: Minor
    Found in packages/babel-traverse/src/path/family.js - About 1 hr to fix

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

      function validateNested(loc: NestingPath, opts: {}) {
        const type = getSource(loc);
      
        assertNoDuplicateSourcemap(opts);
      
      
      Severity: Minor
      Found in packages/babel-core/src/config/validation/options.js - About 1 hr to fix

        Function validatePlugins has a Cognitive Complexity of 14 (exceeds 5 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: Minor
        Found in packages/babel-parser/src/plugin-utils.js - About 1 hr 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 transpileEnum has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function transpileEnum(path, t) {
          const { node } = path;
          if (node.const) {
            throw path.buildCodeFrameError("'const' enums are not supported.");
          }
        Severity: Minor
        Found in packages/babel-plugin-transform-typescript/src/enum.js - About 1 hr 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 readToken_numberSign has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          readToken_numberSign(): void {
            if (this.state.pos === 0 && this.readToken_interpreter()) {
              return;
            }
        
        
        Severity: Minor
        Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr 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 verifyBreakContinue has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          verifyBreakContinue(
            node: N.BreakStatement | N.ContinueStatement,
            keyword: string,
          ) {
            const isBreak = keyword === "break";
        Severity: Minor
        Found in packages/babel-parser/src/parser/statement.js - About 1 hr 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 checkDuplicatedProto has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          checkDuplicatedProto(
            prop: N.ObjectMember | N.SpreadElement,
            protoRef: { used: boolean },
            refExpressionErrors: ?ExpressionErrors,
          ): void {
        Severity: Minor
        Found in packages/babel-parser/src/parser/expression.js - About 1 hr 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 parseExport has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          parseExport(node: N.Node): N.AnyExport {
            const hasDefault = this.maybeParseExportDefaultSpecifier(node);
            const parseAfterDefault = !hasDefault || this.eat(tt.comma);
            const hasStar = parseAfterDefault && this.eatExportStar(node);
            const hasNamespace =
        Severity: Minor
        Found in packages/babel-parser/src/parser/statement.js - About 1 hr 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 cleanJSXElementLiteralChild has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function cleanJSXElementLiteralChild(
          child: { value: string },
          args: Array<Object>,
        ) {
          const lines = child.value.split(/\r\n|\n|\r/);
        Severity: Minor
        Found in packages/babel-types/src/utils/react/cleanJSXElementLiteralChild.js - About 1 hr 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 wrap has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function wrap(state, method, id, scope) {
          if (state.selfReference) {
            if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
              // we can just munge the local binding
              scope.rename(id.name);
        Severity: Minor
        Found in packages/babel-helper-function-name/src/index.js - About 1 hr 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 isReferenced has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

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

          printJoin(nodes: ?Array, parent: Object, opts = {}) {
            if (!nodes?.length) return;
        
            if (opts.indent) this.indent();
        
        
        Severity: Minor
        Found in packages/babel-generator/src/printer.js - About 1 hr 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 getTokenType has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function getTokenType(match) {
          const [offset, text] = match.slice(-2);
          const token = matchToToken(match);
        
          if (token.type === "name") {
        Severity: Minor
        Found in packages/babel-highlight/src/index.js - About 1 hr 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 VariableDeclaration has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function VariableDeclaration(node: Object, parent: Object) {
          if (node.declare) {
            // TS
            this.word("declare");
            this.space();
        Severity: Minor
        Found in packages/babel-generator/src/generators/statements.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function crawl(node, state = {}) {
          if (t.isMemberExpression(node) || t.isOptionalMemberExpression(node)) {
            crawl(node.object, state);
            if (node.computed) crawl(node.property, state);
          } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {
        Severity: Minor
        Found in packages/babel-generator/src/node/whitespace.js - About 1 hr 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 _guessExecutionStatusRelativeToDifferentFunctions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function _guessExecutionStatusRelativeToDifferentFunctions(
          target: NodePath,
        ): RelativeExecutionStatus {
          if (
            !target.isFunctionDeclaration() ||
        Severity: Minor
        Found in packages/babel-traverse/src/path/introspection.js - About 1 hr 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 _getTypeAnnotation has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function _getTypeAnnotation(): ?Object {
          const node = this.node;
        
          if (!node) {
            // handle initializerless variables, add in checks for loop initializers too
        Severity: Minor
        Found in packages/babel-traverse/src/path/inference/index.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function (classPath) {
          classPath.assertClass();
        
          const memoisedExpressions = [];
        
        
        Severity: Minor
        Found in packages/babel-helper-explode-class/src/index.js - About 1 hr 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 inferAnnotationFromBinaryExpression has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function inferAnnotationFromBinaryExpression(name, path) {
          const operator = path.node.operator;
        
          const right = path.get("right").resolve();
          const left = path.get("left").resolve();
        Severity: Minor
        Found in packages/babel-traverse/src/path/inference/inferer-reference.js - About 1 hr 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

        Severity
        Category
        Status
        Source
        Language