Showing 1,102 of 5,656 total issues
File template-compiler.static.if-else.double.spec.ts
has 8697 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Aurelia, CustomElement } from "@aurelia/runtime-html";
import { TestContext, assert } from "@aurelia/testing";
describe("3-runtime-html/generated/template-compiler.static.if-else.double.spec.ts", function () {
function createFixture() {
Function getSiblingHookTestData
has 4055 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function* getSiblingHookTestData(): Generator<SiblingHookTestData> {
function createRoot(ticks: number): [root: Class<unknown>, scopes: string[]] {
abstract class Base extends AsyncBaseViewModelWithAllHooks {
public constructor(@ILogger logger: ILogger) {
super(logger, ticks);
File lifecycle-hooks.spec.ts
has 5804 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Roughly the followings aspects are tested here:
* - The invocation of the routing hooks, both instance and the global lifecycle hooks.
* - The order of invocation.
* - The preemption in the hooks (hooks returning `false`).
File smoke-tests.spec.ts
has 5702 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { LogLevel, Constructable, kebabCase, ILogConfig, Registration, noop, IModule, inject } from '@aurelia/kernel';
import { assert, MockBrowserHistoryLocation, TestContext } from '@aurelia/testing';
import { RouterConfiguration, IRouter, NavigationInstruction, IRouteContext, RouteNode, Params, route, INavigationModel, IRouterOptions, IRouteViewModel, IRouteConfig, Router, HistoryStrategy, IRouterEvents, ITypedNavigationInstruction_string, IViewportInstruction, RouteConfig, Routeable, RouterOptions, RouteContext } from '@aurelia/router-lite';
import { Aurelia, valueConverter, customElement, CustomElement, ICustomElementViewModel, IHistory, IHydratedController, ILocation, INode, IPlatform, IWindow, StandardConfiguration, watch } from '@aurelia/runtime-html';
File data.ts
has 4200 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
File hook-tests.spec.ts
has 4136 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Constructable, DI, ILogConfig, LogLevel, Registration, Writable, onResolve } from '@aurelia/kernel';
import {
CustomElement,
customElement,
ICustomElementController,
Function getTestData
has 2107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function *getTestData() {
function wrap(content: string, type: 'p' | 'f' | 'r', debugMode = false) {
switch (type) {
case 'p':
return `<${phost}${debugMode ? ` p.bind="promise"` : ''}>${content}</${phost}>`;
Function getTestData
has 1734 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function *getTestData() {
const createMyElement = (template: string, containerless = false) => {
class MyElement {
public constructor(
@IAuSlotsInfo public readonly slots: IAuSlotsInfo,
File route-recognizer.spec.ts
has 2885 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Writable } from '@aurelia/kernel';
import { ConfigurableRoute, Endpoint, RecognizedRoute, RouteRecognizer, Parameter, RESIDUE } from '@aurelia/route-recognizer';
import { assert } from '@aurelia/testing';
describe('router-lite/route-recognizer.spec.ts', function () {
File route-recognizer.spec.ts
has 2740 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { ConfigurableRoute, Endpoint, RecognizedRoute, RouteRecognizer, Parameter } from '@aurelia/route-recognizer';
import { assert } from '@aurelia/testing';
describe('router/route-recognizer.spec.ts', function () {
File route-recognizer.spec.txt.ts
has 2740 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { ConfigurableRoute, Endpoint, RecognizedRoute, RouteRecognizer, Parameter } from '@aurelia/route-recognizer';
import { assert } from '@aurelia/testing';
describe(RouteRecognizer.name, function () {
File promise.spec.ts
has 2584 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
reportTaskQueue,
Task,
} from '@aurelia/platform';
import {
File controller.deactivation.partially-activated.spec.ts
has 2271 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
DI,
onResolve,
resolve,
} from '@aurelia/kernel';
File au-slot.spec.tsx
has 2123 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { delegateSyntax } from '@aurelia/compat-v1';
import { IContainer, inject, newInstanceForScope, resolve } from '@aurelia/kernel';
import { BindingMode, Aurelia, AuSlotsInfo, bindable, customElement, CustomElement, IAuSlotsInfo, IPlatform, ValueConverter } from '@aurelia/runtime-html';
import { assert, createFixture, hJsx, TestContext } from '@aurelia/testing';
import { createSpecFunction, TestExecutionContext, TestFunction } from '../util.js';
File template-compiler.static.if-else.spec.ts
has 2051 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Aurelia, CustomElement } from "@aurelia/runtime-html";
import { TestContext, assert } from "@aurelia/testing";
describe("3-runtime-html/generated/template-compiler.static.if-else.spec.ts", function () {
function createFixture() {
File ast.spec.ts
has 1909 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { IServiceLocator, Writable, IIndexable } from '@aurelia/kernel';
import {
eachCartesianJoin,
eachCartesianJoinFactory,
createScopeForTest,
File template-compiler.spec.ts
has 1827 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { delegateSyntax } from '@aurelia/compat-v1';
import {
Constructable,
IContainer,
kebabCase,
Function getParentChildHooks
has a Cognitive Complexity of 231 (exceeds 5 allowed). Consider refactoring. Open
Open
export function* getParentChildHooks(deferUntil, swapStrategy, componentKind, phase, from, to) {
const parentAdd: HookName[] = [...addHooks];
const childAdd: HookName[] = ['canLoad', 'loading', ...addHooks];
const parentRemove: HookName[] = ['unloading', ...removeHooks];
const childRemove: HookName[] = [...removeHooks];
- 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 controller.hook-timings.integration.spec.ts
has 1729 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Registration, Writable, DI } from '@aurelia/kernel';
import {
Aurelia,
customElement,
ICustomElementController,
Function getTestData
has 924 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function* getTestData() {
function wrap(content: string, isDefault: boolean = false) {
const host = isDefault ? 'default-case-host' : 'case-host';
return `<${host}>${content}</${host}>`;
}