aurelia/aurelia

View on GitHub

Showing 1,031 of 5,280 total issues

File binding-context.spec.ts has 483 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Scope } from '@aurelia/runtime-html';
import { assert } from '@aurelia/testing';

describe('2-runtime/binding-context.spec.ts', function () {
  describe('create', function () {
Severity: Minor
Found in packages/__tests__/src/2-runtime/binding-context.spec.ts - About 7 hrs to fix

    Function $ has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    function* $(
      prefix: string,
      component: string | string[],
      ticks: number,
      ...calls: (string | Generator<string, void>)[]
    Severity: Minor
    Found in packages/__tests__/src/router-lite/hook-tests.spec.ts - About 7 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 serialization.spec.ts has 475 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable mocha/no-sibling-hooks */
    import { IExpressionParser } from '@aurelia/expression-parser';
    import { assert, TestContext } from '@aurelia/testing';
    import {
      EqualsRule,
    Severity: Minor
    Found in packages/__tests__/src/validation/serialization.spec.ts - About 7 hrs to fix

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

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

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

        import {
          Class,
          IContainer,
        } from '@aurelia/kernel';
        import {
        Severity: Minor
        Found in packages/__tests__/src/3-runtime-html/integration.spec.ts - About 7 hrs to fix

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

          import { assert } from '@aurelia/testing';
          import {
            RouteExpression,
            CompositeSegmentExpression,
            ScopedSegmentExpression,
          Severity: Minor
          Found in packages/__tests__/src/router-lite/ast.spec.ts - About 7 hrs to fix

            File arrow-fn.spec.ts has 466 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { BindingBehavior, ValueConverter, CustomAttribute, INode } from '@aurelia/runtime-html';
            import { assert, createFixture } from '@aurelia/testing';
            
            describe('3-runtime-html/arrow-fn.spec.ts', function () {
            
            
            Severity: Minor
            Found in packages/__tests__/src/3-runtime-html/arrow-fn.spec.ts - About 7 hrs to fix

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

                      function* getTestData(): Generator<[hook: HookName, getExpectedErrorLog: (phase: string, currentParent: string, currentChild: string, nextParent: string, nextChild: string) => any[]]> {
                        yield [
                          'canLoad',
                          function getExpectedErrorLog(phase: string, currentParent: string, currentChild: string, nextParent: string, nextChild: string) {
                            return currentParent === nextParent
              Severity: Major
              Found in packages/__tests__/src/router-lite/hook-tests.spec.ts - About 7 hrs to fix

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

                import { Runner, Step } from '@aurelia/router';
                import { assert } from '@aurelia/testing';
                
                const createTimedPromise = (value, time: number, previousValue?, reject = false): Promise<unknown> => {
                  return new Promise((res, rej) => {
                Severity: Minor
                Found in packages/__tests__/src/router/runner.spec.ts - About 6 hrs to fix

                  File template-compiler.ref.spec.ts has 448 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                    Constructable,
                    noop,
                  } from '@aurelia/kernel';
                  import {
                  Severity: Minor
                  Found in packages/__tests__/src/3-runtime-html/template-compiler.ref.spec.ts - About 6 hrs to fix

                    File binding-commands.throttle-debounce.spec.ts has 447 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { TestContext, assert, createFixture } from '@aurelia/testing';
                    import { BindingMode, customElement, bindable, Aurelia, ISignaler } from '@aurelia/runtime-html';
                    import { delegateSyntax } from '@aurelia/compat-v1';
                    
                    async function wait(ms: number): Promise<void> {

                      File util.ts has 447 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: Minor
                      Found in packages/testing/src/util.ts - About 6 hrs to fix

                        File config-tests.spec.ts has 444 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import { Aurelia, CustomElement, customElement, ICustomElementController } from '@aurelia/runtime-html';
                        import { IRouteConfig, IRouter, IRouteViewModel, route, Route, RouteConfig, RouteNode, RouterConfiguration } from '@aurelia/router-lite';
                        import { assert, TestContext } from '@aurelia/testing';
                        
                        import { IHookInvocationAggregator, IHIAConfig, HookName } from './_shared/hook-invocation-tracker.js';
                        Severity: Minor
                        Found in packages/__tests__/src/router-lite/config-tests.spec.ts - About 6 hrs to fix

                          Function parse has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                          Open

                            public static parse(seps: Separators, instructions: string, grouped: boolean, topScope: boolean): { instructions: RoutingInstruction[]; remaining: string } {
                              if (!instructions) {
                                return { instructions: [], remaining: '' };
                              }
                              if (instructions.startsWith(seps.sibling) && !InstructionParser.isAdd(seps, instructions)) {
                          Severity: Minor
                          Found in packages/router/src/instructions/instruction-parser.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 findMatchingRouteInRoutes has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                          Open

                            private findMatchingRouteInRoutes(path: string, routes: Route[], parameters: Parameters): FoundRoute {
                              const found = new FoundRoute();
                              if (routes.length === 0) {
                                return found;
                              }
                          Severity: Minor
                          Found in packages/router/src/routing-scope.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 keyCheck has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                          Open

                          export function keyCheck(
                            val1: {},
                            val2: {},
                            strict: boolean,
                            memos: Memos | undefined,
                          Severity: Minor
                          Found in packages/testing/src/comparison.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 createErrDiff has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function createErrDiff(actual: any, expected: any, operator: keyof IOperatorText): string {
                            let other = '';
                            let res = '';
                            let lastPos = 0;
                            let end = '';
                          Severity: Major
                          Found in packages/testing/src/inspect.ts - About 6 hrs to fix

                            File smoke-tests.spec.ts has 426 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import {
                              Constructable,
                              kebabCase,
                            } from '@aurelia/kernel';
                            import {
                            Severity: Minor
                            Found in packages/__tests__/src/router/smoke-tests.spec.ts - About 6 hrs to fix

                              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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language