aurelia/aurelia

View on GitHub

Showing 5,656 of 5,656 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe('router/route-recognizer.spec.ts', function () {

  interface RecognizeSpec {
    routes: [string, Parameter[]][];
    tests: [string, string | null, Record<string, string> | null][];
Severity: Major
Found in packages/__tests__/src/router/route-recognizer.spec.ts and 1 other location - About 4 mos to fix
packages/__tests__/src/router/route-recognizer.spec.txt.ts on lines 4..2841

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 19633.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

describe(RouteRecognizer.name, function () {

  interface RecognizeSpec {
    routes: [string, Parameter[]][];
    tests: [string, string | null, Record<string, string> | null][];
Severity: Major
Found in packages/__tests__/src/router/route-recognizer.spec.txt.ts and 1 other location - About 4 mos to fix
packages/__tests__/src/router/route-recognizer.spec.ts on lines 4..2841

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 19633.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File template-compiler.static.if-else.double.spec.ts has 8697 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Aurelia, CustomElement } from "@aurelia/runtime-html";
import { TestContext, assert } from "@aurelia/testing";

describe("3-runtime-html/generated/template-compiler.static.if-else.double.spec.ts", function () {
    function createFixture() {

    Function getSiblingHookTestData has 4055 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function* getSiblingHookTestData(): Generator<SiblingHookTestData> {
        function createRoot(ticks: number): [root: Class<unknown>, scopes: string[]] {
          abstract class Base extends AsyncBaseViewModelWithAllHooks {
            public constructor(@ILogger logger: ILogger) {
              super(logger, ticks);
    Severity: Major
    Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts - About 2 wks to fix

      File lifecycle-hooks.spec.ts has 5804 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * Roughly the followings aspects are tested here:
       * - The invocation of the routing hooks, both instance and the global lifecycle hooks.
       * - The order of invocation.
       * - The preemption in the hooks (hooks returning `false`).
      Severity: Major
      Found in packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts - About 2 wks to fix

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

        import { LogLevel, Constructable, kebabCase, ILogConfig, Registration, noop, IModule, inject } from '@aurelia/kernel';
        import { assert, MockBrowserHistoryLocation, TestContext } from '@aurelia/testing';
        import { RouterConfiguration, IRouter, NavigationInstruction, IRouteContext, RouteNode, Params, route, INavigationModel, IRouterOptions, IRouteViewModel, IRouteConfig, Router, HistoryStrategy, IRouterEvents, ITypedNavigationInstruction_string, IViewportInstruction, RouteConfig, Routeable, RouterOptions, RouteContext } from '@aurelia/router-lite';
        import { Aurelia, valueConverter, customElement, CustomElement, ICustomElementViewModel, IHistory, IHydratedController, ILocation, INode, IPlatform, IWindow, StandardConfiguration, watch } from '@aurelia/runtime-html';
        
        
        Severity: Major
        Found in packages/__tests__/src/router-lite/smoke-tests.spec.ts - About 2 wks to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export class ApiService {
            constructor(
              @ILogger private readonly logger: ILogger,
              @IHttpClient private readonly http: IHttpClient,
              @IJwtService private readonly jwt: IJwtService,
          Severity: Major
          Found in examples/realworld/src/api.ts and 1 other location - About 2 wks to fix
          examples/realworld-advanced/src/api.ts on lines 546..707

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 2589.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          export class ApiService {
            constructor(
              @ILogger private readonly logger: ILogger,
              @IHttpClient private readonly http: IHttpClient,
              @IJwtService private readonly jwt: IJwtService,
          Severity: Major
          Found in examples/realworld-advanced/src/api.ts and 1 other location - About 2 wks to fix
          examples/realworld/src/api.ts on lines 498..659

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 2589.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          describe('3-runtime-html/lifecycle-hooks.detaching.spec.ts', function () {
            describe('[synchronous]', function () {
              let tracker: LifeycyleTracker | null = null;
              this.beforeEach(function () {
                tracker = new LifeycyleTracker();
          packages/__tests__/src/3-runtime-html/lifecycle-hooks.unbinding.spec.ts on lines 9..269

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 1995.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          describe('3-runtime-html/lifecycle-hooks.unbinding.spec.ts', function () {
            describe('[synchronous]', function () {
              let tracker: LifeycyleTracker | null = null;
              this.beforeEach(function () {
                tracker = new LifeycyleTracker();
          packages/__tests__/src/3-runtime-html/lifecycle-hooks.detaching.spec.ts on lines 9..269

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 1995.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          File data.ts has 4200 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* THIS IS AN AUTOGENERATED FILE.  DO NOT EDIT */
          
          /* This Source Code Form is subject to the terms of the Mozilla Public
           * License, v. 2.0. If a copy of the MPL was not distributed with this
           * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
          Severity: Major
          Found in packages/testing/src/data.ts - About 1 wk to fix

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

            import { Constructable, DI, ILogConfig, LogLevel, Registration, Writable, onResolve } from '@aurelia/kernel';
            import {
              CustomElement,
              customElement,
              ICustomElementController,
            Severity: Major
            Found in packages/__tests__/src/router-lite/hook-tests.spec.ts - About 1 wk to fix

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

                function *getTestData() {
                  function wrap(content: string, type: 'p' | 'f' | 'r', debugMode = false) {
                    switch (type) {
                      case 'p':
                        return `<${phost}${debugMode ? ` p.bind="promise"` : ''}>${content}</${phost}>`;
              Severity: Major
              Found in packages/__tests__/src/3-runtime-html/promise.spec.ts - About 1 wk to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                describe('3-runtime-html/lifecycle-hooks.bound.spec.ts', function () {
                  describe('[synchronous]', function () {
                
                    const hookSymbol = Symbol();
                    let tracker: LifeycyleTracker | null = null;
                packages/__tests__/src/3-runtime-html/lifecycle-hooks.binding.spec.ts on lines 9..219

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 1607.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                describe('3-runtime-html/lifecycle-hooks.binding.spec.ts', function () {
                  describe('[synchronous]', function () {
                
                    const hookSymbol = Symbol();
                    let tracker: LifeycyleTracker | null = null;
                packages/__tests__/src/3-runtime-html/lifecycle-hooks.bound.spec.ts on lines 9..219

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 1607.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    for (const type of [undefined, Person1]) {
                      @customElement({ name: 'my-el', template: 'irrelevant' })
                      class MyEl {
                        @bindable({ type }) public person: Person1;
                      }
                packages/__tests__/src/3-runtime-html/bindable-coercer.spec.ts on lines 633..724

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 1474.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    for (const type of [undefined, Person2]) {
                      @customElement({ name: 'my-el', template: 'irrelevant' })
                      class MyEl {
                        @bindable({ type }) public person: Person2;
                      }
                packages/__tests__/src/3-runtime-html/bindable-coercer.spec.ts on lines 534..625

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 1474.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

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

                  function *getTestData() {
                    const createMyElement = (template: string, containerless = false) => {
                      class MyElement {
                        public constructor(
                          @IAuSlotsInfo public readonly slots: IAuSlotsInfo,
                Severity: Major
                Found in packages/__tests__/src/3-runtime-html/au-slot.spec.tsx - About 1 wk to fix

                  File route-recognizer.spec.ts has 2885 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { Writable } from '@aurelia/kernel';
                  import { ConfigurableRoute, Endpoint, RecognizedRoute, RouteRecognizer, Parameter, RESIDUE } from '@aurelia/route-recognizer';
                  import { assert } from '@aurelia/testing';
                  
                  describe('router-lite/route-recognizer.spec.ts', function () {
                  Severity: Major
                  Found in packages/__tests__/src/router-lite/route-recognizer.spec.ts - About 1 wk to fix

                    File route-recognizer.spec.ts has 2740 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { ConfigurableRoute, Endpoint, RecognizedRoute, RouteRecognizer, Parameter } from '@aurelia/route-recognizer';
                    import { assert } from '@aurelia/testing';
                    
                    describe('router/route-recognizer.spec.ts', function () {
                    
                    
                    Severity: Major
                    Found in packages/__tests__/src/router/route-recognizer.spec.ts - About 1 wk to fix
                      Severity
                      Category
                      Status
                      Source
                      Language