Showing 1,020 of 5,369 total issues
Function reverseMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private reverseMap(results: ValidationResultTarget[]) {
const map = new Map<Element, ValidationResult[]>();
for (const { result, targets } of results) {
for (const target of targets) {
let targetResults = map.get(target);
- 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 _getTransitionPlan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public _getTransitionPlan(cur: RouteNode, next: RouteNode, overridingTransitionPlan: TransitionPlan | null) {
if (hasSamePath(cur, next) && shallowEquals(cur.params, next.params)) return 'none';
if (overridingTransitionPlan != null) return overridingTransitionPlan;
- 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 computeActive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private computeActive(): string {
if (!Array.isArray(this.linkActive)) {
return (this.linkActive as ((route: NavRoute) => boolean))(this) ? 'nav-active' : '';
}
const components = this.linkActive as RoutingInstruction[];
- 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 createConfiguration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function createConfiguration(optionsProvider: ValidationConfigurationProvider) {
return {
optionsProvider,
register(container: IContainer) {
const options: ValidationHtmlCustomizationOptions = getDefaultValidationHtmlConfiguration();
- 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 ensureGlobalsAreUntouched
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ensureGlobalsAreUntouched = ($globalThis: typeof globalThis) => {
for (const globalName of globalNames) {
const pd = Object.getOwnPropertyDescriptor($globalThis, globalName);
switch (globalName) {
// https://262.ecma-international.org/#sec-value-properties-of-the-global-object
- 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 getKeys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getKeys(
value: any,
showHidden: boolean,
): PropertyKey[] {
let keys: PropertyKey[];
- 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 _getAdapterObserver
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private _getAdapterObserver(obj: IObservable, key: PropertyKey, pd: PropertyDescriptor): IObserver | null {
if (this._adapters.length > 0) {
for (const adapter of this._adapters) {
const observer = adapter.getObserver(obj, key, pd, this);
if (observer != 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 getConstructorName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getConstructorName(
obj: any,
ctx: IInspectContext,
): string | null {
let firstProto;
- 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 formatArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function formatArray(
ctx: IInspectContext,
value: any[],
recurseTimes: number,
): string[] {
- 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 formatMapIterInner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function formatMapIterInner(
ctx: IInspectContext,
recurseTimes: number,
entries: any[],
state: 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
create(
{
level = warn,
colorOptions = 'no-colors',
sinks = [],
- 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 executeSteps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function executeSteps<T>(store: Store<T>, shouldLogResults: boolean, ...steps: StepFn<T>[]) {
const logStep = (step: StepFn<T>, stepIdx: number) => async (res: T | undefined) => {
if (shouldLogResults) {
console.group(`Step ${stepIdx}`);
console.log(res);
- 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 getContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getContent(): ViewportContent {
// If there's only one content, it's always content
if (this.contents.length === 1) {
return this.contents[0];
}
- 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 finalizeContentChange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public finalizeContentChange(coordinator: NavigationCoordinator, step: Step<void> | null): void | Step<void> {
const nextContentIndex = this.contents.findIndex(content => content.navigation === coordinator.navigation);
let nextContent = this.contents[nextContentIndex];
const previousContent = this.contents[nextContentIndex - 1];
// const previousContents = this.contents.slice(0, nextContentIndex);
- 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 addItemsAtStart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
addItemsAtStart(count: number) {
if (count > 0) {
this.round++;
for (let i = 0; i < count; i++) {
this.items.unshift(this.getNewItem(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 addItemsAtEnd
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
addItemsAtEnd(count: number) {
if (count > 0) {
this.round++;
for (let i = 0; i < count; i++) {
this.items.push(this.getNewItem(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 getItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getItem<T>(key: string): ICacheItem<T> | undefined {
if (!this.storage.has(key)) {
this.ea.publish(CacheEvent.CacheMiss, { key });
return;
}
- 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 mergeArrays
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const mergeArrays = <T>(...arrays: (readonly T[] | undefined)[]): T[] => {
const result: T[] = [];
let k = 0;
const arraysLen = arrays.length;
let arrayLen = 0;
- 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 appendTo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public appendTo(state: AnyState<T>): StaticState<T> {
const { value, value: { length } } = this;
if (this.caseSensitive) {
for (let i = 0; i < length; ++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 acceptSegment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public acceptSegment(segment: string): boolean {
if (segment === null && segment === void 0 || segment.length === 0) {
return true;
}
if (segment === RoutingInstruction.clear(this.router)
- 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"