aurelia/aurelia

View on GitHub

Showing 1,102 of 5,656 total issues

File template-compiler.static.if-else.double.spec.ts has 8697 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Aurelia, CustomElement } from "@aurelia/runtime-html";
import { TestContext, assert } from "@aurelia/testing";

describe("3-runtime-html/generated/template-compiler.static.if-else.double.spec.ts", function () {
    function createFixture() {

    Function getSiblingHookTestData has 4055 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function* getSiblingHookTestData(): Generator<SiblingHookTestData> {
        function createRoot(ticks: number): [root: Class<unknown>, scopes: string[]] {
          abstract class Base extends AsyncBaseViewModelWithAllHooks {
            public constructor(@ILogger logger: ILogger) {
              super(logger, ticks);
    Severity: Major
    Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts - About 2 wks to fix

      File lifecycle-hooks.spec.ts has 5804 lines of code (exceeds 250 allowed). Consider refactoring.
      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`).
      Severity: Major
      Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts - About 2 wks to fix

        File smoke-tests.spec.ts has 5702 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { LogLevel, Constructable, kebabCase, ILogConfig, Registration, noop, IModule, inject } 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, StandardConfiguration, watch } from '@aurelia/runtime-html';
        
        
        Severity: Major
        Found in packages/__tests__/src/router-lite/smoke-tests.spec.ts - About 2 wks to fix

          File data.ts has 4200 lines of code (exceeds 250 allowed). Consider refactoring.
          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/. */
          Severity: Major
          Found in packages/testing/src/data.ts - About 1 wk to fix

            File hook-tests.spec.ts has 4136 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Constructable, DI, ILogConfig, LogLevel, Registration, Writable, onResolve } from '@aurelia/kernel';
            import {
              CustomElement,
              customElement,
              ICustomElementController,
            Severity: Major
            Found in packages/__tests__/src/router-lite/hook-tests.spec.ts - About 1 wk to fix

              Function getTestData has 2107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function *getTestData() {
                  function wrap(content: string, type: 'p' | 'f' | 'r', debugMode = false) {
                    switch (type) {
                      case 'p':
                        return `<${phost}${debugMode ? ` p.bind="promise"` : ''}>${content}</${phost}>`;
              Severity: Major
              Found in packages/__tests__/src/3-runtime-html/promise.spec.ts - About 1 wk to fix

                Function getTestData has 1734 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function *getTestData() {
                    const createMyElement = (template: string, containerless = false) => {
                      class MyElement {
                        public constructor(
                          @IAuSlotsInfo public readonly slots: IAuSlotsInfo,
                Severity: Major
                Found in packages/__tests__/src/3-runtime-html/au-slot.spec.tsx - About 1 wk to fix

                  File route-recognizer.spec.ts has 2885 lines of code (exceeds 250 allowed). Consider refactoring.
                  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 () {
                  Severity: Major
                  Found in packages/__tests__/src/router-lite/route-recognizer.spec.ts - About 1 wk to fix

                    File route-recognizer.spec.ts has 2740 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { ConfigurableRoute, Endpoint, RecognizedRoute, RouteRecognizer, Parameter } from '@aurelia/route-recognizer';
                    import { assert } from '@aurelia/testing';
                    
                    describe('router/route-recognizer.spec.ts', function () {
                    
                    
                    Severity: Major
                    Found in packages/__tests__/src/router/route-recognizer.spec.ts - About 1 wk to fix

                      File route-recognizer.spec.txt.ts has 2740 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import { ConfigurableRoute, Endpoint, RecognizedRoute, RouteRecognizer, Parameter } from '@aurelia/route-recognizer';
                      import { assert } from '@aurelia/testing';
                      
                      describe(RouteRecognizer.name, function () {
                      
                      
                      Severity: Major
                      Found in packages/__tests__/src/router/route-recognizer.spec.txt.ts - About 1 wk to fix

                        File promise.spec.ts has 2584 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import {
                          reportTaskQueue,
                          Task,
                        } from '@aurelia/platform';
                        import {
                        Severity: Major
                        Found in packages/__tests__/src/3-runtime-html/promise.spec.ts - About 1 wk to fix

                          File controller.deactivation.partially-activated.spec.ts has 2271 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import {
                            DI,
                            onResolve,
                            resolve,
                          } from '@aurelia/kernel';

                            File au-slot.spec.tsx has 2123 lines of code (exceeds 250 allowed). Consider refactoring.
                            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';
                            Severity: Major
                            Found in packages/__tests__/src/3-runtime-html/au-slot.spec.tsx - About 5 days to fix

                              File template-compiler.static.if-else.spec.ts has 2051 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { Aurelia, CustomElement } from "@aurelia/runtime-html";
                              import { TestContext, assert } from "@aurelia/testing";
                              
                              describe("3-runtime-html/generated/template-compiler.static.if-else.spec.ts", function () {
                                  function createFixture() {

                                File ast.spec.ts has 1909 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { IServiceLocator, Writable, IIndexable } from '@aurelia/kernel';
                                import {
                                  eachCartesianJoin,
                                  eachCartesianJoinFactory,
                                  createScopeForTest,
                                Severity: Major
                                Found in packages/__tests__/src/2-runtime/ast.spec.ts - About 5 days to fix

                                  File template-compiler.spec.ts has 1827 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { delegateSyntax } from '@aurelia/compat-v1';
                                  import {
                                    Constructable,
                                    IContainer,
                                    kebabCase,
                                  Severity: Major
                                  Found in packages/__tests__/src/3-runtime-html/template-compiler.spec.ts - About 4 days to fix

                                    Function getParentChildHooks has a Cognitive Complexity of 231 (exceeds 5 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: Minor
                                    Found in packages/__tests__/src/router/_shared/hooks.ts - About 4 days 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 controller.hook-timings.integration.spec.ts has 1729 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { Registration, Writable, DI } from '@aurelia/kernel';
                                    import {
                                      Aurelia,
                                      customElement,
                                      ICustomElementController,

                                      Function getTestData has 924 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function* getTestData() {
                                          function wrap(content: string, isDefault: boolean = false) {
                                            const host = isDefault ? 'default-case-host' : 'case-host';
                                            return `<${host}>${content}</${host}>`;
                                          }
                                      Severity: Major
                                      Found in packages/__tests__/src/3-runtime-html/switch.spec.ts - About 4 days to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language