orbotix/sphero.js

View on GitHub

Showing 144 of 144 total issues

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

File ble.js has 263 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

var util = require("util"),
    EventEmitter = require("events").EventEmitter;

Severity: Minor
Found in lib/adaptors/ble.js - About 2 hrs to fix

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

        it("#setStabilization calls #command with params", function() {
          sphero.setStabilization(1, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command).to.be.calledWith(0x02, 0x02, [0x01], 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 37..41
    spec/lib/devices/sphero.spec.js on lines 141..146
    spec/lib/devices/sphero.spec.js on lines 194..199
    spec/lib/devices/sphero.spec.js on lines 222..227
    spec/lib/devices/sphero.spec.js on lines 284..289
    spec/lib/devices/sphero.spec.js on lines 302..307
    spec/lib/devices/sphero.spec.js on lines 342..346
    spec/lib/devices/sphero.spec.js on lines 355..359
    spec/lib/devices/sphero.spec.js on lines 401..405
    spec/lib/devices/sphero.spec.js on lines 407..411
    spec/lib/devices/sphero.spec.js on lines 462..467

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 80.

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

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

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

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

    Refactorings

    Further Reading

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

        it("#runMacro calls #command with params", function() {
          sphero.runMacro(0x0F, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command).to.be.calledWith(0x02, 0x50, [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 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

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

        it("#setBackLed calls #command with params", function() {
          sphero.setBackLed(0xFF, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command)
            .to.be.calledWith(0x02, 0x21, [0xFF], 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 222..227
    spec/lib/devices/sphero.spec.js on lines 284..289
    spec/lib/devices/sphero.spec.js on lines 302..307
    spec/lib/devices/sphero.spec.js on lines 342..346
    spec/lib/devices/sphero.spec.js on lines 355..359
    spec/lib/devices/sphero.spec.js on lines 401..405
    spec/lib/devices/sphero.spec.js on lines 407..411
    spec/lib/devices/sphero.spec.js on lines 462..467

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 80.

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

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

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

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

    Refactorings

    Further Reading

    Similar blocks of code found in 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("#refillBank calls #command with params", function() {
          sphero.refillBank(0xAA, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command).to.be.calledWith(0x02, 0x48, [0xAA], 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 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("#boost calls #command with params", function() {
          sphero.boost(0x01, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command)
            .to.be.calledWith(0x02, 0x31, [0x01], 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 284..289
    spec/lib/devices/sphero.spec.js on lines 302..307
    spec/lib/devices/sphero.spec.js on lines 342..346
    spec/lib/devices/sphero.spec.js on lines 355..359
    spec/lib/devices/sphero.spec.js on lines 401..405
    spec/lib/devices/sphero.spec.js on lines 407..411
    spec/lib/devices/sphero.spec.js on lines 462..467

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 80.

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

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

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

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

    Refactorings

    Further Reading

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

        it("#setAccelRange calls #command with params", function() {
          sphero.setAccelRange(180, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command)
            .to.be.calledWith(0x02, 0x14, [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 194..199
    spec/lib/devices/sphero.spec.js on lines 222..227
    spec/lib/devices/sphero.spec.js on lines 284..289
    spec/lib/devices/sphero.spec.js on lines 302..307
    spec/lib/devices/sphero.spec.js on lines 342..346
    spec/lib/devices/sphero.spec.js on lines 355..359
    spec/lib/devices/sphero.spec.js on lines 401..405
    spec/lib/devices/sphero.spec.js on lines 407..411
    spec/lib/devices/sphero.spec.js on lines 462..467

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 80.

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

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

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

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

    Refactorings

    Further Reading

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

        it("#useConsumable calls #command with params", function() {
          sphero.useConsumable(0xCC, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command).to.be.calledWith(0x02, 0x4A, [0xCC], 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 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("#setRotationRate calls #command with params", function() {
          sphero.setRotationRate(180, callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command).to.be.calledWith(0x02, 0x03, [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 141..146
    spec/lib/devices/sphero.spec.js on lines 194..199
    spec/lib/devices/sphero.spec.js on lines 222..227
    spec/lib/devices/sphero.spec.js on lines 284..289
    spec/lib/devices/sphero.spec.js on lines 302..307
    spec/lib/devices/sphero.spec.js on lines 342..346
    spec/lib/devices/sphero.spec.js on lines 355..359
    spec/lib/devices/sphero.spec.js on lines 401..405
    spec/lib/devices/sphero.spec.js on lines 407..411
    spec/lib/devices/sphero.spec.js on lines 462..467

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 80.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 80.

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

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

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

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

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language