Showing 1,020 of 5,354 total issues
File decorator-watch.computed.spec.ts
has 1358 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { ProxyObservable } from '@aurelia/runtime';
import {
bindable,
ComputedWatcher,
customAttribute,
File controller.ts
has 1271 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
import {
AnyFunction,
IIndexable,
ILogger,
File scheduler.spec.ts
has 1236 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { TestContext, assert } from '@aurelia/testing';
import { QueueTaskOptions, ITask, TaskQueue } from '@aurelia/platform';
function createExposedPromise() {
let resolve: () => void;
File au-compose.spec.ts
has 1225 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { resolve } from '@aurelia/kernel';
import {
CustomElement,
customElement,
AuCompose,
Function formatRaw
has a Cognitive Complexity of 148 (exceeds 5 allowed). Consider refactoring. Open
Open
export function formatRaw(
ctx: IInspectContext,
value: any,
recurseTimes: number,
typedArray?: boolean,
- 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 load.spec.ts
has 1099 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { IRouteContext, IRouteViewModel, Params, route, RouteNode } from '@aurelia/router-lite';
import { CustomElement, customElement, ILocation, IPlatform } from '@aurelia/runtime-html';
import { assert, MockBrowserHistoryLocation } from '@aurelia/testing';
import { start } from '../_shared/create-fixture.js';
import { resolve } from '@aurelia/kernel';
File preprocess-html-template.spec.ts
has 1085 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as path from 'path';
import { preprocessHtmlTemplate, preprocessOptions } from '@aurelia/plugin-conventions';
import { assert } from '@aurelia/testing';
describe('preprocessHtmlTemplate', function () {
File rule-provider.spec.ts
has 987 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable no-constant-condition, mocha/no-sibling-hooks */
import { Metadata } from '@aurelia/metadata';
import {
DI,
ILogEvent,
File dialog-service.spec.ts
has 926 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { delegateSyntax } from '@aurelia/compat-v1';
import { noop } from '@aurelia/kernel';
import {
INode,
customElement,
File current-route.spec.ts
has 914 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable @typescript-eslint/consistent-type-assertions */
import { resolve } from '@aurelia/kernel';
import { ICurrentRoute, IRouteViewModel, IRouter, ParameterInformation, Params, RouteConfig, route } from '@aurelia/router-lite';
import { customElement } from '@aurelia/runtime-html';
import { assert } from '@aurelia/testing';
File repeat.keyed.array.spec.ts
has 875 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable @typescript-eslint/no-unused-vars */
import { batch } from '@aurelia/runtime';
import { Aurelia, CustomElement, ICustomElementViewModel } from '@aurelia/runtime-html';
import { TestContext, assert } from "@aurelia/testing";
File di.get.spec.ts
has 867 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { all, Constructable, DI, factory, IContainer, resolve, IResolvedFactory, lazy, newInstanceForScope, newInstanceOf, optional, Registration, singleton, transient } from '@aurelia/kernel';
import { assert } from '@aurelia/testing';
describe('1-kernel/di.get.spec.ts', function () {
let container: IContainer;
File custom-attributes.spec.ts
has 859 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { DI, IContainer, Registration, resolve } from '@aurelia/kernel';
import {
CustomAttribute,
IAurelia,
IHydratedComponentController,
Function getTestData
has 407 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function* getTestData() {
{
class MyElement {
public static hookInvoked: boolean = false;
public static processContent(_node: INode, _p: IPlatform) {
Function processInstructions
has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring. Open
Open
public async processInstructions(instructions: RoutingInstruction[], earlierMatchedInstructions: RoutingInstruction[], navigation: Navigation, coordinator: NavigationCoordinator, configuredRoutePath = ''): Promise<Endpoint[]> {
const router = this.router;
const options = router.configuration.options;
// If there are instructions that aren't part of an already found configured route...
- 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 getTestData
has 378 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function* getTestData() {
{
@customElement({ name: 'app', template: '<div ref="container" id="cr">1</div><child ref="child" id="child"></child><div ref="container2" id="cr2">11</div>' })
class App {
public readonly container: HTMLElement = void 0;
File checked-observer.spec.ts
has 785 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
Constructable
} from '@aurelia/kernel';
import {
IObserver,
File assert.ts
has 780 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 di.integration.spec.ts
has 751 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { DI, IContainer, inject, InterfaceSymbol, Registration, singleton } from '@aurelia/kernel';
import { assert, createSpy, ISpy } from '@aurelia/testing';
describe('1-kernel/di.integration.spec.ts', function () {
describe('registerInRequester', function () {
Function getTestData
has 340 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function* getTestData(): Generator<[hook: HookName, getExpectedErrorLog: (phase: Phase) => any[]]> {
yield [
'canLoad',
(phase: Phase) => {
switch (phase) {