orbotix/sphero.js

View on GitHub
spec/lib/devices/core.spec.js

Summary

Maintainability
F
4 days
Test Coverage

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

    it("#setVoltageTripPoints calls #command with params", function() {
      core.setVoltageTripPoints(0xFF00, 0x00FF, callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x24, [0xFF, 0x00, 0x00, 0xFF], callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 1 other location - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 130..135

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

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

    it("#_coreTimeCmd calls #command with params", function() {
      core._coreTimeCmd(0x50, 0xFF, callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x50, [0x00, 0x00, 0x00, 0xFF], callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 1 other location - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 88..93

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

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

    it("#assignTime calls #_coreTimeCmd with params", function() {
      core.assignTime(0xFF, callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x50, [0x00, 0x00, 0x00, 0xFF], callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 4 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 144..149
spec/lib/devices/sphero.spec.js on lines 256..261
spec/lib/devices/sphero.spec.js on lines 270..275
spec/lib/devices/sphero.spec.js on lines 490..495

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

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

    it("#pollPacketTimes calls #_coreTimeCmd with params", function() {
      core.pollPacketTimes(0xFF, callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x51, [0x00, 0x00, 0x00, 0xFF], callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 4 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 137..142
spec/lib/devices/sphero.spec.js on lines 256..261
spec/lib/devices/sphero.spec.js on lines 270..275
spec/lib/devices/sphero.spec.js on lines 490..495

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

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

    it("#setAutoReconnect calls #command with params", function() {
      core.setAutoReconnect(0x01, 0x05, callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x12, [0x01, 0x05], callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 1 other location - About 2 hrs to fix
spec/lib/devices/sphero.spec.js on lines 348..353

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

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

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

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

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

Refactorings

Further Reading

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

    it("#setInactiveTimeout calls #command with params", function() {
      core.setInactivityTimeout(0x0F, callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x25, [0x00, 0x0F], callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 3 other locations - About 2 hrs to fix
spec/lib/devices/sphero.spec.js on lines 24..29
spec/lib/devices/sphero.spec.js on lines 49..54
spec/lib/devices/sphero.spec.js on lines 249..254

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

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

    it("#setPowerNotification calls #command with params", function() {
      core.setPowerNotification(0x01, callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x21, [0x01], callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 12 other locations - About 2 hrs to fix
spec/lib/devices/sphero.spec.js on lines 31..35
spec/lib/devices/sphero.spec.js on lines 37..41
spec/lib/devices/sphero.spec.js on lines 141..146
spec/lib/devices/sphero.spec.js on lines 194..199
spec/lib/devices/sphero.spec.js on lines 222..227
spec/lib/devices/sphero.spec.js on lines 284..289
spec/lib/devices/sphero.spec.js on lines 302..307
spec/lib/devices/sphero.spec.js on lines 342..346
spec/lib/devices/sphero.spec.js on lines 355..359
spec/lib/devices/sphero.spec.js on lines 401..405
spec/lib/devices/sphero.spec.js on lines 407..411
spec/lib/devices/sphero.spec.js on lines 462..467

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

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

    it("#ping calls #command with params", function() {
      core.ping(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x01, null, callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#version calls #command with params", function() {
      core.version(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x02, null, callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#jumpToBotloader calls #command with params", function() {
      core.jumpToBootloader(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x30, null, callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#runL1Diags calls #command with params", function() {
      core.runL1Diags(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x40, null, callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#getAutoReconnect calls #command with params", function() {
      core.getAutoReconnect(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x13, null, callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#clearCounters calls #command with params", function() {
      core.clearCounters(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x42, null, callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#getBluetoothInfo calls #command with params", function() {
      core.getBluetoothInfo(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x11, null, callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#getVoltageTripPoints calls #command with params", function() {
      core.getVoltageTripPoints(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x23, null, callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#controlUartTx calls #command with params", function() {
      core.controlUartTx(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x03, null, callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#getPowerState calls #command with params", function() {
      core.getPowerState(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command).to.be.calledWith(0x00, 0x20, null, callback);
    });
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 116..121
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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

    it("#runL2Diags calls #command with params", function() {
      core.runL2Diags(callback);
      expect(core.command).to.be.calledOnce;
      expect(core.command)
        .to.be.calledWith(0x00, 0x41, null, callback);
Severity: Major
Found in spec/lib/devices/core.spec.js and 24 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 20..24
spec/lib/devices/core.spec.js on lines 26..30
spec/lib/devices/core.spec.js on lines 32..36
spec/lib/devices/core.spec.js on lines 45..49
spec/lib/devices/core.spec.js on lines 57..61
spec/lib/devices/core.spec.js on lines 63..67
spec/lib/devices/core.spec.js on lines 82..86
spec/lib/devices/core.spec.js on lines 102..107
spec/lib/devices/core.spec.js on lines 109..114
spec/lib/devices/core.spec.js on lines 123..128
spec/lib/devices/sphero.spec.js on lines 43..47
spec/lib/devices/sphero.spec.js on lines 148..153
spec/lib/devices/sphero.spec.js on lines 201..206
spec/lib/devices/sphero.spec.js on lines 263..268
spec/lib/devices/sphero.spec.js on lines 277..282
spec/lib/devices/sphero.spec.js on lines 317..321
spec/lib/devices/sphero.spec.js on lines 323..327
spec/lib/devices/sphero.spec.js on lines 395..399
spec/lib/devices/sphero.spec.js on lines 427..432
spec/lib/devices/sphero.spec.js on lines 434..439
spec/lib/devices/sphero.spec.js on lines 441..446
spec/lib/devices/sphero.spec.js on lines 483..488
spec/lib/devices/sphero.spec.js on lines 497..502
spec/lib/devices/sphero.spec.js on lines 504..509

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

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