Showing 1,982 of 1,982 total issues
Avoid deeply nested control flow statements. Open
} else if (parentPath.node.property.name === "length") {
// args.length
state.candidates.push({ cause: "lengthGetter", path });
return;
}
Function newline
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
newline(i?: number): void {
if (this.format.retainLines || this.format.compact) return;
if (this.format.concise) {
this.space();
- 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
Avoid deeply nested control flow statements. Open
} else if (t.isObjectExpression(node)) {
for (const prop of (node.properties: Array<Object>)) {
if (!this.isPure(prop, constantsOnly)) return false;
}
return true;
Function default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function () {
const visitor = {
ImportDeclaration(path: NodePath) {
if (isRegeneratorSource(getImportSource(path))) {
this.regeneratorImportExcluded = true;
- 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 loadCjsOrMjsDefault
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function* loadCjsOrMjsDefault(
filepath: string,
asyncError: string,
): Handler<mixed> {
switch (guessJSModuleType(filepath)) {
- 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
Avoid deeply nested control flow statements. Open
if (!regenerator) {
polyfillPlugins.push([removeRegeneratorEntryPlugin, pluginOptions]);
}
Avoid deeply nested control flow statements. Open
if (!this.isPure(method, constantsOnly)) return false;
Avoid deeply nested control flow statements. Open
for (const prop of (props: Array)) {
if (!prop.isProperty()) continue;
const key = prop.get("key");
Avoid deeply nested control flow statements. Open
} else if (target.isArrayExpression() && !isNaN(+targetName)) {
const elems = target.get("elements");
const elem = elems[targetName];
if (elem) return elem.resolve(dangerous, resolved);
}
Function _getPattern
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function _getPattern(
parts: string[],
context?: TraversalContext,
): NodePath | NodePath[] {
let path = this;
- 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 assertCallerMetadata
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function assertCallerMetadata(
loc: OptionPath,
value: mixed,
): CallerMetadata | void {
const obj = assertObject(loc, value);
- 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
Avoid deeply nested control flow statements. Open
if (binding) binding.reference(path);
Function getCompletionRecords
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getCompletionRecords(): NodePath[] {
let paths = [];
if (this.isIfStatement()) {
paths = addCompletionRecords(this.get("consequent"), paths);
- 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 normalizeCoreJSOption
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function normalizeCoreJSOption(
corejs?: CorejsOption,
useBuiltIns: BuiltInsOption,
): NormalizedCorejsOption {
let proposals = false;
- 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 readConfigJS
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const readConfigJS = makeStrongCache(function* readConfigJS(
filepath: string,
cache: CacheConfigurator<{
envName: string,
caller: CallerMetadata | void,
- 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 findConfigUpwards
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function* findConfigUpwards(rootDir: string): Handler<string | null> {
let dirname = rootDir;
while (true) {
for (const filename of ROOT_CONFIG_FILENAMES) {
if (yield* fs.exists(path.join(dirname, filename))) {
- 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 assertOverridesList
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function assertOverridesList(loc: OptionPath, value: mixed): OverridesList {
if (loc.parent.type === "env") {
throw new Error(`${msg(loc)} is not allowed inside an .env block`);
}
if (loc.parent.type === "overrides") {
- 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
Avoid deeply nested control flow statements. Open
for (const elem of (node.elements: Array<Object>)) {
if (!this.isPure(elem, constantsOnly)) return false;
}
Avoid deeply nested control flow statements. Open
if (statementInBlock.isBreakStatement()) {
breakStatement = statementInBlock;
break findBreak;
}
Function node
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
node: Object,
opts: Object,
scope: Object,
state: Object,
parentPath: Object,