inversify/inversify-binding-decorators

View on GitHub
src/syntax/provide_in_when_on_syntax.ts

Summary

Maintainability
C
1 day
Test Coverage

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

    public onActivation(fn: (context: inversifyInterfaces.Context, injectable: T) => T): interfaces.ProvideWhenSyntax<T> {
        return this._provideOnSyntax.onActivation(fn);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 1 other location - About 1 hr to fix
src/syntax/provide_when_on_syntax.ts on lines 73..75

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

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 whenAnyAncestorMatches(constraint: (request: inversifyInterfaces.Request) => boolean): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenAnyAncestorMatches(constraint);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 5 other locations - About 1 hr to fix
src/syntax/provide_in_when_on_syntax.ts on lines 20..22
src/syntax/provide_in_when_on_syntax.ts on lines 72..74
src/syntax/provide_when_on_syntax.ts on lines 17..19
src/syntax/provide_when_on_syntax.ts on lines 65..67
src/syntax/provide_when_on_syntax.ts on lines 69..71

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

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 when(constraint: (request: inversifyInterfaces.Request) => boolean): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.when(constraint);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 5 other locations - About 1 hr to fix
src/syntax/provide_in_when_on_syntax.ts on lines 68..70
src/syntax/provide_in_when_on_syntax.ts on lines 72..74
src/syntax/provide_when_on_syntax.ts on lines 17..19
src/syntax/provide_when_on_syntax.ts on lines 65..67
src/syntax/provide_when_on_syntax.ts on lines 69..71

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

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 whenNoAncestorMatches(constraint: (request: inversifyInterfaces.Request) => boolean): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenNoAncestorMatches(constraint);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 5 other locations - About 1 hr to fix
src/syntax/provide_in_when_on_syntax.ts on lines 20..22
src/syntax/provide_in_when_on_syntax.ts on lines 68..70
src/syntax/provide_when_on_syntax.ts on lines 17..19
src/syntax/provide_when_on_syntax.ts on lines 65..67
src/syntax/provide_when_on_syntax.ts on lines 69..71

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

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 whenInjectedInto(parent: (Function|string)): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenInjectedInto(parent);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 5 other locations - About 50 mins to fix
src/syntax/provide_in_when_on_syntax.ts on lines 44..46
src/syntax/provide_in_when_on_syntax.ts on lines 48..50
src/syntax/provide_when_on_syntax.ts on lines 29..31
src/syntax/provide_when_on_syntax.ts on lines 41..43
src/syntax/provide_when_on_syntax.ts on lines 45..47

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

    public whenNoAncestorIs(ancestor: (Function|string)): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenNoAncestorIs(ancestor);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 5 other locations - About 50 mins to fix
src/syntax/provide_in_when_on_syntax.ts on lines 32..34
src/syntax/provide_in_when_on_syntax.ts on lines 44..46
src/syntax/provide_when_on_syntax.ts on lines 29..31
src/syntax/provide_when_on_syntax.ts on lines 41..43
src/syntax/provide_when_on_syntax.ts on lines 45..47

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

    public whenAnyAncestorIs(ancestor: (Function|string)): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenAnyAncestorIs(ancestor);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 5 other locations - About 50 mins to fix
src/syntax/provide_in_when_on_syntax.ts on lines 32..34
src/syntax/provide_in_when_on_syntax.ts on lines 48..50
src/syntax/provide_when_on_syntax.ts on lines 29..31
src/syntax/provide_when_on_syntax.ts on lines 41..43
src/syntax/provide_when_on_syntax.ts on lines 45..47

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

    public whenAnyAncestorTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenAnyAncestorTagged(tag, value);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 7 other locations - About 45 mins to fix
src/syntax/provide_in_when_on_syntax.ts on lines 28..30
src/syntax/provide_in_when_on_syntax.ts on lines 40..42
src/syntax/provide_in_when_on_syntax.ts on lines 64..66
src/syntax/provide_when_on_syntax.ts on lines 25..27
src/syntax/provide_when_on_syntax.ts on lines 37..39
src/syntax/provide_when_on_syntax.ts on lines 53..55
src/syntax/provide_when_on_syntax.ts on lines 61..63

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

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

    public whenTargetTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenTargetTagged(tag, value);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 7 other locations - About 45 mins to fix
src/syntax/provide_in_when_on_syntax.ts on lines 40..42
src/syntax/provide_in_when_on_syntax.ts on lines 56..58
src/syntax/provide_in_when_on_syntax.ts on lines 64..66
src/syntax/provide_when_on_syntax.ts on lines 25..27
src/syntax/provide_when_on_syntax.ts on lines 37..39
src/syntax/provide_when_on_syntax.ts on lines 53..55
src/syntax/provide_when_on_syntax.ts on lines 61..63

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

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

    public whenNoAncestorTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenNoAncestorTagged(tag, value);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 7 other locations - About 45 mins to fix
src/syntax/provide_in_when_on_syntax.ts on lines 28..30
src/syntax/provide_in_when_on_syntax.ts on lines 40..42
src/syntax/provide_in_when_on_syntax.ts on lines 56..58
src/syntax/provide_when_on_syntax.ts on lines 25..27
src/syntax/provide_when_on_syntax.ts on lines 37..39
src/syntax/provide_when_on_syntax.ts on lines 53..55
src/syntax/provide_when_on_syntax.ts on lines 61..63

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

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

    public whenParentTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        return this._provideWhenSyntax.whenParentTagged(tag, value);
    }
Severity: Major
Found in src/syntax/provide_in_when_on_syntax.ts and 7 other locations - About 45 mins to fix
src/syntax/provide_in_when_on_syntax.ts on lines 28..30
src/syntax/provide_in_when_on_syntax.ts on lines 56..58
src/syntax/provide_in_when_on_syntax.ts on lines 64..66
src/syntax/provide_when_on_syntax.ts on lines 25..27
src/syntax/provide_when_on_syntax.ts on lines 37..39
src/syntax/provide_when_on_syntax.ts on lines 53..55
src/syntax/provide_when_on_syntax.ts on lines 61..63

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

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