Showing 1,020 of 5,369 total issues
Avoid too many return
statements within this function. Open
return new AST.ArrowFunction(this.hydrate(raw.parameters), this.hydrate(raw.body), this.hydrate(raw.rest));
Avoid too many return
statements within this function. Open
return new AST.ForOfStatement(this.hydrate(expr.declaration), this.hydrate(expr.iterable), this.hydrate(expr.semiIdx));
Avoid too many return
statements within this function. Open
return new AST.DestructuringAssignmentExpression(this.hydrate(raw.$kind), this.hydrate(raw.list), this.hydrate(raw.source), this.hydrate(raw.initializer));
Avoid too many return
statements within this function. Open
return new AST.PrimitiveLiteralExpression(this.hydrate(expr.value));
Avoid too many return
statements within this function. Open
return new AST.UnaryExpression(expr.operation, this.hydrate(expr.expression));
Avoid too many return
statements within this function. Open
return new AST.ObjectBindingPattern(this.hydrate(expr.keys), this.hydrate(expr.values));
Avoid too many return
statements within this function. Open
return new AST.TemplateExpression(this.hydrate(expr.cooked), this.hydrate(expr.expressions));
Avoid too many return
statements within this function. Open
return new AST.BindingBehaviorExpression(this.hydrate(expr.expression), expr.name, this.hydrate(expr.args));
Avoid too many return
statements within this function. Open
return new AST.Interpolation(this.hydrate(expr.cooked), this.hydrate(expr.expressions));
Avoid too many return
statements within this function. Open
return new AST.DestructuringAssignmentRestExpression(this.hydrate(raw.target), this.hydrate(raw.indexOrProperties));
Function handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async handle<T extends ResponseConstructor>(p: Promise<Response>, Type?: T, handleValidationErrors?: true): Promise<ReturnType<T['create']> | ErrorRecordResponse | void> {
const response = await p;
if (response.status >= 200 && response.status < 400) {
if (Type === undefined) {
this.logger.trace(`handle() - ignoring response body`, response);
- 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 load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async load(slug = ''): Promise<void> {
if (slug === this.nextSlug) {
return this.loadPromise ?? undefined;
}
- 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 handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private async handle<T extends ResponseConstructor>(p: Promise<Response>, Type?: T, handleValidationErrors?: true): Promise<ReturnType<T['create']> | ErrorRecordResponse | void> {
const response = await p;
if (response.status >= 200 && response.status < 400) {
if (Type === undefined) {
this.logger.trace(`handle() - ignoring response body`, response);
- 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 loading
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async loading({ mode, page, tag, name }: Parameters, instruction: RoutingInstruction): Promise<void> {
// Component serves as three so set the right name
this.componentName = instruction.component.name ?? 'article-list';
// Set the right filter to name based on component
- 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 getHooks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getHooks(deferUntil, swapStrategy, phase, ...siblingTransitions) {
const siblingHooks: string[][] = siblingTransitions.map(sibling => getNonSiblingHooks(deferUntil, swapStrategy, phase, sibling));
if (deferUntil === 'guard-hooks' || deferUntil === 'load-hooks') {
// for (let i = 0; i <= siblingHooks.length - 2; i++) {
- 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 verifyRules
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function verifyRules(invocations: string[], swapStrategy: SwapStrategy, phase: string, root: string, from: string, to: string): boolean {
const {
viewports,
topViewport,
fromViewports,
- 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 assertHandlerPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function assertHandlerPath(expectedPhases: number[], actualPhases: ReturnType<typeof eventPropertiesShallowClone>[]): void {
const expectedLen = expectedPhases.length;
const actualLen = actualPhases.length;
const errors: string[] = [];
if (expectedLen !== actualLen) {
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public constructor(
keyConfiguration: I18nKeyConfiguration = resolve(I18nKeyConfiguration),
ea: EventAggregator = resolve(IEventAggregator),
) {
super(undefined, []);
- 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 activeChild
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private activeChild(): boolean {
if (this.children) {
for (const child of this.children) {
if (child.active.startsWith('nav-active') || child.activeChild()) {
return 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 logOutcome
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function logOutcome(actual: any, expected: any): any {
const outcome = [];
let leftMax = 0;
for (let i = 0, ii = Math.max(actual.length, expected.length); i < ii; i++) {
// outcome.push(actual[i] !== expected[i] ? `${actual[i]} <-> ${expected[i]}` : actual[i]);
- 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"