Showing 1,020 of 5,354 total issues
File logger.ts
has 387 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { createInterface, IContainer, IRegistry } from './di';
import { instanceRegistration, singletonRegistration } from './di.registration';
import { bound, toLookup } from './functions';
import { Class, Constructable } from './interfaces';
import { IPlatform } from './platform';
Function objEquiv
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export function objEquiv(
a: Object,
b: Object,
strict: boolean,
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
File validation-result-presenter-service.spec.ts
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Registration, toArray, newInstanceForScope, DI, resolve, IContainer } from '@aurelia/kernel';
import { IPlatform, CustomElement, customElement, Aurelia } from '@aurelia/runtime-html';
import { PLATFORM, assert, ISpy, TestContext, createSpy, getVisibleText } from '@aurelia/testing';
import {
IValidationRules,
Function hydrate
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
public hydrate(raw: any): any {
switch (raw.$TYPE) {
case ASTExpressionTypes.AccessMemberExpression: {
const expr: Pick<AST.AccessMemberExpression, 'object' | 'name'> = raw;
return new AST.AccessMemberExpression(this.hydrate(expr.object), expr.name);
File template-compiler.hooks.spec.ts
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Registration
} from '@aurelia/kernel';
import {
CustomElement,
File router.lifecycle-hooks.spec.ts
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { IContainer } from '@aurelia/kernel';
import { IRoute, IRouter, IRouterOptions, RouterConfiguration } from '@aurelia/router';
import { Aurelia, CustomElement, IPlatform, lifecycleHooks } from '@aurelia/runtime-html';
import { MockBrowserHistoryLocation, TestContext, assert } from '@aurelia/testing';
Function getViewportHooks
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
function getViewportHooks(swapStrategy: SwapStrategy, phase: string, viewport: Viewport, type: '' | 'activate' | 'deactivate' = ''): string[] {
const hooks = [];
switch (type) {
case 'activate':
if (!viewport.to.isEmpty) {
- 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 33 (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
File routing-hook.spec.ts
has 369 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { RoutingHook, RoutingInstruction, RouterConfiguration, IRouter, Navigation } from '@aurelia/router';
import { assert, TestContext } from '@aurelia/testing';
import { CustomElement, IPlatform, Aurelia } from '@aurelia/runtime-html';
import { isNode } from '../util.js';
File runner.ts
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { OpenPromise } from './open-promise';
/**
* Class for running a sequence of steps with values,
* functions and promises. Stays sync if possible.
File validation-errors-custom-attribute.spec.ts
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { newInstanceForScope, newInstanceOf, resolve, toArray } from '@aurelia/kernel';
import { assert, createSpy, getVisibleText, ISpy, TestContext } from '@aurelia/testing';
import { IValidationRules } from '@aurelia/validation';
import { CustomAttribute, CustomElement, customElement, IPlatform, Aurelia } from '@aurelia/runtime-html';
import {
File enhance.spec.ts
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
// This is to test for some intrinsic properties of enhance which is otherwise difficult to test in Data-driven tests parallel to `.app`
import { BrowserPlatform } from '@aurelia/platform-browser';
import { Constructable, DI, IContainer, Registration, onResolve, resolve } from '@aurelia/kernel';
import {
CustomElement,
File i18n.spec.ts
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { I18N, I18nInitOptions, Signals } from '@aurelia/i18n';
import { EventAggregator } from '@aurelia/kernel';
import { nowrap } from '@aurelia/runtime';
import { assert, MockSignaler, createFixture } from '@aurelia/testing';
import { ISignaler } from '@aurelia/runtime-html';
File routing-instruction.ts
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { InstructionParser } from './instruction-parser';
import { InstructionParameters, Parameters } from './instruction-parameters';
import { InstructionComponent } from './instruction-component';
import { ComponentAppellation, ComponentParameters, LoadInstruction } from '../interfaces';
import { RoutingScope } from '../routing-scope';
File repeat.vc.bb.spec.ts
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { IContainer } from '@aurelia/kernel';
import { valueConverter, bindingBehavior, Aurelia, CustomElement, ICustomElementController, IPlatform } from '@aurelia/runtime-html';
import { assert, TestContext } from '@aurelia/testing';
import { createSpecFunction, TestExecutionContext, TestFunction } from '../util.js';
File has-multi-bindings.unit.spec.ts
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Char } from '../util.js';
import { assert } from '@aurelia/testing';
describe('3-runtime-html/has-multi-bindings.unit.spec.ts', function () {
interface IBindingSpec {
Function _leaveDetaching
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
private _leaveDetaching(): void {
if (--this._detachingStack === 0) {
// Note: this controller is the initiator (detach is only ever called on the initiator)
/* istanbul ignore next */
if (__DEV__ && this.debug) { this.logger!.trace(`detach()`); }
- 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
Viewport
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
export class Viewport extends Endpoint {
/**
* The contents of the viewport. New contents are pushed to this, making
* the last one the active one. It always holds at least one content, so
* that there's always a current content.
File decorator-observable.spec.ts
has 354 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { observable, SetterObserver, IObservable, IObserverLocator, IObserver } from '@aurelia/runtime';
import { assert, createFixture } from '@aurelia/testing';
import { noop } from '@aurelia/kernel';
import { ValueConverter, customElement } from '@aurelia/runtime-html';
File state.spec.ts
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ValueConverter, customAttribute, customElement, ICustomAttributeController, IWindow } from '@aurelia/runtime-html';
import { StateDefaultConfiguration, fromState } from '@aurelia/state';
import { assert, createFixture, onFixtureCreated } from '@aurelia/testing';
describe('state/state.spec.ts', function () {