orbotix/sphero.js

View on GitHub

Showing 119 of 144 total issues

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

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

    it("#abortMacro calls #command with params", function() {
      sphero.abortMacro(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x55, 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 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("#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("#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("#getTempOptionFlags calls #command with params", function() {
      sphero.getTempOptionFlags(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x38, 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 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("#abortOrbBasicProgram calls #command with params", function() {
      sphero.abortOrbBasicProgram(callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x63, 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 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 3 locations. Consider refactoring.
Open

    it("calls @packet#create with params", function() {
      expect(sphero.packet.create).to.be.calledOnce;
      expect(sphero.packet.create).to.be.calledWith(opts);
    });
Severity: Major
Found in spec/lib/sphero.spec.js and 2 other locations - About 1 hr to fix
spec/lib/sphero.spec.js on lines 136..139
spec/lib/sphero.spec.js on lines 338..341

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

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

    it("calls @packet.parse passing the buffer", function() {
      expect(sphero.packet.parse).to.be.calledOnce;
      expect(sphero.packet.parse).to.be.calledWith(buffer);
    });
Severity: Major
Found in spec/lib/sphero.spec.js and 2 other locations - About 1 hr to fix
spec/lib/sphero.spec.js on lines 328..331
spec/lib/sphero.spec.js on lines 338..341

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

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("converts to an RGB object at +20%", function() {
        device.color(0x6699cc, .2);
        var color = { red: 0x7a, green: 0xb8, blue: 0xf5 };
        expect(rgb).to.be.calledWith(color);
      });
Severity: Major
Found in spec/lib/devices/custom.spec.js and 1 other location - About 1 hr to fix
spec/lib/devices/custom.spec.js on lines 99..103

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

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("converts to an RGB object at normal %", function() {
        device.color(0x6699cc, 0);
        var color = { red: 0x66, green: 0x99, blue: 0xcc };
        expect(rgb).to.be.calledWith(color);
      });
Severity: Major
Found in spec/lib/devices/custom.spec.js and 1 other location - About 1 hr to fix
spec/lib/devices/custom.spec.js on lines 87..91

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

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

    it("calls @connection#write with param commandPacket", function() {
      expect(sphero.connection.write).to.be.calledOnce;
      expect(sphero.connection.write).to.be.calledWith(cmdByteArray);
    });
Severity: Major
Found in spec/lib/sphero.spec.js and 2 other locations - About 1 hr to fix
spec/lib/sphero.spec.js on lines 136..139
spec/lib/sphero.spec.js on lines 328..331

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

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