aurelia/aurelia

View on GitHub

Showing 1,020 of 5,354 total issues

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

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

    import { skip, take } from "rxjs/operators";
    
    import { assert } from '@aurelia/testing';
    import {
      MiddlewarePlacement,
    Severity: Major
    Found in packages/__tests__/src/store-v1/middleware.spec.ts - About 1 day to fix

      Function innerDeepEqual has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
      Open

      export function innerDeepEqual(
        val1: unknown,
        val2: unknown,
        strict: boolean,
        memos?: Memos,
      Severity: Minor
      Found in packages/testing/src/comparison.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-if-else.spec.ts has 571 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        CustomElement,
        IPlatform,
        Aurelia,
      } from '@aurelia/runtime-html';
      Severity: Major
      Found in packages/__tests__/src/3-runtime-html/repeater-if-else.spec.ts - About 1 day to fix

        File process-content.spec.ts has 567 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { IContainer, noop, toArray } from '@aurelia/kernel';
        import { Aurelia, BindingMode, bindable, CustomElement, customElement, INode, IPlatform, processContent } from '@aurelia/runtime-html';
        import { assert, TestContext } from '@aurelia/testing';
        import { createSpecFunction, TestExecutionContext as $TestExecutionContext, TestFunction } from '../util.js';
        
        
        Severity: Major
        Found in packages/__tests__/src/3-runtime-html/process-content.spec.ts - About 1 day to fix

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

            Function getNonSiblingHooks has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getNonSiblingHooks(deferUntil, swapStrategy, phase, transitionComponents) {
              console.log('transitions', JSON.parse(JSON.stringify(transitionComponents)));
            
              const transitions: Transition[] = [];
              for (let i = 0; i < transitionComponents.length; i++) {
            Severity: Minor
            Found in packages/__tests__/src/router/_shared/hooks.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 viewport.spec.ts has 557 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { IRouter, IRouteViewModel, Params, route, Router, ViewportCustomElement } from '@aurelia/router-lite';
            import { CustomElement, customElement, IPlatform } from '@aurelia/runtime-html';
            import { assert } from '@aurelia/testing';
            import { start } from '../_shared/create-fixture.js';
            
            
            Severity: Major
            Found in packages/__tests__/src/router-lite/resources/viewport.spec.ts - About 1 day to fix

              File api.ts has 551 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/src/api.ts - About 1 day to fix

                File api.ts has 551 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-conventions/src/api.ts - About 1 day to fix

                  Function hydrate has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public hydrate(raw: any): any {
                      switch (raw.$TYPE) {
                        case ASTExpressionTypes.AccessMemberExpression: {
                          const expr: Pick<AST.AccessMemberExpression, 'object' | 'name'> = raw;
                          return new AST.AccessMemberExpression(this.hydrate(expr.object), expr.name);
                  Severity: Minor
                  Found in packages/validation/src/ast-serialization.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 spread.spec.ts has 538 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { Constructable, resolve } from '@aurelia/kernel';
                  import { BindingMode, CustomAttribute, CustomElement, ICustomElementViewModel, INode, ValueConverter } from '@aurelia/runtime-html';
                  import { assert, createFixture } from '@aurelia/testing';
                  
                  describe('3-runtime-html/spread.spec.ts', function () {
                  Severity: Major
                  Found in packages/__tests__/src/3-runtime-html/spread.spec.ts - About 1 day to fix

                    File validation-controller.spec.ts has 538 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { IServiceLocator, newInstanceForScope, resolve } from '@aurelia/kernel';
                    import { Aurelia, CustomElement, IPlatform, customElement } from '@aurelia/runtime-html';
                    import { assert, TestContext } from '@aurelia/testing';
                    import {
                      IValidationRules,
                    Severity: Major
                    Found in packages/__tests__/src/validation-html/validation-controller.spec.ts - About 1 day to fix

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

                        function* getTestData() {
                          const identityArrTmplt = `<span repeat.for="item of arr | identity">\${item}</span>`;
                          yield new TestData(
                            'array mutation - identity VC',
                            identityArrTmplt,
                      Severity: Major
                      Found in packages/__tests__/src/3-runtime-html/repeat.vc.bb.spec.ts - About 1 day to fix

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

                        import {
                          Constructable, resolve,
                        } from '@aurelia/kernel';
                        import {
                          assert,

                          File au-slot.slotted.spec.ts has 529 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { CustomElement, customElement, slotted } from '@aurelia/runtime-html';
                          import { assert, createFixture } from '@aurelia/testing';
                          
                          describe('3-runtime-html/au-slot.slotted.spec.ts', function () {
                            describe('intitial rendering', function () {
                          Severity: Major
                          Found in packages/__tests__/src/3-runtime-html/au-slot.slotted.spec.ts - About 1 day to fix

                            File router.ts has 520 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /* eslint-disable prefer-template */
                            /**
                             *
                             * NOTE: This file is still WIP and will go through at least one more iteration of refactoring, commenting and clean up!
                             * In its current state, it is NOT a good source for learning about the inner workings and design of the router.
                            Severity: Major
                            Found in packages/router/src/router.ts - About 1 day to fix

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

                              import { Subscription } from 'rxjs';
                              
                              import { pluck, distinctUntilChanged } from "rxjs/operators";
                              
                              import { customElement, IWindow } from '@aurelia/runtime-html';
                              Severity: Major
                              Found in packages/__tests__/src/store-v1/decorator.spec.ts - About 1 day to fix

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

                                import { skip } from "rxjs/operators";
                                
                                import {
                                  LogLevel,
                                  PerformanceMeasurement,
                                Severity: Major
                                Found in packages/__tests__/src/store-v1/store.spec.ts - About 1 day to fix

                                  File portal.spec.tsx has 498 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /* eslint-disable @typescript-eslint/no-unused-expressions */
                                  import { Constructable, IRegistry } from '@aurelia/kernel';
                                  import { CustomElement, Aurelia } from '@aurelia/runtime-html';
                                  import {
                                    assert,
                                  Severity: Minor
                                  Found in packages/__tests__/src/3-runtime-html/portal.spec.tsx - About 7 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language