aurelia/aurelia

View on GitHub

Showing 1,020 of 5,354 total issues

File 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/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() {
              super(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 5740 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 5696 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { LogLevel, Constructable, kebabCase, ILogConfig, Registration, noop, IModule, inject, resolve } 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, 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, resolve } 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 1708 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function* getTestData() {
                  const createMyElement = (template: string, containerless = false) => {
                    class MyElement {
                      public readonly slots: IAuSlotsInfo = resolve(IAuSlotsInfo);
                      public constructor() {
              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.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 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 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 2206 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 6 days to fix

                          File 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/static.if-else.spec.ts", function () {
                              function createFixture() {
                          Severity: Major
                          Found in packages/__tests__/src/3-runtime-html/generated/static.if-else.spec.ts - About 5 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 1727 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

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

                              File template-compiler.spec.ts has 1608 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

                                File inspect.ts has 1597 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:
                                /*
                                Severity: Major
                                Found in packages/testing/src/inspect.ts - About 4 days to fix

                                  File array-observer.spec.ts has 1587 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import {
                                    ArrayObserver,
                                    copyIndexMap,
                                    ICollectionSubscriber,
                                    IndexMap,
                                  Severity: Major
                                  Found in packages/__tests__/src/2-runtime/array-observer.spec.ts - About 4 days to fix

                                    File translation-integration.spec.ts has 1570 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { I18N, I18nConfiguration, Signals } from '@aurelia/i18n';
                                    import { Class, IContainer } from '@aurelia/kernel';
                                    import { ISignaler, Aurelia, bindable, customElement, INode, IPlatform } from '@aurelia/runtime-html';
                                    import { assert, PLATFORM, TestContext } from '@aurelia/testing';
                                    import { createSpecFunction, TestExecutionContext, TestFunction } from '../../util.js';
                                    Severity: Major
                                    Found in packages/__tests__/src/i18n/t/translation-integration.spec.ts - About 4 days to fix

                                      File preprocess-resource.spec.ts has 1552 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import * as path from 'path';
                                      import { preprocessResource, preprocessOptions } from '@aurelia/plugin-conventions';
                                      import { assert } from '@aurelia/testing';
                                      
                                      describe('preprocessResource', function () {
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language