aurelia/aurelia

View on GitHub
packages/__tests__/src/3-runtime-html/show.integration.spec.ts

Summary

Maintainability
F
1 wk
Test Coverage

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

import { Aurelia, customElement, ICustomElementViewModel, ICustomElementController } from '@aurelia/runtime-html';
import { assert, TestContext } from '@aurelia/testing';

function createFixture() {
  const ctx = TestContext.create();
Severity: Minor
Found in packages/__tests__/src/3-runtime-html/show.integration.spec.ts - About 2 hrs to fix

    Avoid deeply nested control flow statements.
    Open

              for (const unbinding of [true, false]) {
                describe('show', function () {
                  // Initial value
                  for (const show of [true ,false]) {
                    it(`display:'${style.display}',show:${show},attaching:${attaching},attached:${attached},detaching:${detaching},unbinding:${unbinding}`, async function () {
    Severity: Major
    Found in packages/__tests__/src/3-runtime-html/show.integration.spec.ts - About 45 mins to fix

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

          it('hide + show', async function () {
            const { au, host, p } = createFixture();
      
            @customElement({ name: 'app', template: '<div hide.bind="hide"></div><div show.bind="show"></div>' })
            class App implements ICustomElementViewModel {
      Severity: Major
      Found in packages/__tests__/src/3-runtime-html/show.integration.spec.ts and 1 other location - About 4 days to fix
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 14..67

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

      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('show + hide', async function () {
            const { au, host, p } = createFixture();
      
            @customElement({ name: 'app', template: '<div show.bind="show"></div><div hide.bind="hide"></div>' })
            class App implements ICustomElementViewModel {
      Severity: Major
      Found in packages/__tests__/src/3-runtime-html/show.integration.spec.ts and 1 other location - About 4 days to fix
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 69..122

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

      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

                          public attached() {
                            this.appliedShow = this.show;
                            this.assert(`attached initial (run ${run})`);
      
                            if (attached) {
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 293..305

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

      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

                          public attached() {
                            this.appliedHide = this.hide;
                            this.assert(`attached initial (run ${run})`);
      
                            if (attached) {
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 182..194

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

      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

                            } else {
                              assert.strictEqual(this.div.style.getPropertyValue('display'), style.display, `display should be '' at ${label} (hide is ${this.hide}, appliedHide is ${this.appliedHide})`);
                              assert.strictEqual(this.div.style.getPropertyPriority('display'), '', `priority should be '' at ${label} (hide is ${this.hide}, appliedHide is ${this.appliedHide})`);
                            }
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 215..218

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

      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

                            if (this.appliedShow) {
                              assert.strictEqual(this.div.style.getPropertyValue('display'), style.display, `display should be '' at ${label} (show is ${this.show}, appliedShow is ${this.appliedShow})`);
                              assert.strictEqual(this.div.style.getPropertyPriority('display'), '', `priority should be '' at ${label} (show is ${this.show}, appliedShow is ${this.appliedShow})`);
                            } else {
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 329..332

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

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

                          public unbinding() {
                            this.assert(`unbinding initial (run ${run})`);
      
                            if (unbinding) {
                              this.show = !this.show;
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 173..180
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 196..203
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 284..291
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 307..314
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 316..323

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

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

                          public detaching() {
                            this.assert(`detaching initial (run ${run})`);
      
                            if (detaching) {
                              this.hide = !this.hide;
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 173..180
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 196..203
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 205..212
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 284..291
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 316..323

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

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

                          public detaching() {
                            this.assert(`detaching initial (run ${run})`);
      
                            if (detaching) {
                              this.show = !this.show;
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 173..180
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 205..212
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 284..291
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 307..314
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 316..323

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

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

                          public attaching() {
                            this.assert(`attaching initial (run ${run})`);
      
                            if (attaching) {
                              this.hide = !this.hide;
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 173..180
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 196..203
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 205..212
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 307..314
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 316..323

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

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

                          public unbinding() {
                            this.assert(`unbinding initial (run ${run})`);
      
                            if (unbinding) {
                              this.hide = !this.hide;
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 173..180
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 196..203
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 205..212
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 284..291
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 307..314

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

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

                          public attaching() {
                            this.assert(`attaching initial (run ${run})`);
      
                            if (attaching) {
                              this.show = !this.show;
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 196..203
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 205..212
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 284..291
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 307..314
      packages/__tests__/src/3-runtime-html/show.integration.spec.ts on lines 316..323

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

      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