hybridgroup/cylon-m2x

View on GitHub

Showing 38 of 38 total issues

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

Driver.prototype.deleteStreamValues = function(id, name, filters, callback) {
  this.connection.deleteStreamValues(id, name, filters, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

Driver.prototype.streamStats = function(id, name, filters, callback) {
  this.connection.streamStats(id, name, filters, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

Driver.prototype.postValues = function(id, name, values, callback) {
  this.connection.postValues(id, name, values, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

Driver.prototype.sampleStreamValues = function(id, name, filters, callback) {
  this.connection.sampleStreamValues(id, name, filters, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

Driver.prototype.updateStream = function(id, name, params, callback) {
  this.connection.updateStream(id, name, params, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

Driver.prototype.streamValues = function(id, name, filters, callback) {
  this.connection.streamValues(id, name, filters, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

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

Driver.prototype.setStreamValue = function(id, name, params, callback) {
  this.connection.setStreamValue(id, name, params, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

Driver.prototype.deleteStream = function(id, name, filters, callback) {
  this.connection.deleteStream(id, name, filters, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 331..333
lib/driver.js on lines 420..422

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

Driver.prototype.updateTrigger = function(id, name, params, callback) {
  this.connection.updateTrigger(id, name, params, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 420..422

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

Driver.prototype.updateKey = function(id, key, params, callback) {
  this.connection.updateKey(id, key, params, callback);
};
Severity: Major
Found in lib/driver.js and 9 other locations - About 35 mins to fix
lib/driver.js on lines 155..157
lib/driver.js on lines 169..171
lib/driver.js on lines 196..198
lib/driver.js on lines 210..212
lib/driver.js on lines 224..226
lib/driver.js on lines 238..240
lib/driver.js on lines 252..254
lib/driver.js on lines 266..268
lib/driver.js on lines 331..333

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

Severity
Category
Status
Source
Language