hybridgroup/cylon-m2x

View on GitHub
lib/adaptor.js

Summary

Maintainability
C
1 day
Test Coverage

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

Adaptor.prototype.deleteStream = function(id, name, cb) {
  this.devices.deleteStream(id, name, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.trigger = function(id, triggerId, cb) {
  this.devices.trigger(id, triggerId, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.createTrigger = function(id, params, cb) {
  this.devices.createTrigger(id, params, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.updateLocation = function(id, params, cb) {
  this.devices.updateLocation(id, params, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.testTrigger = function(id, triggerId, cb) {
  this.devices.testTrigger(id, triggerId, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.deleteTrigger = function(id, triggerId, cb) {
  this.devices.deleteTrigger(id, triggerId, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.postMultiple = function(id, params, cb) {
  this.devices.postMultiple(id, params, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.createKey = function(id, params, cb) {
  this.devices.createKey(id, params, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138

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

Adaptor.prototype.update = function(id, params, cb) {
  this.devices.update(id, params, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 108..110
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.stream = function(id, name, cb) {
  this.devices.stream(id, name, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 9 other locations - About 40 mins to fix
lib/adaptor.js on lines 88..90
lib/adaptor.js on lines 100..102
lib/adaptor.js on lines 112..114
lib/adaptor.js on lines 116..118
lib/adaptor.js on lines 124..126
lib/adaptor.js on lines 128..130
lib/adaptor.js on lines 132..134
lib/adaptor.js on lines 136..138
lib/adaptor.js on lines 152..154

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

Adaptor.prototype.location = function(id, cb) {
  this.devices.location(id, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 84..86
lib/adaptor.js on lines 92..94
lib/adaptor.js on lines 104..106
lib/adaptor.js on lines 120..122
lib/adaptor.js on lines 140..142
lib/adaptor.js on lines 144..146
lib/adaptor.js on lines 148..150

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

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

Adaptor.prototype.triggers = function(id, cb) {
  this.devices.triggers(id, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 84..86
lib/adaptor.js on lines 92..94
lib/adaptor.js on lines 96..98
lib/adaptor.js on lines 104..106
lib/adaptor.js on lines 140..142
lib/adaptor.js on lines 144..146
lib/adaptor.js on lines 148..150

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

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

Adaptor.prototype.streams = function(id, cb) {
  this.devices.streams(id, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 84..86
lib/adaptor.js on lines 92..94
lib/adaptor.js on lines 96..98
lib/adaptor.js on lines 120..122
lib/adaptor.js on lines 140..142
lib/adaptor.js on lines 144..146
lib/adaptor.js on lines 148..150

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

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

Adaptor.prototype.view = function(id, cb) {
  this.devices.view(id, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 84..86
lib/adaptor.js on lines 96..98
lib/adaptor.js on lines 104..106
lib/adaptor.js on lines 120..122
lib/adaptor.js on lines 140..142
lib/adaptor.js on lines 144..146
lib/adaptor.js on lines 148..150

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

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

Adaptor.prototype.log = function(id, cb) {
  this.devices.log(id, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 84..86
lib/adaptor.js on lines 92..94
lib/adaptor.js on lines 96..98
lib/adaptor.js on lines 104..106
lib/adaptor.js on lines 120..122
lib/adaptor.js on lines 144..146
lib/adaptor.js on lines 148..150

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

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

Adaptor.prototype.create = function(params, cb) {
  this.devices.create(params, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 92..94
lib/adaptor.js on lines 96..98
lib/adaptor.js on lines 104..106
lib/adaptor.js on lines 120..122
lib/adaptor.js on lines 140..142
lib/adaptor.js on lines 144..146
lib/adaptor.js on lines 148..150

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

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

Adaptor.prototype.keys = function(id, cb) {
  this.devices.keys(id, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 84..86
lib/adaptor.js on lines 92..94
lib/adaptor.js on lines 96..98
lib/adaptor.js on lines 104..106
lib/adaptor.js on lines 120..122
lib/adaptor.js on lines 140..142
lib/adaptor.js on lines 144..146

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

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

Adaptor.prototype.deleteDevice = function(id, cb) {
  this.devices.deleteDevice(id, this._defCb(cb));
};
Severity: Major
Found in lib/adaptor.js and 7 other locations - About 35 mins to fix
lib/adaptor.js on lines 84..86
lib/adaptor.js on lines 92..94
lib/adaptor.js on lines 96..98
lib/adaptor.js on lines 104..106
lib/adaptor.js on lines 120..122
lib/adaptor.js on lines 140..142
lib/adaptor.js on lines 148..150

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

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