hybridgroup/cylon-firmata

View on GitHub

Showing 41 of 41 total issues

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

    setInterval(function() {
      analogValue = bot.sensor.analogRead();
      voltage = (analogValue * 5.0) / 1024;
      temperature = (voltage - 0.5) * 100;

Severity: Major
Found in examples/temperature_sensor/fluent-temperature-sensor.js and 1 other location - About 1 hr to fix
examples/temperature_sensor/temperature_sensor.js on lines 20..26

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

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

    every((2).seconds(), function() {
      my.blinkm.getRGBColor(function(err, data) {
        console.log(err || "Current Color: ", data);
      });
      my.blinkm.fadeToRandomRGB(128, 128, 128);
Severity: Major
Found in examples/blinkm/blinkm.js and 1 other location - About 1 hr to fix
examples/blinkm/fluent-blinkm.js on lines 21..27

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

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

    setInterval(function() {
      bot.blinkm.getRGBColor(function(err, data) {
        console.log(err || "Current Color: ", data);
      });

Severity: Major
Found in examples/blinkm/fluent-blinkm.js and 1 other location - About 1 hr to fix
examples/blinkm/blinkm.js on lines 27..32

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

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 work has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  work: function(my) {
    my.bmp180.getTemperature(function(err, val) {
      if (err) {
        console.log(err);
        return;
Severity: Minor
Found in examples/bmp180/bmp180.js - About 1 hr to fix

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

        setInterval(function() {
          brightness += fade;
          bot.led.brightness(brightness);
          if ((brightness === 0) || (brightness === 255)) { fade = -fade; }
        }, 500);
    Severity: Major
    Found in examples/led_brightness/fluent-led_brightness.js and 1 other location - About 1 hr to fix
    examples/led_brightness/led_brightness.js on lines 18..22

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

    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

        every((0.05).seconds(), function() {
          brightness += fade;
          my.led.brightness(brightness);
          if ((brightness === 0) || (brightness === 255)) { fade = -fade; }
        });
    Severity: Major
    Found in examples/led_brightness/led_brightness.js and 1 other location - About 1 hr to fix
    examples/led_brightness/fluent-led_brightness.js on lines 13..17

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

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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("led", { driver: "led", pin: 13 })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/blink/fluent-blink.js and 5 other locations - About 55 mins to fix
    examples/button/fluent-button.js on lines 5..8
    examples/led_brightness/fluent-led_brightness.js on lines 5..18
    examples/maxbotix/fluent-maxbotix.js on lines 5..15
    examples/motor/fluent-motor.js on lines 5..21
    examples/temperature_sensor/fluent-temperature-sensor.js on lines 6..23

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

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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/cu.usbmodem1451" })
      .device("sensor", { driver: "analogSensor", pin: 0 })
    
    
    Severity: Major
    Found in examples/temperature_sensor/fluent-temperature-sensor.js and 5 other locations - About 55 mins to fix
    examples/blink/fluent-blink.js on lines 5..13
    examples/button/fluent-button.js on lines 5..8
    examples/led_brightness/fluent-led_brightness.js on lines 5..18
    examples/maxbotix/fluent-maxbotix.js on lines 5..15
    examples/motor/fluent-motor.js on lines 5..21

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

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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("maxbotix", { driver: "maxbotix", pin: 1 })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/maxbotix/fluent-maxbotix.js and 5 other locations - About 55 mins to fix
    examples/blink/fluent-blink.js on lines 5..13
    examples/button/fluent-button.js on lines 5..8
    examples/led_brightness/fluent-led_brightness.js on lines 5..18
    examples/motor/fluent-motor.js on lines 5..21
    examples/temperature_sensor/fluent-temperature-sensor.js on lines 6..23

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

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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("led", { driver: "led", pin: 3 })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/led_brightness/fluent-led_brightness.js and 5 other locations - About 55 mins to fix
    examples/blink/fluent-blink.js on lines 5..13
    examples/button/fluent-button.js on lines 5..8
    examples/maxbotix/fluent-maxbotix.js on lines 5..15
    examples/motor/fluent-motor.js on lines 5..21
    examples/temperature_sensor/fluent-temperature-sensor.js on lines 6..23

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

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

    Cylon.robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("led", { driver: "led", pin: 13 })
      .device("button", { driver: "button", pin: 2 })
    Severity: Major
    Found in examples/button/fluent-button.js and 5 other locations - About 55 mins to fix
    examples/blink/fluent-blink.js on lines 5..13
    examples/led_brightness/fluent-led_brightness.js on lines 5..18
    examples/maxbotix/fluent-maxbotix.js on lines 5..15
    examples/motor/fluent-motor.js on lines 5..21
    examples/temperature_sensor/fluent-temperature-sensor.js on lines 6..23

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

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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("motor", { driver: "motor", pin: 3 })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/motor/fluent-motor.js and 5 other locations - About 55 mins to fix
    examples/blink/fluent-blink.js on lines 5..13
    examples/button/fluent-button.js on lines 5..8
    examples/led_brightness/fluent-led_brightness.js on lines 5..18
    examples/maxbotix/fluent-maxbotix.js on lines 5..15
    examples/temperature_sensor/fluent-temperature-sensor.js on lines 6..23

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

    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 work has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      work: function(my) {
        my.bmp180.getTemperature(function(err, val) {
          if (err) {
            console.log(err);
            return;
    Severity: Minor
    Found in examples/bmp180/bmp180.js - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("mpl115a2", { driver: "mpl115a2" })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/mpl115a2/fluent-mpl115a2.js and 4 other locations - About 40 mins to fix
    examples/blinkm/fluent-blinkm.js on lines 5..28
    examples/bmp180/fluent-bmp180.js on lines 5..43
    examples/hmc6352/fluent-hmc6352.js on lines 5..15
    examples/lcd-i2c/fluent-lcd-i2c.js on lines 5..11

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

    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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("bmp180", { driver: "bmp180" })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/bmp180/fluent-bmp180.js and 4 other locations - About 40 mins to fix
    examples/blinkm/fluent-blinkm.js on lines 5..28
    examples/hmc6352/fluent-hmc6352.js on lines 5..15
    examples/lcd-i2c/fluent-lcd-i2c.js on lines 5..11
    examples/mpl115a2/fluent-mpl115a2.js on lines 5..21

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

    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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("hmc6352", { driver: "hmc6352" })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/hmc6352/fluent-hmc6352.js and 4 other locations - About 40 mins to fix
    examples/blinkm/fluent-blinkm.js on lines 5..28
    examples/bmp180/fluent-bmp180.js on lines 5..43
    examples/lcd-i2c/fluent-lcd-i2c.js on lines 5..11
    examples/mpl115a2/fluent-mpl115a2.js on lines 5..21

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

    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

    Cylon
      .robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("lcd", { driver: "lcd" })
      .on("ready", function(bot) {
    Severity: Major
    Found in examples/lcd-i2c/fluent-lcd-i2c.js and 4 other locations - About 40 mins to fix
    examples/blinkm/fluent-blinkm.js on lines 5..28
    examples/bmp180/fluent-bmp180.js on lines 5..43
    examples/hmc6352/fluent-hmc6352.js on lines 5..15
    examples/mpl115a2/fluent-mpl115a2.js on lines 5..21

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

    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

    Cylon.robot()
      .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" })
      .device("blinkm", { driver: "blinkm" })
      .on("ready", function(bot) {
        bot.blinkm.stopScript();
    Severity: Major
    Found in examples/blinkm/fluent-blinkm.js and 4 other locations - About 40 mins to fix
    examples/bmp180/fluent-bmp180.js on lines 5..43
    examples/hmc6352/fluent-hmc6352.js on lines 5..15
    examples/lcd-i2c/fluent-lcd-i2c.js on lines 5..11
    examples/mpl115a2/fluent-mpl115a2.js on lines 5..21

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

    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 sendOneWireWriteAndRead has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function(pin, device, data, numBytesToRead, callback) {
    Severity: Minor
    Found in lib/firmata.js - About 35 mins to fix

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

        this.board.digitalRead(pin, function(value) {
          this.respond("digitalRead", callback, null, value, pin);
        }.bind(this));
      Severity: Minor
      Found in lib/firmata.js and 1 other location - About 30 mins to fix
      lib/firmata.js on lines 101..103

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 45.

      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