jeffijoe/awilix

View on GitHub

Showing 54 of 80 total issues

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

    class KeysTest {
      keys: Array<string>
      constructor(cradle: any) {
        this.keys = Object.keys(cradle)
      }
Severity: Minor
Found in src/__tests__/container.test.ts and 1 other location - About 50 mins to fix
src/__tests__/container.test.ts on lines 543..548

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 179..183
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 287..291

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

    const deps = {
      container,
      listModules: jest.fn(() => moduleLookupResult),
      require: jest.fn((path) => modules[path]),
    }
Severity: Major
Found in src/__tests__/load-modules.test.ts and 9 other locations - About 45 mins to fix
src/__tests__/load-modules.test.ts on lines 28..32
src/__tests__/load-modules.test.ts on lines 80..84
src/__tests__/load-modules.test.ts on lines 104..108
src/__tests__/load-modules.test.ts on lines 136..140
src/__tests__/load-modules.test.ts on lines 202..206
src/__tests__/load-modules.test.ts on lines 222..226
src/__tests__/load-modules.test.ts on lines 245..249
src/__tests__/load-modules.test.ts on lines 265..269
src/__tests__/load-modules.test.ts on lines 287..291

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

  it('has an AwilixResolutionError function', () => {
    expect(awilix).toHaveProperty('AwilixResolutionError')
    expect(awilix.AwilixResolutionError).toBe(AwilixResolutionError)
  })
Severity: Minor
Found in src/__tests__/awilix.test.ts and 2 other locations - About 35 mins to fix
src/__tests__/awilix.test.ts on lines 12..15
src/__tests__/awilix.test.ts on lines 17..20

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

  it('has a createContainer function', () => {
    expect(awilix).toHaveProperty('createContainer')
    expect(awilix.createContainer).toBe(createContainer)
  })
Severity: Minor
Found in src/__tests__/awilix.test.ts and 2 other locations - About 35 mins to fix
src/__tests__/awilix.test.ts on lines 17..20
src/__tests__/awilix.test.ts on lines 22..25

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

  it('has a listModules function', () => {
    expect(awilix).toHaveProperty('listModules')
    expect(awilix.listModules).toBe(listModules)
  })
Severity: Minor
Found in src/__tests__/awilix.test.ts and 2 other locations - About 35 mins to fix
src/__tests__/awilix.test.ts on lines 12..15
src/__tests__/awilix.test.ts on lines 22..25

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

Severity
Category
Status
Source
Language