Showing 1,031 of 5,280 total issues
Function createErrDiff
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
function createErrDiff(actual: any, expected: any, operator: keyof IOperatorText): string {
let other = '';
let res = '';
let lastPos = 0;
let end = '';
- 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 interpolation.spec.ts
has 695 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
assert,
createContainer,
createFixture,
createObserverLocator,
File integration.spec.ts
has 690 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { toArray } from '@aurelia/kernel';
import { DirtyCheckProperty, IDirtyChecker } from '@aurelia/runtime';
import { assert, getVisibleText, eachCartesianJoin } from '@aurelia/testing';
import { App, Product } from './app/app.js';
import { Cards } from './app/molecules/cards/cards.js';
File viewport.ts
has 682 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { IContainer } from '@aurelia/kernel';
import { CustomElement, IHydratedController, IHydratedParentController, ICustomElementController } from '@aurelia/runtime-html';
import { ComponentAppellation, IRouteableComponent, RouteableComponentType, LoadInstruction } from '../interfaces';
import { IRouter } from '../router';
import { arrayRemove } from '../utilities/utils';
File routing-scope.ts
has 674 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable prefer-template */
/* eslint-disable max-lines-per-function */
import { NavigationCoordinator } from './navigation-coordinator';
import { IViewportScopeOptions, ViewportScope } from './endpoints/viewport-scope';
import { CustomElement, ICustomElementController, ICustomElementViewModel } from '@aurelia/runtime-html';
File router.spec.ts
has 673 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { IContainer } from '@aurelia/kernel';
import { IRouter, RouterConfiguration, routes, Viewport } from '@aurelia/router';
import { CustomElement, customElement, IPlatform, Aurelia } from '@aurelia/runtime-html';
import { assert, MockBrowserHistoryLocation, TestContext } from '@aurelia/testing';
File hooks.ts
has 651 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { assert } from '@aurelia/testing';
import { HookName } from './hook-invocation-tracker.js';
import { TransitionComponent } from './component.js';
import { Transition } from './transition.js';
import { TransitionViewport } from './transition-viewport.js';
File repeater-custom-element.spec.ts
has 640 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Class } from '@aurelia/kernel';
import {
BindingBehavior,
customElement,
bindable,
Function verifyBindingInstructionsEqual
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
export function verifyBindingInstructionsEqual(actual: any, expected: any, errors?: string[], path?: string): any {
if (path === undefined) {
path = 'instruction';
}
if (errors === 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 config-tests.spec.ts
has 621 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { customElement, ICustomElementController } from '@aurelia/runtime-html';
import { IRouterOptions, route, Routes, routes } from '@aurelia/router';
import { assert } from '@aurelia/testing';
import { IHookInvocationAggregator, IHIAConfig, HookName } from './_shared/hook-invocation-tracker.js';
File template-compiler.local-templates.spec.ts
has 620 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
DefaultLogger, IContainer, ILogEvent, ISink, kebabCase, LoggerConfiguration, LogLevel
} from '@aurelia/kernel';
import {
BindingMode,
File strip-meta-data.spec.ts
has 620 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BindingMode } from '@aurelia/runtime-html';
import { stripMetaData } from '@aurelia/plugin-conventions';
import * as assert from 'assert';
describe('stripMetaData', function () {
File index.ts
has 613 lines of code (exceeds 250 allowed). Consider refactoring. Open
export interface IConfigurableRoute<T> {
readonly path: string;
readonly caseSensitive?: boolean;
readonly handler: T;
}
Function getParentChildHooks
has 265 lines of code (exceeds 25 allowed). Consider refactoring. 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];
Function hJsx
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
export const hJsx = function (this: Document, name: string, attrs: Record<string, string> | null, ...children: (Node | string | (Node | string)[])[]) {
const doc = this || PLATFORM.document;
const el = doc.createElement(name === 'let$' ? 'let' : name);
if (attrs != null) {
let value: string | string[];
- 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 repeater.unit.spec.ts
has 600 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { AccessScopeExpression, ForOfStatement, BindingIdentifier } from '@aurelia/expression-parser';
import { DirtyChecker } from '@aurelia/runtime';
import {
Scope,
BindingContext,
File api.ts
has 594 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { IWindow } from '@aurelia/runtime-html';
import { DI, IHttpClient, ILogger } from 'aurelia';
// eslint-disable-next-line @typescript-eslint/ban-types
type FuncPropNames<T> = { [K in keyof T]: T[K] extends Function ? K : never; }[keyof T];
File index.ts
has 587 lines of code (exceeds 250 allowed). Consider refactoring. Open
const tsPending = 'pending' as const;
const tsRunning = 'running' as const;
const tsCompleted = 'completed' as const;
const tsCanceled = 'canceled' as const;
export type TaskStatus = typeof tsPending | typeof tsRunning | typeof tsCompleted | typeof tsCanceled;
File custom-elements.spec.ts
has 585 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { AppTask, Aurelia, bindable, BindingMode, customElement, CustomElement, IAppRoot, IAurelia, IKeyMapping, ShortHandBindingSyntax, ValueConverter } from '@aurelia/runtime-html';
import { assert, createFixture } from '@aurelia/testing';
import { delegateSyntax } from '@aurelia/compat-v1';
import { resolve } from '@aurelia/kernel';
Function formatRaw
has 249 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatRaw(
ctx: IInspectContext,
value: any,
recurseTimes: number,
typedArray?: boolean,