aurelia/aurelia

View on GitHub

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 = '';
Severity: Minor
Found in packages/testing/src/inspect.ts - About 1 day to fix

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,
Severity: Major
Found in packages/__tests__/src/3-runtime-html/interpolation.spec.ts - About 1 day to fix

    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';
    Severity: Major
    Found in packages/__tests__/src/integration/integration.spec.ts - About 1 day to fix

      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';
      Severity: Major
      Found in packages/router/src/endpoints/viewport.ts - About 1 day to fix

        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';
        Severity: Major
        Found in packages/router/src/routing-scope.ts - About 1 day to fix

          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';
          
          
          Severity: Major
          Found in packages/__tests__/src/router/router.spec.ts - About 1 day to fix

            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';
            Severity: Major
            Found in packages/__tests__/src/router/_shared/hooks.ts - About 1 day to fix

              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,
              Severity: Major
              Found in packages/__tests__/src/3-runtime-html/repeater-custom-element.spec.ts - About 1 day to fix

                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) {
                Severity: Minor
                Found in packages/testing/src/specialized-assertions.ts - About 1 day to fix

                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';
                Severity: Major
                Found in packages/__tests__/src/router/config-tests.spec.ts - About 1 day to fix

                  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;
                      }
                      Severity: Major
                      Found in packages/route-recognizer/src/index.ts - About 1 day to fix

                        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];
                        Severity: Major
                        Found in packages/__tests__/src/router/_shared/hooks.ts - About 1 day to fix

                          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[];
                          Severity: Minor
                          Found in packages/testing/src/h.ts - About 1 day to fix

                          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,
                          Severity: Major
                          Found in packages/__tests__/src/3-runtime-html/repeater.unit.spec.ts - About 1 day to fix

                            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];
                            Severity: Major
                            Found in examples/realworld-advanced/src/api.ts - About 1 day to fix

                              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;
                              Severity: Major
                              Found in packages/platform/src/index.ts - About 1 day to fix

                                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';
                                
                                
                                Severity: Major
                                Found in packages/__tests__/src/3-runtime-html/custom-elements.spec.ts - About 1 day to fix

                                  Function formatRaw has 249 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function formatRaw(
                                    ctx: IInspectContext,
                                    value: any,
                                    recurseTimes: number,
                                    typedArray?: boolean,
                                  Severity: Major
                                  Found in packages/testing/src/inspect.ts - About 1 day to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language