Showing 1,020 of 5,369 total issues
Function keyCheck
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function keyCheck(
val1: {},
val2: {},
strict: boolean,
memos: Memos | undefined,
Function getHmrCode
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getHmrCode(className: string, moduleNames: string = ''): string {
const moduleText = 'import.meta';
const code = `
import { Metadata as $$M } from '@aurelia/metadata';
import {
File promise.ts
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Task, TaskAbortError } from '@aurelia/platform';
import { ILogger, onResolve, onResolveAll, resolve, isPromise, registrableMetadataKey } from '@aurelia/kernel';
import { Scope } from '../../binding/scope';
import { INode, IRenderLocation } from '../../dom';
import { IPlatform } from '../../platform';
Function getHookSpecs
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function getHookSpecs<T extends HookName>(name: T) {
return {
sync: {
name,
type: 'sync',
- 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 test
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function test() {
const d = DI.createContainer();
const I = DI.createInterface<I>();
interface I {
c: number;
- 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 testIt
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function testIt(components: number, connected = true, defaults = [1, 1], timings: any = {}) {
const root1 = new Controller('root', [
new Controller('parent-1', [
new Controller('child-1.1', [], connected, ...(timings['child-1.1'] ?? defaults)),
new Controller('child-1.2', [], connected, ...(timings['child-1.2'] ?? defaults)),
File eventaggregator.spec.ts
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { EventAggregator, IEventAggregator } from '@aurelia/kernel';
import { assert } from '@aurelia/testing';
type EA = IEventAggregator & {
eventLookup: Record<string, ((...args: unknown[]) => void)[]>;
Function connectTo
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function connectTo<T, R = any>(settings?: ((store: Store<T>) => Observable<R>) | ConnectToSettings<T, R>) {
const _settings = {
selector: (typeof settings === 'function' ? settings : defaultSelector),
...settings
} as unknown as ConnectToSettings<T>;
Function getPendingActivationLog
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPendingActivationLog(prefix: string, isDeactivated: boolean) {
const logs = [];
/* eslint-disable no-fallthrough */
switch (hook) {
case 'attached': logs.push(
Function getSingleHooks
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function* getSingleHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
if (from) { yield `${phase}.${from}.canUnload`; }
if (to) { yield `${phase}.${to}.canLoad`; }
if (from) { yield `${phase}.${from}.unloading`; }
if (to) { yield `${phase}.${to}.loading`; }
- 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 getMessageByCode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
let cooked: string = errorsMap[name];
for (let i = 0; i < details.length; ++i) {
const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
let matches = regex.exec(cooked);
- 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 getMessageByCode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
let cooked: string = errorsMap[name];
for (let i = 0; i < details.length; ++i) {
const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
let matches = regex.exec(cooked);
- 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 formatValue
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function formatValue(
ctx: IInspectContext,
value: any,
recurseTimes: number,
typedArray?: boolean,
- 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 createSpy
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function createSpy<
T extends {} | AnyFunction = VoidFunction,
K extends keyof T = never,
F extends AnyFunction = never,
>(instanceOrInnerFn?: T, key?: K, callThroughOrInnerFn?: true | F) {
- 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 getMessageByCode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
let cooked: string = errorsMap[name];
for (let i = 0; i < details.length; ++i) {
const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
let matches = regex.exec(cooked);
- 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 getMessageByCode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
let cooked: string = errorsMap[name];
for (let i = 0; i < details.length; ++i) {
const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
let matches = regex.exec(cooked);
- 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 navigate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public navigate(navigation: INavigation | Navigation): Promise<boolean> {
if (!(navigation instanceof Navigation)) {
navigation = Navigation.create(navigation);
}
const navigationFlags = new NavigationFlags();
- 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 finalize
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public async finalize(navigation: Navigation, isLast: boolean): Promise<void> {
// If this navigation shouldn't be added to history...
if (navigation.untracked ?? false) {
// ...and it's a navigation from the browser (back, forward, url)...
if ((navigation.fromBrowser ?? false) && this.options.store != null) {
- 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 getMessageByCode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
let cooked: string = errorsMap[name];
for (let i = 0; i < details.length; ++i) {
const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
let matches = regex.exec(cooked);
- 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 getMessageByCode
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
const getMessageByCode = (name: ErrorNames, ...details: unknown[]) => {
let cooked: string = errorsMap[name];
for (let i = 0; i < details.length; ++i) {
const regex = new RegExp(`{{${i}(:.*)?}}`, 'g');
let matches = regex.exec(cooked);
- 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"