aurelia/aurelia

View on GitHub
packages/__tests__/src/1-kernel/di.spec.ts

Summary

Maintainability
F
1 wk
Test Coverage

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

import {
  DI,
  inject,
  Registration,
  resolve,
Severity: Minor
Found in packages/__tests__/src/1-kernel/di.spec.ts - About 7 hrs to fix

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

      describe(`The transient decorator`, function () {
        it(`works as a plain decorator`, function () {
          @transient
          class Foo {}
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 1 day to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 518..546

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

    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

      describe(`The singleton decorator`, function () {
        it(`works as a plain decorator`, function () {
          @singleton
          class Foo {}
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 1 day to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 488..516

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

    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 store non-resource string keyed resolvers in resourceResolvers`, function () {
              const type = class {};
              const key = 'foo' as any;
    
              const root = DI.createContainer();
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 7 hrs to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 1340..1357

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

    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(`stores resource resolvers in resourceResolvers in parent but does not inherit them from parent`, function () {
              const type = class {};
              const key = 'foo:bar' as any;
    
              const root = DI.createContainer();
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 7 hrs to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 1321..1338

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

    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

        describe(`get()`, function () {
          for (const key of [null, undefined]) {
            it(_`throws on invalid key ${key}`, function () {
              const { sut } = createFixture();
              assert.throws(() => sut.get(key), /AUR0014/, `() => sut.get(key)`);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 3 hrs to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 1036..1045

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 106.

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

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

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

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

    Refactorings

    Further Reading

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

        describe(`getAll()`, function () {
          for (const key of [null, undefined]) {
            it(_`throws on invalid key ${key}`, function () {
              const { sut } = createFixture();
              assert.throws(() => sut.getAll(key), /AUR0014/, `() => sut.getAll(key)`);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 3 hrs to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 1025..1034

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 106.

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

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

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

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

    Refactorings

    Further Reading

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

          for (const key of [null, undefined]) {
            it(_`throws on invalid key ${key}`, function () {
              const { sut } = createFixture();
              assert.throws(() => sut.getResolver(key, null as any), /AUR0014/, `() => sut.getResolver(key, null as any)`);
              // assert.throws(() => sut.getResolver(key, null as any), /key\/value cannot be null or undefined/, `() => sut.getResolver(key, null as any)`);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 984..990

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

    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

          for (const key of [null, undefined]) {
            it(_`throws on invalid key ${key}`, function () {
              const { sut } = createFixture();
              assert.throws(() => sut.registerTransformer(key, null as any), /AUR0014/, `() => sut.registerTransformer(key, null as any)`);
              // assert.throws(() => sut.registerTransformer(key, null as any), /key\/value cannot be null or undefined/, `() => sut.registerTransformer(key, null as any)`);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 2 hrs to fix
    packages/__tests__/src/1-kernel/di.spec.ts on lines 1002..1008

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

    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

        describe(`registerTransformer()`, function () {
          for (const key of [null, undefined]) {
            it(_`throws on invalid key ${key}`, function () {
              const { sut } = createFixture();
              assert.throws(() => sut.registerTransformer(key, null as any), /AUR0014/, `() => sut.registerTransformer(key, null as any)`);
    Severity: Minor
    Found in packages/__tests__/src/1-kernel/di.spec.ts and 1 other location - About 30 mins to fix
    packages/__tests__/src/3-runtime-html/binding-commands.throttle-debounce.spec.ts on lines 85..114

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

    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