aurelia/aurelia

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

Summary

Maintainability
F
2 wks
Test Coverage

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

import { DI, IContainer, inject, InterfaceSymbol, Registration, singleton } from '@aurelia/kernel';
import { assert, createSpy, ISpy } from '@aurelia/testing';

describe('1-kernel/di.integration.spec.ts', function () {
  describe('registerInRequester', function () {
Severity: Major
Found in packages/__tests__/src/1-kernel/di.integration.spec.ts - About 1 day to fix

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

          it(`instance child registration returns the same instance each time`, function () {
            @inject(IInstance)
            class TransientParent implements ITransientParent { public constructor(public dep: IInstance) { } }
            register(TransientParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 531..558
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 560..587

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

    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(`transient child registration returns a new instance each time`, function () {
            @inject(ITransient)
            class TransientParent implements ITransientParent { public constructor(public dep: ITransient) { } }
            register(TransientParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 560..587
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 589..616

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

    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(`singleton child registration returns the same instance each time`, function () {
            @inject(ISingleton)
            class TransientParent implements ITransientParent { public constructor(public dep: ISingleton) { } }
            register(TransientParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 531..558
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 589..616

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

    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(`singleton registration is reused by the singleton parent`, function () {
            @inject(ISingleton)
            class SingletonParent implements ISingletonParent { public constructor(public dep: ISingleton) { } }
            register(SingletonParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 664..690
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 720..746

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

    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(`transient child registration is reused by the singleton parent`, function () {
            @inject(ITransient)
            class SingletonParent implements ISingletonParent { public constructor(public dep: ITransient) { } }
            register(SingletonParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 692..718
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 720..746

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

    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(`instance registration is reused by the singleton parent`, function () {
            @inject(IInstance)
            class SingletonParent implements ISingletonParent { public constructor(public dep: IInstance) { } }
            register(SingletonParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 664..690
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 692..718

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

    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(`instance registration is reused by the instance parent`, function () {
            @inject(IInstance)
            class InstanceParent implements IInstanceParent { public constructor(public dep: IInstance) { } }
            register(InstanceParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 795..820
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 822..847

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

    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(`singleton registration is reused by the instance parent`, function () {
            @inject(ISingleton)
            class InstanceParent implements IInstanceParent { public constructor(public dep: ISingleton) { } }
            register(InstanceParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 795..820
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 849..874

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

    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(`transient registration is reused by the instance parent`, function () {
            @inject(ITransient)
            class InstanceParent implements IInstanceParent { public constructor(public dep: ITransient) { } }
            register(InstanceParent);
    
    
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 2 other locations - About 1 day to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 822..847
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 849..874

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

    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(`InterfaceSymbol alias to singleton registration returns the same instance each time`, function () {
            interface IAlias { }
            const IAlias = DI.createInterface<IAlias>('IAlias', x => x.aliasTo(ISingleton));
    
            const actual1 = container.get(IAlias);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 7 hrs to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 271..293

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

    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(`InterfaceSymbol alias to transient registration returns a new instance each time`, function () {
            interface IAlias { }
            const IAlias = DI.createInterface<IAlias>('IAlias', x => x.aliasTo(ITransient));
    
            const actual1 = container.get(IAlias);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 7 hrs to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 295..317

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

    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(`string alias to singleton registration returns the same instance each time`, function () {
            container.register(Registration.aliasTo(ISingleton, 'alias'));
    
            const actual1 = container.get('alias');
            assert.instanceOf(actual1, Singleton, `actual1`);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 6 hrs to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 378..399

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

    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(`string alias to transient registration returns a new instance each time`, function () {
            container.register(Registration.aliasTo(ITransient, 'alias'));
    
            const actual1 = container.get('alias');
            assert.instanceOf(actual1, Transient, `actual1`);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 6 hrs to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 401..422

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

    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(`transient registration returns a new instance each time`, function () {
            const actual1 = container.get(ITransient);
            assert.instanceOf(actual1, Transient, `actual1`);
    
            const actual2 = container.get(ITransient);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 124..141

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

    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(`singleton registration returns the same instance each time`, function () {
            const actual1 = container.get(ISingleton);
            assert.instanceOf(actual1, Singleton, `actual1`);
    
            const actual2 = container.get(ISingleton);
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 4 hrs to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 105..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 131.

    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

            assert.deepStrictEqual(
              callback.calls,
              [
                [container, container, container.getResolver(ICallback)],
                [container, container, container.getResolver(ICallback)],
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 3 other locations - About 40 mins to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 172..179
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 357..364
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 634..641

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 49.

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

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

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

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

    Refactorings

    Further Reading

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

            assert.deepStrictEqual(
              callback.calls,
              [
                [container, container, container.getResolver(ICallback)],
                [container, container, container.getResolver(ICallback)],
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 3 other locations - About 40 mins to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 357..364
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 459..466
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 634..641

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 49.

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

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

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

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

    Refactorings

    Further Reading

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

            assert.deepStrictEqual(
              callback.calls,
              [
                [container, container, container.getResolver(ICallback)],
                [container, container, container.getResolver(ICallback)],
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 3 other locations - About 40 mins to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 172..179
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 459..466
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 634..641

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 49.

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

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

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

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

    Refactorings

    Further Reading

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

            assert.deepStrictEqual(
              callback.calls,
              [
                [container, container, container.getResolver(ICallback)],
                [container, container, container.getResolver(ICallback)],
    Severity: Major
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 3 other locations - About 40 mins to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 172..179
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 357..364
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 459..466

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 49.

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

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

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

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

    Refactorings

    Further Reading

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

          function register(cls: any) {
            ITransientParent = DI.createInterface<ITransientParent>('ITransientParent', x => x.transient(cls));
          }
    Severity: Minor
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 35 mins to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 660..662

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

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

          function register(cls: any) {
            ISingletonParent = DI.createInterface<ISingletonParent>('ISingletonParent', x => x.singleton(cls));
          }
    Severity: Minor
    Found in packages/__tests__/src/1-kernel/di.integration.spec.ts and 1 other location - About 35 mins to fix
    packages/__tests__/src/1-kernel/di.integration.spec.ts on lines 527..529

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 47.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status