inversify/inversify-binding-decorators

View on GitHub
src/syntax/provide_when_syntax.ts

Summary

Maintainability
F
5 days
Test Coverage

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

    public whenNoAncestorMatches(constraint: (request: inversifyInterfaces.Request) => boolean): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenNoAncestorMatches(constraint);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 1 other location - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 116..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 113.

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

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

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

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

Refactorings

Further Reading

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

    public whenAnyAncestorMatches(constraint: (request: inversifyInterfaces.Request) => boolean): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenAnyAncestorMatches(constraint);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 1 other location - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 124..130

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

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

    public whenAnyAncestorIs(ancestor: (Function | string)): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenAnyAncestorIs(ancestor);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 2 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 44..50
src/syntax/provide_when_syntax.ts on lines 76..82

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

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

    public whenNoAncestorIs(ancestor: (Function | string)): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenNoAncestorIs(ancestor);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 2 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 44..50
src/syntax/provide_when_syntax.ts on lines 68..74

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

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

    public whenInjectedInto(parent: (Function | string)): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenInjectedInto(parent);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 2 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 68..74
src/syntax/provide_when_syntax.ts on lines 76..82

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

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

    public whenAnyAncestorTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenAnyAncestorTagged(tag, value);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 36..42
src/syntax/provide_when_syntax.ts on lines 60..66
src/syntax/provide_when_syntax.ts on lines 108..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 103.

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

    public whenParentTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenParentTagged(tag, value);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 36..42
src/syntax/provide_when_syntax.ts on lines 92..98
src/syntax/provide_when_syntax.ts on lines 108..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 103.

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

    public whenTargetTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenTargetTagged(tag, value);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 60..66
src/syntax/provide_when_syntax.ts on lines 92..98
src/syntax/provide_when_syntax.ts on lines 108..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 103.

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

    public whenNoAncestorTagged(tag: string, value: any): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenNoAncestorTagged(tag, value);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 36..42
src/syntax/provide_when_syntax.ts on lines 60..66
src/syntax/provide_when_syntax.ts on lines 92..98

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

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

    public whenTargetNamed(name: string): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenTargetNamed(name);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 52..58
src/syntax/provide_when_syntax.ts on lines 84..90
src/syntax/provide_when_syntax.ts on lines 100..106

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

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

    public whenNoAncestorNamed(name: string): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenNoAncestorNamed(name);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 28..34
src/syntax/provide_when_syntax.ts on lines 52..58
src/syntax/provide_when_syntax.ts on lines 84..90

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

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

    public whenParentNamed(name: string): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenParentNamed(name);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 28..34
src/syntax/provide_when_syntax.ts on lines 84..90
src/syntax/provide_when_syntax.ts on lines 100..106

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

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

    public whenAnyAncestorNamed(name: string): interfaces.ProvideOnSyntax<T> {
        let bindingOnSyntax = (bind: inversifyInterfaces.Bind, target: any) =>
            this._bindingWhenSyntax(bind, target).whenAnyAncestorNamed(name);
        let whenDoneSyntax = new ProvideDoneSyntax(bindingOnSyntax);
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 3 other locations - About 3 hrs to fix
src/syntax/provide_when_syntax.ts on lines 28..34
src/syntax/provide_when_syntax.ts on lines 52..58
src/syntax/provide_when_syntax.ts on lines 100..106

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

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

    public constructor(
        bindingWhenSyntax: (bind: inversifyInterfaces.Bind, target: any) => inversifyInterfaces.BindingWhenSyntax<T>,
        provideDoneSyntax: interfaces.ProvideDoneSyntax
    ) {
        this._bindingWhenSyntax = bindingWhenSyntax;
Severity: Major
Found in src/syntax/provide_when_syntax.ts and 2 other locations - About 2 hrs to fix
src/syntax/provide_in_syntax.ts on lines 13..19
src/syntax/provide_on_syntax.ts on lines 11..17

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

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