hybridgroup/node-bebop

View on GitHub
lib/MediaStreaming.js

Summary

Maintainability
A
1 hr
Test Coverage

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

MediaStreaming.prototype.videoEnable = function(enable) {

  var buffer = commandToBuffer(1, "MediaStreaming", "VideoEnable", enable);

  this.self._writePacket(this.self._networkFrameGenerator(buffer));
Severity: Major
Found in lib/MediaStreaming.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/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/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

There are no issues that match your filters.

Category
Status