orbotix/sphero.js

View on GitHub

Showing 144 of 144 total issues

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

        it("returns a packet obj when calling parse", function() {
          expect(res).to.not.be.null;
          expect(res).to.be.eql({
            sop1: 0xFF,
            sop2: 0xFF,
Severity: Major
Found in spec/lib/packet.spec.js and 1 other location - About 3 hrs to fix
spec/lib/packet.spec.js on lines 235..246

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

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

Function core has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function core(device) {
  // Core Virtual Device Address = 0x00
  var command = device.command.bind(device, 0x00);

  /**
Severity: Major
Found in lib/devices/core.js - About 2 hrs to fix

    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

    File packet.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    var inherits = require("util").inherits,
        EventEmitter = require("events").EventEmitter;
    
    
    Severity: Minor
    Found in lib/packet.js - About 2 hrs to fix

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 84.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 84.

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

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

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

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

      Refactorings

      Further Reading

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 83.

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

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

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

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

      Refactorings

      Further Reading

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

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

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

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 83.

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

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

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

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

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language