Showing 1,982 of 1,982 total issues

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

export function isFlowType(node: ?Object, opts?: Object): boolean {
  if (!node) return false;

  const nodeType = node.type;
  if (
Severity: Minor
Found in packages/babel-types/src/validators/generated/index.js - About 1 hr to fix

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

    export function* run(
      config: ResolvedConfig,
      code: string,
      ast: ?(BabelNodeFile | BabelNodeProgram),
    ): Handler<FileResult> {
    Severity: Minor
    Found in packages/babel-core/src/transformation/index.js - About 1 hr to fix

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

      function buildGlobal(whitelist) {
        const namespace = t.identifier("babelHelpers");
      
        const body = [];
        const container = t.functionExpression(
      Severity: Minor
      Found in packages/babel-core/src/tools/build-external-helpers.js - About 1 hr to fix

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

        export function ClassDeclaration(node: Object, parent: Object) {
          if (
            !this.format.decoratorsBeforeExport ||
            (!t.isExportDefaultDeclaration(parent) &&
              !t.isExportNamedDeclaration(parent))
        Severity: Minor
        Found in packages/babel-generator/src/generators/classes.js - About 1 hr to fix

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

          function resolveStandardizedName(
            type: "plugin" | "preset",
            name: string,
            dirname: string = process.cwd(),
          ) {
          Severity: Minor
          Found in packages/babel-core/src/config/files/plugins.js - About 1 hr to fix

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

            export function normalizeCoreJSOption(
              corejs?: CorejsOption,
              useBuiltIns: BuiltInsOption,
            ): NormalizedCorejsOption {
              let proposals = false;
            Severity: Minor
            Found in packages/babel-preset-env/src/normalize-options.js - About 1 hr to fix

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

              function getConditionalAnnotation(binding, path, name) {
                const ifStatement = getParentConditionalPath(binding, path, name);
                if (!ifStatement) return;
              
                const test = ifStatement.get("test");
              Severity: Minor
              Found in packages/babel-traverse/src/path/inference/inferer-reference.js - About 1 hr to fix

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

                  function buildElementCall(path, file) {
                    if (opts.filter && !opts.filter(path.node, file)) return;
                
                    const openingPath = path.get("openingElement");
                    openingPath.parent.children = t.react.buildChildren(openingPath.parent);
                Severity: Minor
                Found in packages/babel-helper-builder-react-jsx/src/index.js - About 1 hr to fix

                  Function getTargets has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function getTargets(
                    inputTargets: InputTargets = {},
                    options: Object = {},
                  ): Targets {
                    const targetOpts: Targets = {};
                  Severity: Minor
                  Found in packages/babel-helper-compilation-targets/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 isInDetachedTree has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function isInDetachedTree(path) {
                    while (path) {
                      if (path.isProgram()) break;
                  
                      const { parentPath, container, listKey } = path;
                  Severity: Minor
                  Found in packages/babel-helper-member-expression-to-functions/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 exports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports = function (api) {
                    const env = api.env();
                  
                    const includeCoverage = process.env.BABEL_COVERAGE === "true";
                  
                  
                  Severity: Minor
                  Found in babel.config.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 braceIsBlock has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    braceIsBlock(prevType: TokenType): boolean {
                      const parent = this.curContext();
                      if (parent === ct.functionExpression || parent === ct.functionStatement) {
                        return true;
                      }
                  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 parseObjectProperty has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    parseObjectProperty(
                      prop: N.ObjectProperty,
                      startPos: ?number,
                      startLoc: ?Position,
                      isPattern: boolean,
                  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 parseExportDefaultExpression has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    parseExportDefaultExpression(): N.Expression | N.Declaration {
                      const expr = this.startNode();
                  
                      const isAsync = this.isAsyncFunction();
                  
                  
                  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 getModuleName has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function getModuleName(
                    rootOpts: Object,
                    pluginOpts: Object,
                  ): ?string {
                    const {
                  Severity: Minor
                  Found in packages/babel-helper-module-transforms/src/get-module-name.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 TupleExpression has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function TupleExpression(node: Object) {
                    const elems = node.elements;
                    const len = elems.length;
                  
                    let startToken;
                  Severity: Minor
                  Found in packages/babel-generator/src/generators/types.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 traverseFast has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function traverseFast(
                    node: Object,
                    enter: (node: BabelNode, opts?: Object) => void,
                    opts?: Object,
                  ): void {
                  Severity: Minor
                  Found in packages/babel-types/src/traverse/traverseFast.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 isHelper has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function isHelper(node) {
                    if (t.isMemberExpression(node)) {
                      return isHelper(node.object) || isHelper(node.property);
                    } else if (t.isIdentifier(node)) {
                      return node.name === "require" || node.name[0] === "_";
                  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 run has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function* run(
                    config: ResolvedConfig,
                    code: string,
                    ast: ?(BabelNodeFile | BabelNodeProgram),
                  ): Handler<FileResult> {
                  Severity: Minor
                  Found in packages/babel-core/src/transformation/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 mergeOptions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export function mergeOptions(
                    target: ValidatedOptions,
                    source: ValidatedOptions,
                  ): void {
                    for (const k of Object.keys(source)) {
                  Severity: Minor
                  Found in packages/babel-core/src/config/util.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