Showing 1,251 of 1,982 total issues
Function loadFullConfig
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
export default gensync<[any], ResolvedConfig | null>(function* loadFullConfig(
inputOpts: mixed,
): Handler<ResolvedConfig | null> {
const result = yield* loadPrivatePartialConfig(inputOpts);
if (!result) {
- Read upRead up
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 isPure
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
isPure(node, constantsOnly?: boolean) {
if (t.isIdentifier(node)) {
const binding = this.getBinding(node.name);
if (!binding) return false;
if (constantsOnly) return binding.constant;
- Read upRead up
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 transformClass.js
has 559 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { NodePath } from "@babel/traverse";
import nameFunction from "@babel/helper-function-name";
import ReplaceSupers, {
environmentVisitor,
} from "@babel/helper-replace-supers";
File flow.js
has 543 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as t from "@babel/types";
import { ExportAllDeclaration } from "./modules";
export function AnyTypeAnnotation() {
this.word("any");
Consider simplifying this complex logical expression. Open
if (
nodeType === "Declaration" ||
"FunctionDeclaration" === nodeType ||
"VariableDeclaration" === nodeType ||
"ClassDeclaration" === nodeType ||
File typescript.js
has 512 lines of code (exceeds 250 allowed). Consider refactoring. Open
export function TSTypeAnnotation(node) {
this.token(":");
this.space();
if (node.optional) this.token("?");
this.print(node.typeAnnotation, node);
File index.js
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { declare } from "@babel/helper-plugin-utils";
import { types as t } from "@babel/core";
export default declare((api, options) => {
api.assertVersion(7);
File index.js
has 506 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { declare } from "@babel/helper-plugin-utils";
import hoistVariables from "@babel/helper-hoist-variables";
import { template, types as t } from "@babel/core";
import { getImportSource } from "babel-plugin-dynamic-import-node/utils";
import { rewriteThis, getModuleName } from "@babel/helper-module-transforms";
Function applyReplacement
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
function applyReplacement(
placeholder: Placeholder,
ast: BabelNodeFile,
replacement: any,
) {
- Read upRead up
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 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (opts) {
const visitor = {};
visitor.JSXNamespacedName = function (path) {
if (opts.throwIfNamespace) {
Function default
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
export default async function ({
cliOptions,
babelOptions,
}: CmdOptions): Promise<void> {
const filenames = cliOptions.filenames;
- Read upRead up
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 flow.js
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import defineType, {
arrayOfType,
assertOneOf,
assertValueType,
Function handle
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
handle(member) {
const { node, parent, parentPath } = member;
if (member.isOptionalMemberExpression()) {
// Transforming optional chaining requires we replace ancestors.
File conversion.js
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
// This file contains methods that convert the path node into another node or some other type of data.
import * as t from "@babel/types";
import nameFunction from "@babel/helper-function-name";
File index.js
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import * as charCodes from "charcodes";
import XHTMLEntities from "./xhtml";
File index.js
has 473 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { declare } from "@babel/helper-plugin-utils";
import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread";
import { types as t } from "@babel/core";
import { convertFunctionParams } from "@babel/plugin-transform-parameters";
Scope
has 52 functions (exceeds 20 allowed). Consider refactoring. Open
export default class Scope {
/**
* This searches the current "scope" and collects all references/bindings
* within.
*/
Function run
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
function run(task) {
const {
actual,
expect: expected,
exec,
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if (
nodeType === "FlowType" ||
"AnyTypeAnnotation" === nodeType ||
"ArrayTypeAnnotation" === nodeType ||
"BooleanTypeAnnotation" === nodeType ||
File typescript.js
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
// @flow
import defineType, {
arrayOfType,
assertEach,
assertNodeType,