aurelia/aurelia

View on GitHub

Showing 1,031 of 5,280 total issues

File controller.ts has 1268 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
import {
  AnyFunction,
  IIndexable,
  ILogger,
Severity: Major
Found in packages/runtime-html/src/templating/controller.ts - About 3 days to fix

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

    import { TestContext, assert } from '@aurelia/testing';
    import { QueueTaskOptions, ITask, TaskQueue } from '@aurelia/platform';
    
    function createExposedPromise() {
      let resolve: () => void;
    Severity: Major
    Found in packages/__tests__/src/2-runtime/scheduler.spec.ts - About 3 days to fix

      File au-compose.spec.ts has 1225 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { resolve } from '@aurelia/kernel';
      import {
        CustomElement,
        customElement,
        AuCompose,
      Severity: Major
      Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts - About 3 days to fix

        Function formatRaw has a Cognitive Complexity of 148 (exceeds 5 allowed). Consider refactoring.
        Open

        export function formatRaw(
          ctx: IInspectContext,
          value: any,
          recurseTimes: number,
          typedArray?: boolean,
        Severity: Minor
        Found in packages/testing/src/inspect.ts - About 3 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 load.spec.ts has 1099 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { IRouteContext, IRouteViewModel, Params, route, RouteNode } from '@aurelia/router-lite';
        import { CustomElement, customElement, ILocation, IPlatform } from '@aurelia/runtime-html';
        import { assert, MockBrowserHistoryLocation } from '@aurelia/testing';
        import { start } from '../_shared/create-fixture.js';
        import { resolve } from '@aurelia/kernel';
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts - About 2 days to fix

          File preprocess-html-template.spec.ts has 1057 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import * as path from 'path';
          import { preprocessHtmlTemplate, preprocessOptions } from '@aurelia/plugin-conventions';
          import { assert } from '@aurelia/testing';
          
          describe('preprocessHtmlTemplate', function () {

            File rule-provider.spec.ts has 987 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* eslint-disable no-constant-condition, mocha/no-sibling-hooks */
            import { Metadata } from '@aurelia/metadata';
            import {
              DI,
              ILogEvent,
            Severity: Major
            Found in packages/__tests__/src/validation/rule-provider.spec.ts - About 2 days to fix

              File dialog-service.spec.ts has 896 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { delegateSyntax } from '@aurelia/compat-v1';
              import { noop } from '@aurelia/kernel';
              import {
                INode,
                customElement,
              Severity: Major
              Found in packages/__tests__/src/3-runtime-html/dialog/dialog-service.spec.ts - About 2 days to fix

                File repeat.keyed.array.spec.ts has 875 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /* eslint-disable @typescript-eslint/no-unused-vars */
                import { batch } from '@aurelia/runtime';
                import { Aurelia, CustomElement, ICustomElementViewModel } from '@aurelia/runtime-html';
                import { TestContext, assert } from "@aurelia/testing";
                
                
                Severity: Major
                Found in packages/__tests__/src/3-runtime-html/repeat.keyed.array.spec.ts - About 2 days to fix

                  File di.get.spec.ts has 867 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { all, Constructable, DI, factory, IContainer, resolve, IResolvedFactory, lazy, newInstanceForScope, newInstanceOf, optional, Registration, singleton, transient } from '@aurelia/kernel';
                  import { assert } from '@aurelia/testing';
                  
                  describe('1-kernel/di.get.spec.ts', function () {
                    let container: IContainer;
                  Severity: Major
                  Found in packages/__tests__/src/1-kernel/di.get.spec.ts - About 2 days to fix

                    File custom-attributes.spec.ts has 859 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { DI, IContainer, Registration, resolve } from '@aurelia/kernel';
                    import {
                      CustomAttribute,
                      IAurelia,
                      IHydratedComponentController,
                    Severity: Major
                    Found in packages/__tests__/src/3-runtime-html/custom-attributes.spec.ts - About 2 days to fix

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

                        function* getTestData() {
                          {
                            class MyElement {
                              public static hookInvoked: boolean = false;
                              public static processContent(_node: INode, _p: IPlatform) {
                      Severity: Major
                      Found in packages/__tests__/src/3-runtime-html/process-content.spec.ts - About 2 days to fix

                        Function processInstructions has a Cognitive Complexity of 99 (exceeds 5 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...
                        Severity: Minor
                        Found in packages/router/src/routing-scope.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

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

                          function* getTestData() {
                            {
                              @customElement({ name: 'app', template: '<div ref="container" id="cr">1</div><child ref="child" id="child"></child><div ref="container2" id="cr2">11</div>' })
                              class App {
                                public readonly container: HTMLElement = void 0;
                        Severity: Major
                        Found in packages/__tests__/src/3-runtime-html/integration.spec.ts - About 1 day to fix

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

                          import {
                            Constructable
                          } from '@aurelia/kernel';
                          import {
                            enableArrayObservation,
                          Severity: Major
                          Found in packages/__tests__/src/3-runtime-html/checked-observer.spec.ts - About 1 day to fix

                            File assert.ts has 785 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/assert.ts - About 1 day to fix

                              File di.integration.spec.ts has 751 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { DI, IContainer, inject, InterfaceSymbol, Registration, singleton } from '@aurelia/kernel';
                              import { assert, createSpy, ISpy } from '@aurelia/testing';
                              
                              describe('1-kernel/di.integration.spec.ts', function () {
                                describe('registerInRequester', function () {
                              Severity: Major
                              Found in packages/__tests__/src/1-kernel/di.integration.spec.ts - About 1 day to fix

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

                                        function* getTestData(): Generator<[hook: HookName, getExpectedErrorLog: (phase: Phase) => any[]]> {
                                          yield [
                                            'canLoad',
                                            (phase: Phase) => {
                                              switch (phase) {
                                Severity: Major
                                Found in packages/__tests__/src/router-lite/hook-tests.spec.ts - About 1 day to fix

                                  File preprocess-resource.spec.ts has 725 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 () {

                                    File bindable-coercer.spec.ts has 701 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { Constructable, DI, noop, Registration } from '@aurelia/kernel';
                                    import { Aurelia, bindable, customElement, CustomElement, IPlatform, coercer, customAttribute, CustomAttribute, StandardConfiguration } from '@aurelia/runtime-html';
                                    import { assert, PLATFORMRegistration, TestContext } from '@aurelia/testing';
                                    import { createSpecFunction, TestExecutionContext, TestFunction } from '../util.js';
                                    
                                    
                                    Severity: Major
                                    Found in packages/__tests__/src/3-runtime-html/bindable-coercer.spec.ts - About 1 day to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language