orbotix/sphero.js

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

Summary

Maintainability
F
2 wks
Test Coverage

File sphero.spec.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

var mutator = lib("devices/sphero");

describe("Sphero", function() {
Severity: Minor
Found in spec/lib/devices/sphero.spec.js - About 6 hrs to fix

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

        it("#setRgbLed calls #command with params", function() {
          var opts = {
            red: 0xFF,
            green: 0xFE,
            blue: 0xFD,
    Severity: Major
    Found in spec/lib/devices/sphero.spec.js and 1 other location - About 4 hrs to fix
    spec/lib/devices/sphero.spec.js on lines 229..247

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

    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("#setRawMotors calls #command with params", function() {
          var opts = {
            lmode: 0x03,
            lpower: 0xFE,
            rmode: 0x02,
    Severity: Major
    Found in spec/lib/devices/sphero.spec.js and 1 other location - About 4 hrs to fix
    spec/lib/devices/sphero.spec.js on lines 174..192

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

    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("#addXp calls #command with params", function() {
          sphero.addXp(0xCC, 0xFF, callback);
          var byteArray = [
            0x00, 0x00, 0x00, 0xCC,
            0xFF
    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 384..393

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

    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("#levelUpAttr calls #command with params", function() {
          sphero.levelUpAttr(0xCC, 0xFF, callback);
          var byteArray = [
            0x00, 0x00, 0x00, 0xCC,
            0xFF
    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 373..382

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

    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("#setSsbModBlock calls #command with params", function() {
          sphero.setSsbModBlock(0xAABBCCDD, [0x01, 0x02, 0x03], callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command)
            .to.be.calledWith(
    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 329..340

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

    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("#setSsb calls #command with params", function() {
          sphero.setSsb(0xAABBCCDD, [0x01, 0x02, 0x03], callback);
    
          expect(sphero.command).to.be.calledOnce;
    
    
    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 291..300

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

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

        it("#saveTempMacro calls #command with params", function() {
          sphero.saveTempMacro([0x01, 0x02, 0x03], callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command)
            .to.be.calledWith(0x02, 0x51, [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 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 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("#appendMacroChunk calls #command with params", function() {
          sphero.appendMacroChunk([0x01, 0x02, 0x03], callback);
          expect(sphero.command).to.be.calledOnce;
          expect(sphero.command)
            .to.be.calledWith(0x02, 0x58, [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 420..425

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 77.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 77.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 77.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 77.

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

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

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

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

    Refactorings

    Further Reading

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 77.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status