aurelia/aurelia

View on GitHub
packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts

Summary

Maintainability
D
3 days
Test Coverage

File validation-result-presenter-service.spec.ts has 384 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { Registration, toArray, newInstanceForScope, DI, resolve, IContainer } from '@aurelia/kernel';
import { IPlatform, CustomElement, customElement, Aurelia } from '@aurelia/runtime-html';
import { PLATFORM, assert, ISpy, TestContext, createSpy, getVisibleText } from '@aurelia/testing';
import {
  IValidationRules,

    Function assertEventHandler has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          target: HTMLElement,
          platform: IPlatform,
          controllerValidateSpy: ISpy,
          handleValidationEventSpy: ISpy,
          ctx: TestContext,

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

          async function assertEventHandler(
            target: HTMLElement,
            platform: IPlatform,
            controllerValidateSpy: ISpy,
            handleValidationEventSpy: ISpy,
      packages/__tests__/src/validation-html/subscribers/validation-container-custom-element.spec.ts on lines 96..110
      packages/__tests__/src/validation-html/subscribers/validation-errors-custom-attribute.spec.ts on lines 101..115

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

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

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

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

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

      Refactorings

      Further Reading

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

              this.validationRules
                .on(this.person)
      
                .ensure('name')
                .displayName('Name')
      packages/__tests__/src/validation-html/subscribers/validation-container-custom-element.spec.ts on lines 29..39
      packages/__tests__/src/validation-html/subscribers/validation-errors-custom-attribute.spec.ts on lines 33..43

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 68.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[0][0] as HTMLElement).tagName, ...getResult(showResultsArgs[0][1])], ['SMALL', true, undefined, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[0][0] as HTMLElement).tagName, ...getResult(showResultsArgs[0][1])], ['DIV', true, undefined, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[0][0] as HTMLElement).tagName, ...getResult(showResultsArgs[0][1])], ['DIV', true, undefined, true, undefined]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[1][0] as HTMLElement).tagName, ...getResult(showResultsArgs[1][1])], ['DIV', false, ageRequiredError, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(removeResultsArgs[0][0] as HTMLElement).tagName, ...getResult(removeResultsArgs[0][1])], ['DIV', false, ageRequiredError, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[0][0] as HTMLElement).tagName, ...getResult(showResultsArgs[0][1])], ['SMALL', true, undefined, true, undefined]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[1][0] as HTMLElement).tagName, ...getResult(showResultsArgs[1][1])], ['SMALL', false, ageRequiredError, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(removeResultsArgs[0][0] as HTMLElement).tagName, ...getResult(removeResultsArgs[0][1])], ['SMALL', false, ageRequiredError, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(removeResultsArgs[0][0] as HTMLElement).tagName, ...getResult(removeResultsArgs[0][1])], ['SMALL', true, undefined, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 251..251
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(removeResultsArgs[0][0] as HTMLElement).tagName, ...getResult(removeResultsArgs[0][1])], ['DIV', true, undefined, false, ageFizbazError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 200..200
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 225..225
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 226..226
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 252..252
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 307..307
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 332..332
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 333..333
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 358..358
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 359..359

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 53.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[0][0] as HTMLElement).tagName, ...getResult(showResultsArgs[0][1])], ['DIV', false, nameError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 306..306

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 51.

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

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

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

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

      Refactorings

      Further Reading

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

              assert.deepStrictEqual([(showResultsArgs[0][0] as HTMLElement).tagName, ...getResult(showResultsArgs[0][1])], ['SMALL', false, nameError]);
      packages/__tests__/src/validation-html/subscribers/validation-result-presenter-service.spec.ts on lines 199..199

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 51.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status