Showing 1,020 of 5,369 total issues
File event-delegator.spec.ts
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { IDisposable } from '@aurelia/kernel';
import {
EventDelegator,
} from '@aurelia/compat-v1';
import { _, TestContext, assert } from '@aurelia/testing';
Function formatSpecialArray
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function formatSpecialArray(
ctx: IInspectContext,
value: any[],
recurseTimes: number,
maxLength: 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 createTemplate
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public createTemplate(input: string | Node): HTMLTemplateElement {
if (isString(input)) {
let result = markupCache[input];
if (result === void 0) {
const template = this._template;
- 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 stringify
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public stringify(context: IRouterConfiguration | IRouter | IContainer, excludeEndpoint: boolean = false, endpointContext: boolean = false, shallow = false): string {
const seps = Separators.for(context);
let excludeCurrentEndpoint = excludeEndpoint;
let excludeCurrentComponent = 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 preprocess
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function preprocess(
unit: IFileUnit,
options: IOptionalPreprocessOptions,
_fileExists = fileExists
): ModifyCodeResult | 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 expected
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
const expected = [...(function* () {
yield* $('start', 'root', 0, 'binding', 'bound', 'attaching', 'attached');
const hookName = hookSpec.toString().slice(0, -3) as typeof hookNames[number];
yield* $(phase1, ['a', 'b'], 0, 'canLoad', 'loading', 'binding', 'bound', 'attaching', 'attached');
File view-models.ts
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Writable } from '@aurelia/kernel';
import { ICustomElementController, IHydratedController, IHydratedParentController } from '@aurelia/runtime-html';
import { Parameters, IRouteableComponent, LoadInstruction, Navigation, Viewport, RoutingInstruction } from '@aurelia/router';
import { IHookInvocationAggregator } from './hook-invocation-tracker.js';
import { IHookSpec, hookSpecsMap } from './hook-spec.js';
Function constructor
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
public constructor(options: IAssertionErrorOpts) {
const {
actual,
expected,
message,
Function formatProperty
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatProperty(
ctx: IInspectContext,
value: any,
recurseTimes: number,
key: PropertyKey,
Function internalDispatch
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async internalDispatch(actions: DispatchAction<T>[]) {
const unregisteredAction = actions.find((a) => !this.actions.has(a.reducer));
if (unregisteredAction) {
throw new UnregisteredActionError(unregisteredAction.reducer);
}
Function test
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function test() {
const d = DI.createContainer();
const I = DI.createInterface<I>();
interface I {
c: number;
Function constructor
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public constructor(
/**
* The global logger configuration.
*/
config = resolve(ILogConfig),
- 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 transition
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public async transition(coordinator: NavigationCoordinator): Promise<void> {
const navigatingPrefix = this.router.configuration.options.indicators.viewportNavigating;
this.coordinators.push(coordinator);
// If this isn't the first coordinator, a navigation is already in process...
- 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 createObservers
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
function createObservers(
controller: Controller,
definition: CustomElementDefinition | CustomAttributeDefinition,
instance: IIndexable<ICustomElementViewModel | ICustomAttributeViewModel>,
): 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 run
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
public run(time: number = this.taskQueue.platform.performanceNow()): void {
if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'run'); }
if (this._status !== tsPending) {
if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'run error'); }
File href.spec.ts
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { IRouteContext, IRouteViewModel, Params, route, RouteNode } from '@aurelia/router-lite';
import { customElement, IPlatform } from '@aurelia/runtime-html';
import { assert } from '@aurelia/testing';
import { start } from '../_shared/create-fixture.js';
TestContext
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export class TestContext {
public static readonly ambient: TestContext;
public get wnd(): Window & typeof globalThis { return this.platform.globalThis as Window & typeof globalThis; }
public get doc(): Document { return this.platform.document; }
Endpoint
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export class Endpoint {
/**
* The contents of the endpoint. New contents are pushed to this, making
* the last one the active one.
*/
Function getTestData
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* getTestData(): Generator<[hook: HookName, getExpectedErrorLog: (phase: string, current: string) => any[]]> {
yield [
'canLoad',
function getExpectedErrorLog(phase: string, current: string) {
return [
File module-loader.spec.ts
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { AnalyzedModule, DI, IModuleLoader, aliasedResourcesRegistry } from '@aurelia/kernel';
import * as ce_a_b_default from './modules/ce-a-b-default.js';
import * as ce_a_b_defaultb from './modules/ce-a-b-defaultb.js';
import * as ce_a_b from './modules/ce-a-b.js';