aurelia/aurelia

View on GitHub
packages/__tests__/src/3-runtime-html/au-compose.spec.ts

Summary

Maintainability
F
1 wk
Test Coverage

File au-compose.spec.ts has 1225 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { resolve } from '@aurelia/kernel';
import {
  CustomElement,
  customElement,
  AuCompose,
Severity: Major
Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts - About 3 days to fix

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

        const El2 = CustomElement.define({
          name: 'el2',
          template: `<p>\${value} 2</p>`
        }, class El {
          public activate() {
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 6 hrs to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 930..955

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

    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

        const El1 = CustomElement.define({
          name: 'el1',
          template: `<div>\${value} 1</div>`
        }, class El {
          public activate() {
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 6 hrs to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 956..981

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

    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

        const El1 = CustomElement.define({
          name: 'el1',
          template: `<div>\${value} 1</div>`
        }, class El {
          public value: unknown;
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 877..892

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

    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('composes containerless inside a containerless <au-compose>', function () {
          const { appHost, component } = createFixture(
            '<au-compose component.bind="comp" containerless>',
            class {
              comp: any = CustomElement.define({
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 1140..1157

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

    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('composes containerless', function () {
          const { appHost, component } = createFixture(
            '<au-compose component.bind="comp">',
            class {
              comp: any = CustomElement.define({
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 1159..1176

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

    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

        const El2 = CustomElement.define({
          name: 'el2',
          template: `<p>\${value} 2</p>`
        }, class El {
          public value: unknown;
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 861..876

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

    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

          const { appHost, tearDown } = createFixture(
            `\${message}<au-compose component.bind="{ activate }">`,
            class App {
              public message = 'hello world';
              public view = `<div>\${message}</div>`;
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 1 hr to fix
    packages/__tests__/src/compat-v1/au-compose.spec.ts on lines 61..72

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

    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

          const { appHost, tearDown } = createFixture(
            '<au-compose component.bind="fieldVm">',
            class App {
              public message = 'hello world';
              public fieldVm = CustomElement.define(
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 1 hr to fix
    packages/__tests__/src/compat-v1/au-compose.spec.ts on lines 82..96

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

    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

          const { ctx, component, appHost, startPromise, tearDown } = createFixture(
            `<au-compose template="<div>\${message}</div>">`,
            class App {
              public message = 'hello world';
            }
    Severity: Minor
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 1 other location - About 55 mins to fix
    packages/__tests__/src/3-runtime-html/web-components.spec.ts on lines 168..173

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

    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

          @customElement({
            name: 'child',
            template: '<div>Hello world from Child</div>'
          })
          class Child {
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 2 other locations - About 40 mins to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 415..422
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 448..455

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

    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

          @customElement({
            name: 'parent',
            template: '<div>Hello world from Parent</div>'
          })
          class Parent {
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 2 other locations - About 40 mins to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 415..422
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 439..446

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

    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

          @customElement({
            name: 'el',
            template: '<div>Hello world from El</div>'
          })
          class El {
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 2 other locations - About 40 mins to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 439..446
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 448..455

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

    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

          divs.forEach((div, i) => {
            assert.strictEqual(div.textContent, `div ${i}: Hello ${i}`);
          });
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 3 other locations - About 35 mins to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 365..367
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 372..374
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 399..401

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

    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

          divs.forEach((div, i) => {
            assert.strictEqual(div.textContent, `div ${i}: Hello ${i}`);
          });
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 3 other locations - About 35 mins to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 330..332
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 372..374
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 399..401

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

    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

          divs.forEach((div, i) => {
            assert.strictEqual(div.textContent, `div ${i}: Hello ${i}`);
          });
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 3 other locations - About 35 mins to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 330..332
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 365..367
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 399..401

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

    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

          divs.forEach((div, i) => {
            assert.strictEqual(div.textContent, `div ${i}: Hello ${i}`);
          });
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/au-compose.spec.ts and 3 other locations - About 35 mins to fix
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 330..332
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 365..367
    packages/__tests__/src/3-runtime-html/au-compose.spec.ts on lines 372..374

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

    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