Showing 1,031 of 5,280 total issues
File binding-context.spec.ts
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Scope } from '@aurelia/runtime-html';
import { assert } from '@aurelia/testing';
describe('2-runtime/binding-context.spec.ts', function () {
describe('create', function () {
Function $
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
function* $(
prefix: string,
component: string | string[],
ticks: number,
...calls: (string | Generator<string, void>)[]
- 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 serialization.spec.ts
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable mocha/no-sibling-hooks */
import { IExpressionParser } from '@aurelia/expression-parser';
import { assert, TestContext } from '@aurelia/testing';
import {
EqualsRule,
Function getTestData
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* getTestData(): Generator<[hook: HookName, getExpectedErrorLog: (phase: Phase) => any[]]> {
yield [
'canLoad',
function getExpectedErrorLog(phase: Phase) {
switch (phase) {
File integration.spec.ts
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Class,
IContainer,
} from '@aurelia/kernel';
import {
File ast.spec.ts
has 468 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { assert } from '@aurelia/testing';
import {
RouteExpression,
CompositeSegmentExpression,
ScopedSegmentExpression,
File arrow-fn.spec.ts
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BindingBehavior, ValueConverter, CustomAttribute, INode } from '@aurelia/runtime-html';
import { assert, createFixture } from '@aurelia/testing';
describe('3-runtime-html/arrow-fn.spec.ts', function () {
Function getTestData
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* getTestData(): Generator<[hook: HookName, getExpectedErrorLog: (phase: string, currentParent: string, currentChild: string, nextParent: string, nextChild: string) => any[]]> {
yield [
'canLoad',
function getExpectedErrorLog(phase: string, currentParent: string, currentChild: string, nextParent: string, nextChild: string) {
return currentParent === nextParent
File runner.spec.ts
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Runner, Step } from '@aurelia/router';
import { assert } from '@aurelia/testing';
const createTimedPromise = (value, time: number, previousValue?, reject = false): Promise<unknown> => {
return new Promise((res, rej) => {
File template-compiler.ref.spec.ts
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Constructable,
noop,
} from '@aurelia/kernel';
import {
File binding-commands.throttle-debounce.spec.ts
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { TestContext, assert, createFixture } from '@aurelia/testing';
import { BindingMode, customElement, bindable, Aurelia, ISignaler } from '@aurelia/runtime-html';
import { delegateSyntax } from '@aurelia/compat-v1';
async function wait(ms: number): Promise<void> {
File util.ts
has 447 lines of code (exceeds 250 allowed). Consider refactoring. 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 config-tests.spec.ts
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Aurelia, CustomElement, customElement, ICustomElementController } from '@aurelia/runtime-html';
import { IRouteConfig, IRouter, IRouteViewModel, route, Route, RouteConfig, RouteNode, RouterConfiguration } from '@aurelia/router-lite';
import { assert, TestContext } from '@aurelia/testing';
import { IHookInvocationAggregator, IHIAConfig, HookName } from './_shared/hook-invocation-tracker.js';
Function parse
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public static parse(seps: Separators, instructions: string, grouped: boolean, topScope: boolean): { instructions: RoutingInstruction[]; remaining: string } {
if (!instructions) {
return { instructions: [], remaining: '' };
}
if (instructions.startsWith(seps.sibling) && !InstructionParser.isAdd(seps, 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 findMatchingRouteInRoutes
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
private findMatchingRouteInRoutes(path: string, routes: Route[], parameters: Parameters): FoundRoute {
const found = new FoundRoute();
if (routes.length === 0) {
return found;
}
- 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 keyCheck
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
export function keyCheck(
val1: {},
val2: {},
strict: boolean,
memos: Memos | 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
Function createErrDiff
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createErrDiff(actual: any, expected: any, operator: keyof IOperatorText): string {
let other = '';
let res = '';
let lastPos = 0;
let end = '';
File smoke-tests.spec.ts
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
Constructable,
kebabCase,
} from '@aurelia/kernel';
import {
File ast.visitor.ts
has 425 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
CustomExpression,
ekAccessBoundary,
ekAccessKeyed,
ekAccessMember,
Function processInstructions
has 154 lines of code (exceeds 25 allowed). Consider refactoring. 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...