aurelia/aurelia

View on GitHub

Showing 1,020 of 5,369 total issues

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

import { ValueConverter, customAttribute, customElement, ICustomAttributeController, IWindow } from '@aurelia/runtime-html';
import { StateDefaultConfiguration, fromState } from '@aurelia/state';
import { assert, createFixture, onFixtureCreated } from '@aurelia/testing';

describe('state/state.spec.ts', function () {
Severity: Minor
Found in packages/__tests__/src/state/state.spec.ts - About 4 hrs to fix

    Function updateNavigation has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

      private async updateNavigation(navigation: Navigation): Promise<void> {
        // Make sure instructions added not from root scope are properly parented
        // up to root scope
        (this.rootScope as ViewportScope).scope.reparentRoutingInstructions();
    
    
    Severity: Minor
    Found in packages/router/src/router.ts - About 4 hrs 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 custom-elements.harmony.spec.ts has 350 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { delegateSyntax } from '@aurelia/compat-v1';
    import {
      CustomAttribute,
      CustomElement,
      INode,
    Severity: Minor
    Found in packages/__tests__/src/3-runtime-html/custom-elements.harmony.spec.ts - About 4 hrs to fix

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

      import { DI, IIndexable, IPlatform, Registration } from '@aurelia/kernel';
      import {
        IDirtyChecker,
        IObserverLocator,
        INodeObserverLocator,
      Severity: Minor
      Found in packages/__tests__/src/2-runtime/computed-observer.spec.ts - About 4 hrs to fix

        RoutingInstruction has 34 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class RoutingInstruction {
          /**
           * The component part of the routing instruction.
           */
          public component: InstructionComponent;
        Severity: Minor
        Found in packages/router/src/instructions/routing-instruction.ts - About 4 hrs to fix

          Function getNonSiblingHooks has 108 lines of code (exceeds 25 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: Major
          Found in packages/__tests__/src/router/_shared/hooks.ts - About 4 hrs to fix

            Function from has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

              public static from(def: CustomAttributeDefinition | null, alias: string): AttrInfo | null {
                if (def === null) {
                  return null;
                }
                let rec = attrInfoLookup.get(def);

            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 _finalize has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

              public _finalize(): boolean {
                function collectSkippedStates(
                  skippedStates: DynamicState<T>[],
                  state: AnyState<T>,
                ): void {
            Severity: Minor
            Found in packages/route-recognizer/src/index.ts - About 4 hrs 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 preprocess.spec.ts has 340 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import * as path from 'path';
            import { preprocess, IFileUnit } from '@aurelia/plugin-conventions';
            import { assert } from '@aurelia/testing';
            
            describe('preprocess', function () {
            Severity: Minor
            Found in packages-tooling/__tests__/src/plugin-conventions/preprocess.spec.ts - About 4 hrs to fix

              Function compareTo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                public compareTo(b: Candidate<T>): -1 | 1 | 0 {
                  const statesA = this.states;
                  const statesB = b.states;
              
                  for (let iA = 0, iB = 0, ii = Math.max(statesA.length, statesB.length); iA < ii; ++iA) {
              Severity: Minor
              Found in packages/route-recognizer/src/index.ts - About 4 hrs 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 process has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                public static process<T = unknown>(step: Step<T> | null): void {
                  const root = step!.root;
                  while (step !== null && !step.isDoing && !step.isDone) {
                    root.current = step;
                    if (step.isParallelParent) {
              Severity: Minor
              Found in packages/router/src/utilities/runner.ts - About 4 hrs 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 getHookTestData has 102 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function* getHookTestData() {
                  yield {
                    name: 'a1(canLoad:4)/a2+b1/b2',
                    a1: createHookTimingConfiguration({ canLoad: 4 }),
                    a2: createHookTimingConfiguration(),
              Severity: Major
              Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts - About 4 hrs to fix

                Function innerDeepEqual has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function innerDeepEqual(
                  val1: unknown,
                  val2: unknown,
                  strict: boolean,
                  memos?: Memos,
                Severity: Major
                Found in packages/testing/src/comparison.ts - About 4 hrs to fix

                  Function $setup has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function $setup(platform: BrowserPlatform): void {
                    setPlatform(platform);
                    BrowserPlatform.set(globalThis, platform);
                  
                    if (typeof window !== 'undefined') window.addEventListener('error', e => console.log(e));
                  Severity: Major
                  Found in packages/__tests__/src/setup-shared.ts - About 4 hrs to fix

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

                    /* eslint-disable @typescript-eslint/strict-boolean-expressions */
                    import { IContainer, ILogger } from '@aurelia/kernel';
                    import { IWindow } from "@aurelia/runtime-html";
                    import { BehaviorSubject, Observable } from 'rxjs';
                    
                    
                    Severity: Minor
                    Found in packages/store-v1/src/store.ts - About 4 hrs to fix

                      File ast-serialization.ts has 334 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /* eslint-disable @typescript-eslint/no-explicit-any */
                      /* eslint-disable @typescript-eslint/no-unsafe-member-access */
                      import * as AST from '@aurelia/expression-parser';
                      import { ErrorNames, createMappedError } from './errors';
                      
                      
                      Severity: Minor
                      Found in packages/validation/src/ast-serialization.ts - About 4 hrs to fix

                        File transition-viewport.ts has 331 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { DeferralJuncture, SwapStrategy } from './create-fixture.js';
                        import { Component } from './component.js';
                        import { HookName, MaybeHookName } from './hook-invocation-tracker.js';
                        import { Transition } from './transition.js';
                        
                        
                        Severity: Minor
                        Found in packages/__tests__/src/router/_shared/transition-viewport.ts - About 3 hrs to fix

                          Function run has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                          Open

                            public run(time: number = this.taskQueue.platform.performanceNow()): void {
                              if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'run'); }
                          
                              if (this._status !== tsPending) {
                                if (__DEV__ && this._tracer.enabled) { this._tracer.leave(this, 'run error'); }
                          Severity: Minor
                          Found in packages/platform/src/index.ts - About 3 hrs 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 setEquiv has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function setEquiv(
                            a: Set<any>,
                            b: Set<any>,
                            strict: boolean,
                            memos?: Memos,
                          Severity: Minor
                          Found in packages/testing/src/comparison.ts - About 3 hrs 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 decorator-watch.expression.spec.ts has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { BindingMode, bindable, customAttribute, customElement, watch } from '@aurelia/runtime-html';
                          import { assert, createFixture, TestContext } from '@aurelia/testing';
                          
                          describe('3-runtime-html/decorator-watch.expression.spec.ts', function () {
                            const testCases: ITestCase[] = [
                            Severity
                            Category
                            Status
                            Source
                            Language