aurelia/aurelia

View on GitHub

Showing 1,020 of 5,354 total issues

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

import {
  CustomExpression,
  ekAccessBoundary,
  ekAccessKeyed,
  ekAccessMember,
Severity: Minor
Found in packages/expression-parser/src/ast.visitor.ts - About 6 hrs to fix

    Function processInstructions has 154 lines of code (exceeds 25 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: Major
    Found in packages/router/src/routing-scope.ts - About 6 hrs to fix

      Function stackBlurCanvasRGBA has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      function stackBlurCanvasRGBA( canvas, top_x, top_y, width, height, radius )
      {
          if ( isNaN(radius) || radius < 1 ) return;
          radius |= 0;
      
      
      Severity: Minor
      Found in examples/navigation-skeleton/src/blur-image.ts - About 6 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 formatProperty has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

      export function formatProperty(
        ctx: IInspectContext,
        value: any,
        recurseTimes: number,
        key: PropertyKey,
      Severity: Minor
      Found in packages/testing/src/inspect.ts - About 6 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 location-manager.spec.ts has 417 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { IPlatform, resolve } from '@aurelia/kernel';
      import { IRouter, IRouterEvents, route } from '@aurelia/router-lite';
      import { customElement, IHistory, IWindow } from '@aurelia/runtime-html';
      import { assert } from '@aurelia/testing';
      import { isNode } from '../util.js';
      Severity: Minor
      Found in packages/__tests__/src/router-lite/location-manager.spec.ts - About 6 hrs to fix

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

        /* eslint-disable mocha/no-sibling-hooks */
        import { DI, Class } from '@aurelia/kernel';
        import {
          ValidationConfiguration,
          IValidator,
        Severity: Minor
        Found in packages/__tests__/src/validation/validator.spec.ts - About 6 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              } else if (typeof configOrPath === 'object') {
                const config = configOrPath;
                validateRouteConfig(config, '');
          
                const path = ensureArrayOfStrings(config.path ?? Type?.path ?? emptyArray);
          Severity: Critical
          Found in packages/router-lite/src/route.ts - About 6 hrs to fix

            Function transition has 150 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public async transition(coordinator: NavigationCoordinator): Promise<void> {
                const navigatingPrefix = this.router.configuration.options.indicators.viewportNavigating;
            
                this.coordinators.push(coordinator);
                // If this isn't the first coordinator, a navigation is already in process...
            Severity: Major
            Found in packages/router/src/endpoints/viewport.ts - About 6 hrs to fix

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

              import { ComputedObserver, IDirtyChecker, IObserverLocator } from '@aurelia/runtime';
              import {
                Constructable,
              } from '@aurelia/kernel';
              import {
              Severity: Minor
              Found in packages/__tests__/src/3-runtime-html/computed-observer.spec.ts - About 5 hrs to fix

                Function flush has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                Open

                  public flush(time: number = this._now()): void {
                    if (__DEV__ && this._tracer.enabled) { this._tracer.enter(this, 'flush'); }
                
                    this._flushRequested = false;
                    this._lastFlush = time;
                Severity: Minor
                Found in packages/platform/src/index.ts - About 5 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 target-observers.spec.ts has 412 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import {
                  AttributeNSAccessor,
                  ClassAttributeAccessor,
                  DataAttributeAccessor,
                  StyleAttributeAccessor
                Severity: Minor
                Found in packages/__tests__/src/3-runtime-html/target-observers.spec.ts - About 5 hrs to fix

                  File repeat.contextual-props.spec.ts has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                    noop
                  } from '@aurelia/kernel';
                  import {
                    ValueConverter,
                  Severity: Minor
                  Found in packages/__tests__/src/3-runtime-html/repeat.contextual-props.spec.ts - About 5 hrs to fix

                    Controller has 42 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    export class Controller<C extends IViewModel = IViewModel> implements IController<C> {
                    
                      public head: IHydratedController | null = null;
                      public tail: IHydratedController | null = null;
                      public next: IHydratedController | null = null;
                    Severity: Minor
                    Found in packages/runtime-html/src/templating/controller.ts - About 5 hrs to fix

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

                      import { IExpressionParser } from '@aurelia/expression-parser';
                      import {
                        BindingMode,
                        AuSlot,
                        CustomElement,

                        Function constructor has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                        Open

                          public constructor(options: IAssertionErrorOpts) {
                            const {
                              actual,
                              expected,
                              message,
                        Severity: Minor
                        Found in packages/testing/src/inspect.ts - About 5 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 mapEquiv has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function mapEquiv(
                          a: Map<any, any>,
                          b: Map<any, any>,
                          strict: boolean,
                          memos?: Memos,
                        Severity: Minor
                        Found in packages/testing/src/comparison.ts - About 5 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 proxy-observation.ts has 396 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { IIndexable, isArray, isMap, isSet } from '@aurelia/kernel';
                        import { Collection, IConnectable } from './interfaces';
                        import { rtObjectFreeze, rtSafeString } from './utilities';
                        import { connecting, currentConnectable, _connectable } from './connectable-switcher';
                        
                        
                        Severity: Minor
                        Found in packages/runtime/src/proxy-observation.ts - About 5 hrs to fix

                          Function advance has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                          Open

                            public advance(ch: string): void {
                              const { chars, states, skippedStates, result } = this;
                              let stateToAdd: AnyState<T> | null = null;
                          
                              let matchCount = 0;
                          Severity: Minor
                          Found in packages/route-recognizer/src/index.ts - About 5 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 binding-command.ts has 389 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { IExpressionParser } from '@aurelia/expression-parser';
                          import { Protocol, camelCase, emptyArray, firstDefined, getResourceKeyFor, mergeArrays, resolve, resource, resourceBaseName } from '@aurelia/kernel';
                          import { defineMetadata, getMetadata } from './utilities-metadata';
                          import { IAttrMapper } from './attribute-mapper';
                          import {
                          Severity: Minor
                          Found in packages/template-compiler/src/binding-command.ts - About 5 hrs to fix

                            RoutingScope has 40 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export class RoutingScope {
                              /** @internal */
                              private static lastId = 0;
                            
                              public id = ++RoutingScope.lastId;
                            Severity: Minor
                            Found in packages/router/src/routing-scope.ts - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language