Showing 1,020 of 5,354 total issues
File 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/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() {
super(ticks);
File lifecycle-hooks.spec.ts
has 5740 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 5696 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { LogLevel, Constructable, kebabCase, ILogConfig, Registration, noop, IModule, inject, resolve } 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, 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, resolve } from '@aurelia/kernel';
import {
CustomElement,
customElement,
ICustomElementController,
Function getTestData
has 1708 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function* getTestData() {
const createMyElement = (template: string, containerless = false) => {
class MyElement {
public readonly slots: IAuSlotsInfo = resolve(IAuSlotsInfo);
public constructor() {
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.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 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 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 2206 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 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/static.if-else.spec.ts", function () {
function createFixture() {
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 1727 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Registration, Writable, DI, resolve } from '@aurelia/kernel';
import {
Aurelia,
customElement,
ICustomElementController,
File template-compiler.spec.ts
has 1608 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { delegateSyntax } from '@aurelia/compat-v1';
import {
Constructable,
IContainer,
kebabCase,
File inspect.ts
has 1597 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Significant portion of this code is copy-pasted from the node.js source
// Modifications consist primarily of removing dependencies on v8 natives and adding typings
// Original license:
/*
File array-observer.spec.ts
has 1587 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
ArrayObserver,
copyIndexMap,
ICollectionSubscriber,
IndexMap,
File translation-integration.spec.ts
has 1570 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { I18N, I18nConfiguration, Signals } from '@aurelia/i18n';
import { Class, IContainer } from '@aurelia/kernel';
import { ISignaler, Aurelia, bindable, customElement, INode, IPlatform } from '@aurelia/runtime-html';
import { assert, PLATFORM, TestContext } from '@aurelia/testing';
import { createSpecFunction, TestExecutionContext, TestFunction } from '../../util.js';
File preprocess-resource.spec.ts
has 1552 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as path from 'path';
import { preprocessResource, preprocessOptions } from '@aurelia/plugin-conventions';
import { assert } from '@aurelia/testing';
describe('preprocessResource', function () {