orbotix/sphero.js

View on GitHub

Showing 144 of 144 total issues

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("#commitToFlash calls #command with params", function() {
      sphero.commitToFlash(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x65, null, callback);
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#_commitToFlashAlias calls #command with params", function() {
      sphero._commitToFlashAlias(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x70, null, callback);
Severity: Major
Found in spec/lib/devices/sphero.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/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

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("#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("#getChassisId calls #command with params", function() {
      sphero.getChassisId(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command).to.be.calledWith(0x02, 0x07, null, callback);
    });
Severity: Major
Found in spec/lib/devices/sphero.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/core.spec.js on lines 123..128
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("#getPermOptionFlags calls #command with params", function() {
      sphero.getPermOptionFlags(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x36, null, callback);
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#reInitMacroExec calls #command with params", function() {
      sphero.reInitMacroExec(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x54, null, callback);
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#readLocator calls #command with params", function() {
      sphero.readLocator(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x15, null, callback);
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#getMacroStatus calls #command with params", function() {
      sphero.getMacroStatus(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x56, null, callback);
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#getRgbLed calls #command with params", function() {
      sphero.getRgbLed(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x22, null, callback);
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#getDeviceMode calls #command with params", function() {
      sphero.getDeviceMode(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command).to.be.calledWith(0x02, 0x44, null, callback);
    });
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#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

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("#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("#getPasswordSeed calls #command with params", function() {
      sphero.getPasswordSeed(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command).to.be.calledWith(0x02, 0x4E, null, callback);
    });
Severity: Major
Found in spec/lib/devices/sphero.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/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 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("#getSsb calls #command with params", function() {
      sphero.getSsb(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command).to.be.calledWith(0x02, 0x46, null, callback);
    });
Severity: Major
Found in spec/lib/devices/sphero.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/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 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

Severity
Category
Status
Source
Language