aurelia/aurelia

View on GitHub
packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts

Summary

Maintainability
F
2 wks
Test Coverage

File preprocess-html-template.spec.ts has 1057 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import * as path from 'path';
import { preprocessHtmlTemplate, preprocessOptions } from '@aurelia/plugin-conventions';
import { assert } from '@aurelia/testing';

describe('preprocessHtmlTemplate', function () {

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

      it('processes template with css dependencies in shadowDOM mode with string module wrap', function () {
        const html = '<import from="./hello-world.html" /><template><import from="foo"><require from="./foo-bar.scss"></require></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import { shadowCSS } from '@aurelia/runtime-html';
    import * as d0 from "./hello-world.html";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 336..367
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 401..432

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

    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('processes template with css dependencies in shadowDOM mode with string module wrap and explicit shadow mode', function () {
        const html = '<import from="./hello-world.html"><use-shadow-dom><template><import from="foo"><require from="./foo-bar.scss"></require></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import { shadowCSS } from '@aurelia/runtime-html';
    import * as d0 from "./hello-world.html";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 303..334
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 401..432

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

    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('does not turn off shadowDOM mode for one word element, leave it to runtime', function () {
        const html = '<import from="./hello-world.html"><use-shadow-dom><template><import from="foo"><require from="./foo-bar.scss"></require></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import { shadowCSS } from '@aurelia/runtime-html';
    import * as d0 from "./hello-world.html";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 303..334
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 336..367

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

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

      it('processes template with containerless, bindables, and aliases (noth)', function () {
        const html = '<alias name="test, test2"><bindable name="age" mode="one-way"><containerless><template alias="test3, test4" bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template  ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless, bindables, and aliases (empty node) (noth)', function () {
        const html = '<alias><bindable name="age" mode="one-way"><containerless><template alias="test3, test4" bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template  ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless, bindables, and aliases', function () {
        const html = '<bindable name="age" mode="one-way"><containerless><template alias="test, test2" bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template  ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless and bindables on template', function () {
        const html = '<bindable name="age" mode="one-way"><template containerless bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template  ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless, bindables, and aliases (node)', function () {
        const html = '<alias name="test, test2"><bindable name="age" mode="one-way"><containerless><template bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless, bindables, and aliases (empty attr) (noth)', function () {
        const html = '<alias name="test, test2"><bindable name="age" mode="one-way"><containerless><template alias="" bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template  ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless, bindables, and aliases (empty node) MAINTAIN EXISTING ATTRIBUTES', function () {
        const html = '<alias><bindable name="age" mode="one-way"><containerless><template id="my-template" alias="test3, test4" bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template id=\\"my-template\\"  ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless, bindables, and aliases (empty node) MAINTAIN EXISTING ATTRIBUTE RAN TOGETHER', function () {
        const html = '<alias><bindable name="age" mode="one-way"><containerless><template id="my-template"alias="test3, test4" bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template id=\\"my-template\\" ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699

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

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

      it('processes template with css dependencies in per-file shadowDOM mode with string module wrap and explicit shadow mode', function () {
        const html = '<import from="./hello-world.html"><use-shadow-dom><template><import from="foo"><require from="./foo-bar.scss"></require></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import { shadowCSS } from '@aurelia/runtime-html';
    import * as d0 from "./hello-world.html";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless, bindables, and aliases (empty attr+node) (noth)', function () {
        const html = '<alias><bindable name="age" mode="one-way"><containerless><template alias="" bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template  ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 434..461
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

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

      it('processes template with containerless and bindables', function () {
        const html = '<bindable name="age" mode="one-way"><containerless><template bindable="firstName, lastName"></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo";
    export const template = "<template ></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 369..399
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 463..490
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 492..520
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 522..550
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 552..580
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 582..610
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 612..640
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 642..669
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 671..699
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 701..729

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

    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('generates only single helper import statement from @aurelia/kernel for multiple main + other aliased imports', function () {
          const html = [
            '<template>',
              '<import from="./abc" as="x" a.as="b">',
              '<import from="./xyz" as="k" c.as=d>',
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 1032..1062

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

    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('does not affected un-aliased imports when used with aliased imports', function () {
          const html = [
            '<template>',
              '<import from="./abc" as="x" a.as="b">',
              '<import from="./xyz">',
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 1000..1030

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

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

      it('processes template with css pair', function () {
        const html = '<template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import "./foo-bar.css";
    export const name = "foo-bar";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 79..103
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 105..128
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 763..787
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 789..813

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

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

      it('emits capture [capture] attribute on <template>', function () {
        const html = '<template capture></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import "./foo-bar.css";
    export const name = "foo-bar";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 54..77
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 79..103
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 105..128
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 763..787

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

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

      it('processes template with multiple css', function () {
        const html = '<require from="./lo.css"></require><template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import "./foo-bar.css";
    import "./lo.css";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 54..77
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 105..128
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 763..787
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 789..813

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

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

      it('emits capture with <capture> element', function () {
        const html = '<capture><template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import "./foo-bar.css";
    export const name = "foo-bar";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 54..77
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 79..103
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 105..128
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 789..813

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

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

      it('do not import css pair if a pair is imported', function () {
        const html = '<import from="./foo-bar.less"></import><template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import "./foo-bar.less";
    export const name = "foo-bar";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 54..77
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 79..103
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 763..787
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 789..813

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

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

        it('processes template with [non-main] aliased import', function () {
          const html = '<template><import from="./abc" y.as="x"></template>';
          const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import { aliasedResourcesRegistry as $$arr } from '@aurelia/kernel';
    import * as d0 from "./abc";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 847..869
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 871..893
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 921..945
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 973..998

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

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

        it('generates only single helper import statement from @aurelia/kernel for multiple main aliased imports', function () {
          const html = '<template><import from="./abc" as="x"><import from="./xyz" as="k"></template>';
          const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import { aliasedResourcesRegistry as $$arr } from '@aurelia/kernel';
    import * as d0 from "./abc";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 847..869
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 871..893
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 921..945
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 947..971

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

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

        it('processes template with aliased main import', function () {
          const html = '<template><import from="./abc" as="x"></template>';
          const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import { aliasedResourcesRegistry as $$arr } from '@aurelia/kernel';
    import * as d0 from "./abc";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 847..869
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 871..893
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 947..971
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 973..998

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

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

      it('processes template with index file', function () {
        const html = '<template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo-bar";
    export const template = "<template></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 871..893
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 921..945
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 947..971
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 973..998

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

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

      it('processes template with index file and file path not in kebab case', function () {
        const html = '<template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo-bar";
    export const template = "<template></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 847..869
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 921..945
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 947..971
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 973..998

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

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

      it('processes template with file name not in kebab case', function () {
        const html = '<template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo-bar";
    export const template = "<template></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 6..28
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 130..155
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 183..208

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

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

      it('supports HTML-only dependency not in html format', function () {
        const html = '<import from="./hello-world.md" /><template><import from="foo"><require from="./foo-bar.scss"></require></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import * as d0 from "./hello-world.md";
    import * as d1 from "foo";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 6..28
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 30..52
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 130..155

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

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

      it('processes template with no dependencies', function () {
        const html = '<template></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    export const name = "foo-bar";
    export const template = "<template></template>";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 30..52
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 130..155
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 183..208

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

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

      it('processes template with dependencies', function () {
        const html = '<import from="./hello-world.html" /><template><import from="foo"><require from="./foo-bar.scss"></require></template>';
        const expected = `import { CustomElement } from '@aurelia/runtime-html';
    import * as d0 from "./hello-world.html";
    import * as d1 from "foo";
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 6..28
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 30..52
    packages-tooling/__tests__/src/plugin-conventions/preprocess-html-template.spec.ts on lines 183..208

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

    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