hybridgroup/node-bebop

View on GitHub
lib/bebop.js

Summary

Maintainability
F
1 wk
Test Coverage

File bebop.js has 564 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

var EventEmitter = require("events").EventEmitter,
    dgram = require("dgram"),
    util = require("util"),
Severity: Major
Found in lib/bebop.js - About 1 day to fix

    Function _packetReceiver has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

    Bebop.prototype._packetReceiver = function(message) {
      var networkFrame = networkFrameParser(message);
    
      //
      // libARNetwork/Sources/ARNETWORK_Receiver.c#ARNETWORK_Receiver_ThreadRun
    Severity: Minor
    Found in lib/bebop.js - About 7 hrs 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

    Function _packetReceiver has 110 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Bebop.prototype._packetReceiver = function(message) {
      var networkFrame = networkFrameParser(message);
    
      //
      // libARNetwork/Sources/ARNETWORK_Receiver.c#ARNETWORK_Receiver_ThreadRun
    Severity: Major
    Found in lib/bebop.js - About 4 hrs to fix

      Function _createARStreamACK has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      Bebop.prototype._createARStreamACK = function(arstreamFrame) {
        //
        // ARSTREAM_NetworkHeaders_AckPacket_t;
        //
        // uint16_t frameNumber;    // id of the current frame
      Severity: Minor
      Found in lib/bebop.js - About 3 hrs 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

      Function exports has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Bebop = module.exports = function(opts) {
        opts = opts || {};
        this.navData = {};
        this.ip = opts.ip || "192.168.42.1";
        this.c2dPort = opts.c2dPort || 54321;
      Severity: Major
      Found in lib/bebop.js - About 2 hrs to fix

        Function _createARStreamACK has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Bebop.prototype._createARStreamACK = function(arstreamFrame) {
          //
          // ARSTREAM_NetworkHeaders_AckPacket_t;
          //
          // uint16_t frameNumber;    // id of the current frame
        Severity: Minor
        Found in lib/bebop.js - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                          switch (networkFrame.data.readInt32LE(4)) {
                            case constants.ARCOMMANDS_ARDRONE3_PILOTINGSTATE_FLYINGSTATECHANGED_STATE_LANDED:
                              this.navData.flyingState = { landed: true };
                              this.emit("landed");
                              break;
          Severity: Major
          Found in lib/bebop.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        if (types.hasOwnProperty(arg.type)) {
                          args[arg.name] = types[arg.type]
                            .read(networkFrame.data, offset, arg);
            
                          offset += types[arg.type].length;
            Severity: Major
            Found in lib/bebop.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                      else if (event.arg instanceof Object) {
                        if (types.hasOwnProperty(event.arg.type)) {
                          args[event.arg.name] = types[event.arg.type]
                            .read(networkFrame.data, offset, event.arg);
                        }
              Severity: Major
              Found in lib/bebop.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if (!Buffer.isBuffer(this._arstreamFrame.fragments[i])) {
                            skip = true;
                            break;
                          }
                Severity: Major
                Found in lib/bebop.js - About 45 mins to fix

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

                  Bebop.prototype.land = function(callback) {
                    //
                    // ARCOMMANDS_Generator_GenerateARDrone3PilotingLanding
                    //
                  
                  
                  Severity: Major
                  Found in lib/bebop.js and 1 other location - About 4 hrs to fix
                  lib/bebop.js on lines 520..534

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

                  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

                  Bebop.prototype.takeOff = function(callback) {
                    //
                    //  ARCOMMANDS_Generator_GenerateARDrone3PilotingTakeOff
                    //
                  
                  
                  Severity: Major
                  Found in lib/bebop.js and 1 other location - About 4 hrs to fix
                  lib/bebop.js on lines 536..550

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

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

                  Bebop.prototype.generateAllStates = function() {
                    //
                    // ARCOMMANDS_Generator_GenerateCommonCommonAllStates
                    //
                  
                  
                  Severity: Major
                  Found in lib/bebop.js and 2 other locations - About 3 hrs to fix
                  lib/bebop.js on lines 552..565
                  lib/bebop.js on lines 586..599

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

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

                  Bebop.prototype.emergency = function() {
                    //
                    // ARCOMMANDS_Generator_GenerateARDrone3PilotingEmergency
                    //
                  
                  
                  Severity: Major
                  Found in lib/bebop.js and 2 other locations - About 3 hrs to fix
                  lib/bebop.js on lines 567..580
                  lib/bebop.js on lines 586..599

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

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

                  Bebop.prototype.flatTrim = function() {
                    //
                    // ARCOMMANDS_Generator_GenerateARDrone3PilotingFlatTrim
                    //
                  
                  
                  Severity: Major
                  Found in lib/bebop.js and 2 other locations - About 3 hrs to fix
                  lib/bebop.js on lines 552..565
                  lib/bebop.js on lines 567..580

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

                  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

                  Bebop.prototype.startRecording = function(opts) {
                    opts = opts || {};
                    opts.recordState = constants.ARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD_START;
                  
                    var buf = this._videoRecord(opts);
                  Severity: Major
                  Found in lib/bebop.js and 1 other location - About 2 hrs to fix
                  lib/bebop.js on lines 630..638

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

                  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

                  Bebop.prototype.stopRecording = function(opts) {
                    opts = opts || {};
                    opts.recordState = constants.ARCOMMANDS_ARDRONE3_MEDIARECORD_VIDEO_RECORD_STOP;
                  
                    var buf = this._videoRecord(opts);
                  Severity: Major
                  Found in lib/bebop.js and 1 other location - About 2 hrs to fix
                  lib/bebop.js on lines 620..628

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

                  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

                  Bebop.prototype.backward = function(val) {
                    this._pcmd.pitch = validatePitch(val) * -1;
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 422..426
                  lib/bebop.js on lines 454..458
                  lib/bebop.js on lines 466..470

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

                  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

                  Bebop.prototype.down = function(val) {
                    this._pcmd.gaz = validatePitch(val) * -1;
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 442..446
                  lib/bebop.js on lines 454..458
                  lib/bebop.js on lines 466..470

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

                  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

                  Bebop.prototype.left = function(val) {
                    this._pcmd.roll = validatePitch(val) * -1;
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 422..426
                  lib/bebop.js on lines 442..446
                  lib/bebop.js on lines 466..470

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

                  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

                  Bebop.prototype.counterClockwise = function(val) {
                    this._pcmd.yaw = validatePitch(val) * -1;
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 422..426
                  lib/bebop.js on lines 442..446
                  lib/bebop.js on lines 454..458

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

                  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

                    var frame = {
                      type: buf.readUInt8(0),
                      id: buf.readUInt8(1),
                      seq: buf.readUInt8(2),
                      size: buf.readUInt32LE(3)
                  Severity: Major
                  Found in lib/bebop.js and 1 other location - About 1 hr to fix
                  lib/bebop.js on lines 125..130

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

                  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

                    var frame = {
                      frameNumber: buf.readUInt16LE(0),
                      frameFlags: buf.readUInt8(2),
                      fragmentNumber: buf.readUInt8(3),
                      fragmentsPerFrame: buf.readUInt8(4),
                  Severity: Major
                  Found in lib/bebop.js and 1 other location - About 1 hr to fix
                  lib/bebop.js on lines 89..94

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

                  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

                  Bebop.prototype.up = function(val) {
                    this._pcmd.gaz = validatePitch(val);
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 432..436
                  lib/bebop.js on lines 448..452
                  lib/bebop.js on lines 460..464

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

                  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

                  Bebop.prototype.right = function(val) {
                    this._pcmd.roll = validatePitch(val);
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 416..420
                  lib/bebop.js on lines 432..436
                  lib/bebop.js on lines 460..464

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

                  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

                  Bebop.prototype.forward = function(val) {
                    this._pcmd.pitch = validatePitch(val);
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 416..420
                  lib/bebop.js on lines 448..452
                  lib/bebop.js on lines 460..464

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

                  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

                  Bebop.prototype.clockwise = function(val) {
                    this._pcmd.yaw = validatePitch(val);
                    this._pcmd.flag = 1;
                    return this;
                  };
                  Severity: Major
                  Found in lib/bebop.js and 3 other locations - About 1 hr to fix
                  lib/bebop.js on lines 416..420
                  lib/bebop.js on lines 432..436
                  lib/bebop.js on lines 448..452

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

                  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