orbotix/sphero.js

View on GitHub

Showing 119 of 144 total issues

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

    it("#saveMacro calls #command with params", function() {
      sphero.saveMacro([0x01, 0x02, 0x03], callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x52, [0x01, 0x02, 0x03], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 3 other locations - About 2 hrs to fix
spec/lib/devices/sphero.spec.js on lines 309..315
spec/lib/devices/sphero.spec.js on lines 413..418
spec/lib/devices/sphero.spec.js on lines 455..460

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

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

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

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

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

Refactorings

Further Reading

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

    it("#setConfigBlock calls #command with params", function() {
      sphero.setConfigBlock([0x01, 0x02, 0x03], callback);

      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 3 other locations - About 2 hrs to fix
spec/lib/devices/sphero.spec.js on lines 413..418
spec/lib/devices/sphero.spec.js on lines 420..425
spec/lib/devices/sphero.spec.js on lines 455..460

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

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("#setMacroParam calls #command with params", function() {
      sphero.setMacroParam(0x01, 0x02, 0x03, callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x57, [0x01, 0x02, 0x03], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 1 other location - About 2 hrs to fix
spec/lib/devices/sphero.spec.js on lines 476..481

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

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

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

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

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

Refactorings

Further Reading

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

    it("#executeOrbBasicProgram calls #command with params", function() {
      sphero.executeOrbBasicProgram(0x0F, 0x0F, 0x0B, callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x62, [0x0F, 0x0F, 0x0B], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 1 other location - About 2 hrs to fix
spec/lib/devices/sphero.spec.js on lines 448..453

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 84.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 83.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 83.

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

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

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

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

Refactorings

Further Reading

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

    it("#setTempOptionFlags calls #command with params", function() {
      sphero.setTempOptionFlags(0xAABBCCDD, callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x37, [0xAA, 0xBB, 0xCC, 0xDD], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 4 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 137..142
spec/lib/devices/core.spec.js on lines 144..149
spec/lib/devices/sphero.spec.js on lines 256..261
spec/lib/devices/sphero.spec.js on lines 490..495

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 83.

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

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

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

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

Refactorings

Further Reading

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

    it("#setPermOptionFlags calls #command with params", function() {
      sphero.setPermOptionFlags(0xAABBCCDD, callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x35, [0xAA, 0xBB, 0xCC, 0xDD], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 4 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 137..142
spec/lib/devices/core.spec.js on lines 144..149
spec/lib/devices/sphero.spec.js on lines 270..275
spec/lib/devices/sphero.spec.js on lines 490..495

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 83.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 83.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 82.

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

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

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

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

Refactorings

Further Reading

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

    it("#buyConsumable calls #command with params", function() {
      sphero.buyConsumable(0xCC, 0x0F, callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x49, [0xCC, 0x0F], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 1 other location - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 51..55

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 82.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

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

    it("#setHeading calls #command with params", function() {
      sphero.setHeading(180, callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x01, [0x00, 0xB4], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 3 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 95..100
spec/lib/devices/sphero.spec.js on lines 49..54
spec/lib/devices/sphero.spec.js on lines 249..254

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

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

    it("#setMotionTimeout calls #command with params", function() {
      sphero.setMotionTimeout(0xAABB, callback);
      expect(sphero.command).to.be.calledOnce;
      expect(sphero.command)
        .to.be.calledWith(0x02, 0x34, [0xAA, 0xBB], callback);
Severity: Major
Found in spec/lib/devices/sphero.spec.js and 3 other locations - About 2 hrs to fix
spec/lib/devices/core.spec.js on lines 95..100
spec/lib/devices/sphero.spec.js on lines 24..29
spec/lib/devices/sphero.spec.js on lines 49..54

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 80.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 80.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 80.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language