Showing 1,982 of 1,982 total issues

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

function processOptions(options) {
  // Parse preset names
  const presets = (options.presets || []).map(presetName => {
    const preset = loadBuiltin(availablePresets, presetName);

Severity: Minor
Found in packages/babel-standalone/src/index.js - About 1 hr to fix

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

    export default function parseAndBuildMetadata<T>(
      formatter: Formatter<T>,
      code: string,
      opts: TemplateOpts,
    ): Metadata {
    Severity: Minor
    Found in packages/babel-template/src/parse.js - About 1 hr to fix

      Function assertPluginItem has 32 lines of code (exceeds 25 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 1 hr to fix

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

          async function files(filenames: Array<string>): Promise<void> {
            if (!cliOptions.skipInitialBuild) {
              await walk(filenames);
            }
        
        
        Severity: Minor
        Found in packages/babel-cli/src/babel/file.js - About 1 hr to fix

          Function default has 32 lines of code (exceeds 25 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

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

            export function insertBefore(nodes) {
              this._assertUnremoved();
            
              nodes = this._verifyNodeList(nodes);
            
            
            Severity: Minor
            Found in packages/babel-traverse/src/path/modification.js - About 1 hr to fix

              Function getObjRef has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              function getObjRef(node, nodes, file, scope) {
                let ref;
                if (t.isSuper(node)) {
                  // Super cannot be directly assigned so lets return it directly
                  return node;
              Severity: Minor
              Found in packages/babel-helper-explode-assignable-expression/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 default has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function (
                path: NodePath,
                scope = path.scope,
                shouldHoistVariables = true,
              ) {
              Severity: Minor
              Found in packages/babel-helper-call-delegate/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 convertProgramNode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              function convertProgramNode(ast) {
                ast.type = "Program";
                ast.sourceType = ast.program.sourceType;
                ast.body = ast.program.body;
                delete ast.program;
              Severity: Minor
              Found in eslint/babel-eslint-parser/src/convert/convertAST.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 readString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                readString(quote: number): void {
                  let out = "",
                    chunkStart = ++this.state.pos;
                  for (;;) {
                    if (this.state.pos >= this.length) {
              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 maybeParseModuleAttributes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                maybeParseModuleAttributes() {
                  if (this.match(tt._with) && !this.hasPrecedingLineBreak()) {
                    this.expectPlugin("moduleAttributes");
                    this.next();
                  } else {
              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 parseExprList has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                parseExprList(
                  close: TokenType,
                  allowEmpty?: boolean,
                  refExpressionErrors?: ?ExpressionErrors,
                  nodeForExtra?: ?N.Node,
              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 parseForIn has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                parseForIn(
                  node: N.ForInOf,
                  init: N.VariableDeclaration | N.AssignmentPattern,
                  awaitAt: number,
                ): N.ForInOf {
              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 assertShape has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function assertShape(shape: { [string]: FieldOptions }): Validator {
                function validate(node, key, val) {
                  const errors = [];
                  for (const property of Object.keys(shape)) {
                    try {
              Severity: Minor
              Found in packages/babel-types/src/definitions/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 buildPrivateNamesMap has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function buildPrivateNamesMap(props) {
                const privateNamesMap = new Map();
                for (const prop of props) {
                  const isPrivate = prop.isPrivate();
                  const isMethod = !prop.isProperty();
              Severity: Minor
              Found in packages/babel-helper-create-class-features-plugin/src/fields.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 processOptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              function processOptions(options) {
                // Parse preset names
                const presets = (options.presets || []).map(presetName => {
                  const preset = loadBuiltin(availablePresets, presetName);
              
              
              Severity: Minor
              Found in packages/babel-standalone/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 buildPrivateNamesNodes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function buildPrivateNamesNodes(privateNamesMap, loose, state) {
                const initNodes = [];
              
                for (const [name, value] of privateNamesMap) {
                  // In loose mode, both static and instance fields are transpiled using a
              Severity: Minor
              Found in packages/babel-helper-create-class-features-plugin/src/fields.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 ArrowFunctionExpression has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export function ArrowFunctionExpression(node: Object) {
                if (node.async) {
                  this.word("async");
                  this.space();
                }
              Severity: Minor
              Found in packages/babel-generator/src/generators/methods.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 generateMissingPluginMessage has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function generateMissingPluginMessage(
                missingPluginName: string,
                loc: { line: number, column: number },
                codeFrame: string,
              ): string {
              Severity: Minor
              Found in packages/babel-core/src/parser/util/missing-plugin-helper.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 optimiseIndexGetter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              function optimiseIndexGetter(path, argsId, offset) {
                const offsetLiteral = t.numericLiteral(offset);
                let index;
              
                if (t.isNumericLiteral(path.parent.property)) {
              Severity: Minor
              Found in packages/babel-plugin-transform-parameters/src/rest.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