zazoomauro/node-dependency-injection

View on GitHub

Showing 38 of 38 total issues

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

export default class JsonDumper extends Dumper {
  async dump () {
    const dataContent = JSON.stringify(this._content)
    await fs.writeFile(
      this._serviceFile,
Severity: Major
Found in lib/Dump/JsonDumper.js and 1 other location - About 1 hr to fix
lib/Dump/YamlDumper.js on lines 5..14

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

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

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

if (!process.argv.slice(2).length) {
  program.outputHelp((helpText) => {
    return chalk.bold.red(helpText)
  })
}
Severity: Major
Found in bin/ndi-container:service.js and 2 other locations - About 1 hr to fix
bin/ndi-config:check.js on lines 40..44
bin/ndi-config:create.js on lines 41..45

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

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

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

if (!process.argv.slice(2).length) {
  program.outputHelp((helpText) => {
    return chalk.bold.red(helpText)
  })
}
Severity: Major
Found in bin/ndi-config:create.js and 2 other locations - About 1 hr to fix
bin/ndi-config:check.js on lines 40..44
bin/ndi-container:service.js on lines 112..116

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

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

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

if (!process.argv.slice(2).length) {
  program.outputHelp((helpText) => {
    return chalk.bold.red(helpText)
  })
}
Severity: Major
Found in bin/ndi-config:check.js and 2 other locations - About 1 hr to fix
bin/ndi-config:create.js on lines 41..45
bin/ndi-container:service.js on lines 112..116

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

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

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

  try {
    loader.load(dir)
  } catch (e) {
    console.info(chalk.bold.red(`ERROR! ${e.message}`))
    process.exit(1)
Severity: Major
Found in bin/ndi-container:service.js and 1 other location - About 1 hr to fix
bin/ndi-config:check.js on lines 30..37

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

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

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

  try {
    loader.load(dir)
    console.info(chalk.green(`Configuration file ${dir} is valid`))
    process.exit(0)
  } catch (e) {
Severity: Major
Found in bin/ndi-config:check.js and 1 other location - About 1 hr to fix
bin/ndi-container:service.js on lines 32..37

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

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

export default class RootDirectoryMustBeAbsolute extends Error {
  constructor () {
    super('Root directory must be absolute')
    this.name = 'RootDirectoryMustBeAbsolute'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/RootDirectoryMustBeAbsolute.js and 7 other locations - About 55 mins to fix
lib/Exception/AttributesMapException.js on lines 1..7
lib/Exception/FrozenContainerException.js on lines 1..7
lib/Exception/LoggerWarnMethodNotFoundException.js on lines 1..7
lib/Exception/MethodCallEmptyException.js on lines 1..7
lib/Exception/RootDirectoryNotFound.js on lines 1..7
lib/Exception/ServiceCircularReferenceException.js on lines 1..7
lib/Exception/WrongDefinitionException.js on lines 1..7

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

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

export default class MethodCallEmptyException extends Error {
  constructor () {
    super('Method name cannot be empty')
    this.name = 'MethodCallEmptyException'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/MethodCallEmptyException.js and 7 other locations - About 55 mins to fix
lib/Exception/AttributesMapException.js on lines 1..7
lib/Exception/FrozenContainerException.js on lines 1..7
lib/Exception/LoggerWarnMethodNotFoundException.js on lines 1..7
lib/Exception/RootDirectoryMustBeAbsolute.js on lines 1..7
lib/Exception/RootDirectoryNotFound.js on lines 1..7
lib/Exception/ServiceCircularReferenceException.js on lines 1..7
lib/Exception/WrongDefinitionException.js on lines 1..7

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

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

export default class AttributesMapException extends Error {
  constructor () {
    super('Attributes is not type Map')
    this.name = 'AttributesMapException'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/AttributesMapException.js and 7 other locations - About 55 mins to fix
lib/Exception/FrozenContainerException.js on lines 1..7
lib/Exception/LoggerWarnMethodNotFoundException.js on lines 1..7
lib/Exception/MethodCallEmptyException.js on lines 1..7
lib/Exception/RootDirectoryMustBeAbsolute.js on lines 1..7
lib/Exception/RootDirectoryNotFound.js on lines 1..7
lib/Exception/ServiceCircularReferenceException.js on lines 1..7
lib/Exception/WrongDefinitionException.js on lines 1..7

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

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

export default class FrozenContainerException extends Error {
  constructor () {
    super('You cannot register more services when the container is frozen')
    this.name = 'FrozenContainerException'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/FrozenContainerException.js and 7 other locations - About 55 mins to fix
lib/Exception/AttributesMapException.js on lines 1..7
lib/Exception/LoggerWarnMethodNotFoundException.js on lines 1..7
lib/Exception/MethodCallEmptyException.js on lines 1..7
lib/Exception/RootDirectoryMustBeAbsolute.js on lines 1..7
lib/Exception/RootDirectoryNotFound.js on lines 1..7
lib/Exception/ServiceCircularReferenceException.js on lines 1..7
lib/Exception/WrongDefinitionException.js on lines 1..7

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

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

export default class LoggerWarnMethodNotFoundException extends Error {
  constructor () {
    super('The logger instance does not implements the warn method')
    this.name = 'LoggerWarnMethodNotFoundException'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/LoggerWarnMethodNotFoundException.js and 7 other locations - About 55 mins to fix
lib/Exception/AttributesMapException.js on lines 1..7
lib/Exception/FrozenContainerException.js on lines 1..7
lib/Exception/MethodCallEmptyException.js on lines 1..7
lib/Exception/RootDirectoryMustBeAbsolute.js on lines 1..7
lib/Exception/RootDirectoryNotFound.js on lines 1..7
lib/Exception/ServiceCircularReferenceException.js on lines 1..7
lib/Exception/WrongDefinitionException.js on lines 1..7

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

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

export default class ServiceCircularReferenceException extends Error {
  constructor () {
    super('Circular reference detected')
    this.name = 'ServiceCircularReferenceException'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/ServiceCircularReferenceException.js and 7 other locations - About 55 mins to fix
lib/Exception/AttributesMapException.js on lines 1..7
lib/Exception/FrozenContainerException.js on lines 1..7
lib/Exception/LoggerWarnMethodNotFoundException.js on lines 1..7
lib/Exception/MethodCallEmptyException.js on lines 1..7
lib/Exception/RootDirectoryMustBeAbsolute.js on lines 1..7
lib/Exception/RootDirectoryNotFound.js on lines 1..7
lib/Exception/WrongDefinitionException.js on lines 1..7

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

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

export default class WrongDefinitionException extends Error {
  constructor () {
    super('You cannot register not valid definition')
    this.name = 'WrongDefinitionException'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/WrongDefinitionException.js and 7 other locations - About 55 mins to fix
lib/Exception/AttributesMapException.js on lines 1..7
lib/Exception/FrozenContainerException.js on lines 1..7
lib/Exception/LoggerWarnMethodNotFoundException.js on lines 1..7
lib/Exception/MethodCallEmptyException.js on lines 1..7
lib/Exception/RootDirectoryMustBeAbsolute.js on lines 1..7
lib/Exception/RootDirectoryNotFound.js on lines 1..7
lib/Exception/ServiceCircularReferenceException.js on lines 1..7

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

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

export default class RootDirectoryNotFound extends Error {
  constructor () {
    super('Root directory not found')
    this.name = 'RootDirectoryNotFound'
    this.stack = (new Error()).stack
Severity: Major
Found in lib/Exception/RootDirectoryNotFound.js and 7 other locations - About 55 mins to fix
lib/Exception/AttributesMapException.js on lines 1..7
lib/Exception/FrozenContainerException.js on lines 1..7
lib/Exception/LoggerWarnMethodNotFoundException.js on lines 1..7
lib/Exception/MethodCallEmptyException.js on lines 1..7
lib/Exception/RootDirectoryMustBeAbsolute.js on lines 1..7
lib/Exception/ServiceCircularReferenceException.js on lines 1..7
lib/Exception/WrongDefinitionException.js on lines 1..7

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

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

  constructor (adapter, fs, path) {
    this._adapter = adapter
    this._fs = fs
    this._path = path
  }
Severity: Minor
Found in bin/Services/File/FileManager.js and 1 other location - About 40 mins to fix
lib/InstanceManager.js on lines 17..21

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

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

  constructor (containerBuilder, definitions, alias) {
    this._containerBuilder = containerBuilder
    this._definitions = definitions
    this._alias = alias
  }
Severity: Minor
Found in lib/InstanceManager.js and 1 other location - About 40 mins to fix
bin/Services/File/FileManager.js on lines 7..11

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

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

class TagReference {
  /**
   * @param {string} name
   */
  constructor (name) {
Severity: Minor
Found in lib/TagReference.js and 1 other location - About 35 mins to fix
lib/PackageReference.js on lines 1..15

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

class PackageReference {
  /**
   * @param {string} id
   */
  constructor (id) {
Severity: Minor
Found in lib/PackageReference.js and 1 other location - About 35 mins to fix
lib/TagReference.js on lines 1..15

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