aurelia/aurelia

View on GitHub
packages/__tests__/src/router-lite/resources/load.spec.ts

Summary

Maintainability
F
1 mo
Test Coverage

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

import { IRouteContext, IRouteViewModel, Params, route, RouteNode } from '@aurelia/router-lite';
import { CustomElement, customElement, ILocation, IPlatform } from '@aurelia/runtime-html';
import { assert, MockBrowserHistoryLocation } from '@aurelia/testing';
import { start } from '../_shared/create-fixture.js';
import { resolve } from '@aurelia/kernel';
Severity: Major
Found in packages/__tests__/src/router-lite/resources/load.spec.ts - About 2 days to fix

    Function getHrefGenerationForChildComponentSiblingTestData has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function* getHrefGenerationForChildComponentSiblingTestData() {
        yield new HrefGenerationForChildComponentSiblingTestData(
          'using path',
          [
            `
    Severity: Major
    Found in packages/__tests__/src/router-lite/resources/load.spec.ts - About 2 hrs to fix

      Function getHrefGenerationForChildComponentTestData has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function* getHrefGenerationForChildComponentTestData() {
          yield new HrefGenerationForChildComponentTestData(
            'using path',
            [
              `
      Severity: Major
      Found in packages/__tests__/src/router-lite/resources/load.spec.ts - About 2 hrs to fix

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

          it('allow explicitly binding the routing context to null to perform navigation from root', async function () {
            @customElement({ name: 'l-21', template: `l21 <a load="route:l22; context.bind:rtCtx.parent"></a>` })
            class L21 {
              private rtCtx: IRouteContext;
              public canLoad(params: Params, next: RouteNode, _current: RouteNode): boolean {
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 5 days to fix
        packages/__tests__/src/router-lite/resources/href.spec.ts on lines 110..197

        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 922.

        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 3 locations. Consider refactoring.
        Open

          it('allow navigating to route defined in parent context using ../ prefix', async function () {
            @customElement({ name: 'pro-duct', template: `product \${id} <a load="../products"></a>` })
            class Product {
              id: unknown;
              public canLoad(params: Params, _next: RouteNode, _current: RouteNode): boolean {
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 3 days to fix
        packages/__tests__/src/router-lite/resources/href.spec.ts on lines 8..60
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 296..348

        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 621.

        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 3 locations. Consider refactoring.
        Open

          it('allow navigating to route defined in parent context using ../ prefix - with parameters', async function () {
            @customElement({ name: 'pro-duct', template: `product \${id} <a load="../products"></a>` })
            class Product {
              id: unknown;
              public canLoad(params: Params, _next: RouteNode, _current: RouteNode): boolean {
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 3 days to fix
        packages/__tests__/src/router-lite/resources/href.spec.ts on lines 8..60
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 242..294

        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 621.

        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

          it('allow navigating to route defined in grand-parent context using ../../ prefix', async function () {
            @customElement({ name: 'l-21', template: `l21 <a load="../../l12"></a>` })
            class L21 { }
            @customElement({ name: 'l-22', template: `l22 <a load="../../l11"></a>` })
            class L22 { }
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 2 days to fix
        packages/__tests__/src/router-lite/resources/href.spec.ts on lines 62..107

        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 473.

        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

          it('supports routing instruction with parenthesized parameters', async function () {
            @route('c1/:id1/:id2?')
            @customElement({ name: 'c-1', template: 'c1 ${id1} ${id2}' })
            class C1 implements IRouteViewModel {
              private id1: string;
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 2 days to fix
        packages/__tests__/src/router-lite/resources/href.spec.ts on lines 290..320

        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 370.

        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

          function* getHrefGenerationForChildComponentTestData() {
            yield new HrefGenerationForChildComponentTestData(
              'using path',
              [
                `
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 1 day to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 908..979

        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 218.

        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

          function* getHrefGenerationForChildComponentSiblingTestData() {
            yield new HrefGenerationForChildComponentSiblingTestData(
              'using path',
              [
                `
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 1 day to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 714..785

        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 218.

        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

              @route({
                routes: [
                  { id: 'r1', path: 'gc21', component: GrandChildTwoOne },
                  { id: 'r2', path: 'gc22', component: GrandChildTwoTwo },
                  { id: 'r3', path: 'gc23', component: GrandChildTwoThree },
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 4 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 996..1009

        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 126.

        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

              @route({
                routes: [
                  { id: 'r1', path: 'gc11', component: GrandChildOneOne },
                  { id: 'r2', path: 'gc12', component: GrandChildOneTwo },
                  { id: 'r3', path: 'gc13', component: GrandChildOneThree },
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 4 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 1020..1033

        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 126.

        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

              @route({
                routes: [
                  { path: '', redirectTo: 'gc11' },
                  { id: 'r1', path: 'gc11', component: GrandChildOneOne },
                  { id: 'r2', path: 'gc12', component: GrandChildOneTwo },
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 4 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 820..833

        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 121.

        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

              @route({
                routes: [
                  { path: '', redirectTo: 'gc21' },
                  { id: 'r1', path: 'gc21', component: GrandChildTwoOne },
                  { id: 'r2', path: 'gc22', component: GrandChildTwoTwo },
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 4 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 799..812

        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 121.

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

            @route({ id: 'product', path: 'product/:id{{^\\d+$}}' })
            @customElement({ name: 'pro-duct', template: `product \${id}` })
            class Product {
              public id: unknown;
              public canLoad(params: Params, _next: RouteNode, _current: RouteNode): boolean {
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 3 hrs to fix
        packages/__tests__/src/router-lite/resources/href.spec.ts on lines 327..335
        packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 7083..7091

        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 106.

        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

              @route({
                routes: [
                  {
                    path: '',
                    redirectTo: 'c1',
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 2 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 835..854

        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 85.

        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

              @route({
                routes: [
                  {
                    path: '',
                    redirectTo: 'c1',
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 2 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 1035..1054

        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 85.

        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

          class HrefGenerationForChildComponentSiblingTestData {
            public constructor(
              public readonly name: string,
              public readonly templates: [root: string, c1: string, c2: string],
              public readonly expectedHrefs: [expectations1: { href: string }[], expectations2: { href: string }[]],
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 2 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 707..713

        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 82.

        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

          class HrefGenerationForChildComponentTestData {
            public constructor(
              public readonly name: string,
              public readonly templates: [root: string, c1: string, c2: string],
              public readonly expectedHrefs: [expectations1: { href: string }[], expectations2: { href: string }[]],
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 2 hrs to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 901..907

        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 82.

        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

            @route({
              routes: [
                { path: '', component: ProductInit },
                { path: 'product/:id', component: Product },
              ]
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 1 hr to fix
        packages/__tests__/src/router-lite/resources/viewport.spec.ts on lines 290..312

        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 68.

        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 3 locations. Consider refactoring.
        Open

            @route({
              routes: [
                { id: 'foo', path: 'foo/:id', component: Foo }
              ]
            })
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 1 hr to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 139..151
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 190..199

        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 61.

        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 3 locations. Consider refactoring.
        Open

            @route({
              routes: [
                { id: 'foo', path: 'foo/:id', component: Foo }
              ]
            })
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 1 hr to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 25..37
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 190..199

        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 61.

        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 3 locations. Consider refactoring.
        Open

            @route({
              routes: [
                { id: 'foo', path: 'foo/:id', component: Foo }
              ]
            })
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 1 hr to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 25..37
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 139..151

        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 61.

        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

        Identical blocks of code found in 4 locations. Consider refactoring.
        Open

                assert.strictEqual(anchor.href.endsWith(item.href), true, `${message} - #${i} href - actual: ${anchor.href} - expected: ${item.href}`);
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 3 other locations - About 1 hr to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 15..15
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 181..181
        packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 3896..3896

        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 58.

        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

        Identical blocks of code found in 4 locations. Consider refactoring.
        Open

              assert.strictEqual(anchor.href.endsWith(item.href), true, `${message} - #${i} href - actual: ${anchor.href} - expected: ${item.href}`);
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 3 other locations - About 1 hr to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 129..129
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 181..181
        packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 3896..3896

        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 58.

        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

        Identical blocks of code found in 4 locations. Consider refactoring.
        Open

                assert.strictEqual(anchor.href.endsWith(item.href), true, `${message} - #${i} href - actual: ${anchor.href} - expected: ${item.href}`);
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 3 other locations - About 1 hr to fix
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 15..15
        packages/__tests__/src/router-lite/resources/load.spec.ts on lines 129..129
        packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 3896..3896

        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 58.

        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

            @route({
              routes: [
                { id: 'products', path: ['', 'products'], component: Products },
              ],
              transitionPlan: 'replace',
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 1 hr to fix
        packages/__tests__/src/router-lite/lifecycle-hooks.spec.ts on lines 6186..6197

        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 58.

        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 3 locations. Consider refactoring.
        Open

            @route({ routes: [Product, NotFound], fallback: 'nf' })
            @customElement({
              name: 'ro-ot',
              template: `
                <a load="route:product; params.bind:{id: 42}"></a>
        Severity: Major
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 2 other locations - About 50 mins to fix
        packages/__tests__/src/router-lite/resources/href.spec.ts on lines 337..346
        packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 7093..7098

        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 51.

        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

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

              assert.strictEqual(anchor.classList.contains('active'), !!item.active, `${message} - #${i} active`);
        Severity: Minor
        Found in packages/__tests__/src/router-lite/resources/load.spec.ts and 1 other location - About 35 mins to fix
        packages/__tests__/src/router-lite/smoke-tests.spec.ts on lines 3898..3898

        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 46.

        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

        There are no issues that match your filters.

        Category
        Status