Showing 1,020 of 5,369 total issues
File events.ts
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ILogger } from '@aurelia/kernel';
/**
* Ranges
* - viewport : 3000 - 3049
Unparser
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
export class Unparser implements IVisitor<void> {
public text: string = '';
public static unparse(expr: IsExpressionOrStatement): string {
const visitor = new Unparser();
Serializer
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
export class Serializer implements AST.IVisitor<string> {
public static serialize(expr: AST.IsExpressionOrStatement | AST.CustomExpression): string {
const visitor = new Serializer();
if (expr == null) {
return `${expr}`;
File template-compiler.ce_and_surrogate.spec.ts
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { TestContext, assert } from '@aurelia/testing';
import { CustomElement, Aurelia, CustomAttribute, ICustomAttributeViewModel } from '@aurelia/runtime-html';
describe('3-runtime-html/template-compiler.ce_and_surrogate.spec.ts', function () {
interface ISurrogateIntegrationTestCase {
File observer-locator.spec.ts
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CollectionLengthObserver, CollectionSizeObserver, ComputedObserver, DirtyCheckProperty, PrimitiveObserver, PropertyAccessor, SetterObserver } from '@aurelia/runtime';
import {
AttributeNSAccessor,
CheckedObserver,
ClassAttributeAccessor,
Function getViewportHooks
has 94 lines of code (exceeds 25 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) {
Function createObserver
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private createObserver(obj: IObservable, key: PropertyKey): IObserver {
if (this._nodeObserverLocator.handles(obj, key, this)) {
return this._nodeObserverLocator.getObserver(obj, key, this) as IObserver;
}
- 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 createFixture
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function createFixture(config?, App?, stateSpy?) {
const ctx = TestContext.create();
const { container, platform } = ctx;
if (App === void 0) {
File ast.ts
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable @typescript-eslint/no-unused-vars */
import { emptyArray } from '@aurelia/kernel';
import type { IVisitor } from './ast.visitor';
/** @internal */ export const ekAccessThis = 'AccessThis';
Function au
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function au(options: {
include?: FilterPattern;
exclude?: FilterPattern;
pre?: boolean;
/**
File state.ts
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { DI, ILifecycleHooks, ILogger, IRouteViewModel, lifecycleHooks, NavigationInstruction, Params, RouteNode } from 'aurelia';
import { Article, ArticleListResponse, ArticleResponse, Comment, ErrorRecordResponse, IApiService, IJwtService, ArticleQueryParams, User, UserLogin, UserRegistration, UserResponse, UserUpdate, ArticleListQueryParams, Profile, ProfileResponse, ErrorList } from './api';
/**
* Singleton `User` state that represents the currently logged-in user.
Function parseOne
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private static parseOne(seps: Separators, instruction: string): {
instruction: RoutingInstruction;
remaining: string;
} {
const tokens = [seps.parameters, seps.viewport, seps.noScope, seps.groupEnd, seps.scope, seps.sibling];
- 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 findInstructions
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public findInstructions(instructions: RoutingInstruction[], useDirectRouting: boolean, useConfiguredRoutes: boolean): FoundRoute {
const router = this.router;
let route = new FoundRoute();
if (useConfiguredRoutes && !RoutingInstruction.containsSiblings(router, instructions)) {
- 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 for
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static for(
origin: Element | ICustomElementViewModel | Viewport | ViewportScope | RoutingScope | ICustomElementController | IContainer | null,
instruction?: string
): { scope: RoutingScope | null; instruction: string | 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
File i18n.spec.ts
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { test, expect, Page } from '@playwright/test';
import de from '../public/locales/de/translation.json';
import en from '../public/locales/en/translation.json';
interface Spec {
Function findMatchingRouteInRoutes
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
private findMatchingRouteInRoutes(path: string, routes: Route[], parameters: Parameters): FoundRoute {
const found = new FoundRoute();
if (routes.length === 0) {
return found;
}
File focus.spec.ts
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Constructable } from '@aurelia/kernel';
import { PLATFORM, assert, eachCartesianJoin, TestContext, createFixture } from '@aurelia/testing';
import { isNode } from '../util.js';
describe('3-runtime-html/focus.spec.ts', function () {
Router
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
export class Router implements IRouter {
public static readonly closestEndpointKey = Protocol.annotation.keyFor('closest-endpoint');
/**
File if.integration.spec.ts
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
CustomAttribute,
ICustomElementViewModel,
IHydratedController,
IPlatform,
File functions.ts
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ErrorNames, createMappedError } from './errors';
import { Constructable, Overwrite } from './interfaces';
import { createLookup, isPromise, objectAssign } from './utilities';
/**