hybridgroup/node-bebop

View on GitHub
lib/GPSSettings.js

Summary

Maintainability
C
7 hrs
Test Coverage

Function sendControllerGPS has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

GPSSettings.prototype.sendControllerGPS = function(latitude, longitude,
                                                   altitude, horizontalAccuracy,
                                                   verticalAccuracy) {
Severity: Minor
Found in lib/GPSSettings.js - About 35 mins to fix

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

    GPSSettings.prototype.setHome = function(latitude, longitude, altitude) {
    
      var buffer = commandToBuffer(1, "GPSSettings", "SetHome", latitude, longitude, altitude);
    
      this.self._writePacket(this.self._networkFrameGenerator(buffer));
    Severity: Major
    Found in lib/GPSSettings.js and 1 other location - About 1 hr to fix
    lib/NetworkSettings.js on lines 11..18

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

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

    GPSSettings.prototype.homeType = function(type) {
    
      var buffer = commandToBuffer(1, "GPSSettings", "HomeType", type);
    
      this.self._writePacket(this.self._networkFrameGenerator(buffer));
    Severity: Major
    Found in lib/GPSSettings.js and 63 other locations - About 1 hr to fix
    lib/ARLibsVersionsState.js on lines 11..17
    lib/ARLibsVersionsState.js on lines 19..25
    lib/ARLibsVersionsState.js on lines 27..33
    lib/Accessory.js on lines 11..17
    lib/AccessoryState.js on lines 11..17
    lib/Animations.js on lines 11..17
    lib/Animations.js on lines 19..25
    lib/AnimationsState.js on lines 11..17
    lib/Antiflickering.js on lines 11..17
    lib/Antiflickering.js on lines 19..25
    lib/Audio.js on lines 11..17
    lib/AudioState.js on lines 11..17
    lib/Calibration.js on lines 11..17
    lib/CalibrationState.js on lines 11..17
    lib/Charger.js on lines 11..17
    lib/ChargerState.js on lines 11..17
    lib/Common.js on lines 19..25
    lib/Common.js on lines 27..33
    lib/CommonState.js on lines 11..17
    lib/CommonState.js on lines 19..25
    lib/GPSSettings.js on lines 47..53
    lib/MediaRecord.js on lines 11..17
    lib/MediaRecord.js on lines 19..25
    lib/MediaRecord.js on lines 35..41
    lib/MediaStreaming.js on lines 11..17
    lib/NetworkEvent.js on lines 11..17
    lib/PROState.js on lines 11..17
    lib/PictureSettings.js on lines 11..17
    lib/PictureSettings.js on lines 19..25
    lib/PictureSettings.js on lines 27..33
    lib/PictureSettings.js on lines 35..41
    lib/PictureSettings.js on lines 62..69
    lib/Piloting.js on lines 53..59
    lib/Piloting.js on lines 61..67
    lib/Piloting.js on lines 77..83
    lib/Piloting.js on lines 85..91
    lib/PilotingEvent.js on lines 11..17
    lib/PilotingSettings.js on lines 11..17
    lib/PilotingSettings.js on lines 19..25
    lib/PilotingSettings.js on lines 27..33
    lib/PilotingSettings.js on lines 35..41
    lib/PilotingSettings.js on lines 43..49
    lib/PilotingSettings.js on lines 51..57
    lib/PilotingSettings.js on lines 59..65
    lib/PilotingSettings.js on lines 67..73
    lib/PilotingSettings.js on lines 75..81
    lib/PilotingSettings.js on lines 83..89
    lib/PilotingSettings.js on lines 91..97
    lib/PilotingSettings.js on lines 99..105
    lib/PilotingSettings.js on lines 107..113
    lib/PilotingSettings.js on lines 115..121
    lib/PilotingSettings.js on lines 123..129
    lib/PilotingSettings.js on lines 131..137
    lib/PilotingSettings.js on lines 139..145
    lib/Settings.js on lines 27..33
    lib/Settings.js on lines 35..41
    lib/Settings.js on lines 43..49
    lib/SettingsState.js on lines 11..17
    lib/SpeedSettings.js on lines 11..17
    lib/SpeedSettings.js on lines 19..25
    lib/SpeedSettings.js on lines 27..33
    lib/SpeedSettings.js on lines 35..41
    lib/WifiSettings.js on lines 11..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 69.

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

    GPSSettings.prototype.returnHomeDelay = function(delay) {
    
      var buffer = commandToBuffer(1, "GPSSettings", "ReturnHomeDelay", delay);
    
      this.self._writePacket(this.self._networkFrameGenerator(buffer));
    Severity: Major
    Found in lib/GPSSettings.js and 63 other locations - About 1 hr to fix
    lib/ARLibsVersionsState.js on lines 11..17
    lib/ARLibsVersionsState.js on lines 19..25
    lib/ARLibsVersionsState.js on lines 27..33
    lib/Accessory.js on lines 11..17
    lib/AccessoryState.js on lines 11..17
    lib/Animations.js on lines 11..17
    lib/Animations.js on lines 19..25
    lib/AnimationsState.js on lines 11..17
    lib/Antiflickering.js on lines 11..17
    lib/Antiflickering.js on lines 19..25
    lib/Audio.js on lines 11..17
    lib/AudioState.js on lines 11..17
    lib/Calibration.js on lines 11..17
    lib/CalibrationState.js on lines 11..17
    lib/Charger.js on lines 11..17
    lib/ChargerState.js on lines 11..17
    lib/Common.js on lines 19..25
    lib/Common.js on lines 27..33
    lib/CommonState.js on lines 11..17
    lib/CommonState.js on lines 19..25
    lib/GPSSettings.js on lines 39..45
    lib/MediaRecord.js on lines 11..17
    lib/MediaRecord.js on lines 19..25
    lib/MediaRecord.js on lines 35..41
    lib/MediaStreaming.js on lines 11..17
    lib/NetworkEvent.js on lines 11..17
    lib/PROState.js on lines 11..17
    lib/PictureSettings.js on lines 11..17
    lib/PictureSettings.js on lines 19..25
    lib/PictureSettings.js on lines 27..33
    lib/PictureSettings.js on lines 35..41
    lib/PictureSettings.js on lines 62..69
    lib/Piloting.js on lines 53..59
    lib/Piloting.js on lines 61..67
    lib/Piloting.js on lines 77..83
    lib/Piloting.js on lines 85..91
    lib/PilotingEvent.js on lines 11..17
    lib/PilotingSettings.js on lines 11..17
    lib/PilotingSettings.js on lines 19..25
    lib/PilotingSettings.js on lines 27..33
    lib/PilotingSettings.js on lines 35..41
    lib/PilotingSettings.js on lines 43..49
    lib/PilotingSettings.js on lines 51..57
    lib/PilotingSettings.js on lines 59..65
    lib/PilotingSettings.js on lines 67..73
    lib/PilotingSettings.js on lines 75..81
    lib/PilotingSettings.js on lines 83..89
    lib/PilotingSettings.js on lines 91..97
    lib/PilotingSettings.js on lines 99..105
    lib/PilotingSettings.js on lines 107..113
    lib/PilotingSettings.js on lines 115..121
    lib/PilotingSettings.js on lines 123..129
    lib/PilotingSettings.js on lines 131..137
    lib/PilotingSettings.js on lines 139..145
    lib/Settings.js on lines 27..33
    lib/Settings.js on lines 35..41
    lib/Settings.js on lines 43..49
    lib/SettingsState.js on lines 11..17
    lib/SpeedSettings.js on lines 11..17
    lib/SpeedSettings.js on lines 19..25
    lib/SpeedSettings.js on lines 27..33
    lib/SpeedSettings.js on lines 35..41
    lib/WifiSettings.js on lines 11..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 69.

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

    GPSSettings.prototype.resetHome = function() {
    
      var buffer = commandToBuffer(1, "GPSSettings", "ResetHome");
    
      this.self._writePacket(this.self._networkFrameGenerator(buffer));
    Severity: Major
    Found in lib/GPSSettings.js and 18 other locations - About 1 hr to fix
    lib/Animations.js on lines 27..33
    lib/Common.js on lines 11..17
    lib/Common.js on lines 35..41
    lib/FlightPlanEvent.js on lines 11..17
    lib/FlightPlanEvent.js on lines 19..25
    lib/Mavlink.js on lines 19..24
    lib/Mavlink.js on lines 26..31
    lib/MediaRecord.js on lines 27..33
    lib/Network.js on lines 11..17
    lib/Network.js on lines 19..25
    lib/OverHeat.js on lines 11..17
    lib/OverHeat.js on lines 19..25
    lib/Piloting.js on lines 11..17
    lib/Piloting.js on lines 19..25
    lib/Piloting.js on lines 37..43
    lib/Piloting.js on lines 45..51
    lib/Settings.js on lines 11..17
    lib/Settings.js on lines 19..25

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

    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