betajs/betajs-media-components

View on GitHub
src/dynamics/image_capture/capture/capture.js

Summary

Maintainability
F
6 days
Test Coverage

File capture.js has 524 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:ImageCapture.Dynamics.Recorder", [
    "dynamics:Dynamic",
    "module:Assets",
    "browser:Info",
    "browser:Dom",
Severity: Major
Found in src/dynamics/image_capture/capture/capture.js - About 1 day to fix

    Function create has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    create: function() {
                        if (this.get("theme")) this.set("theme", this.get("theme").toLowerCase());
                        if (this.get("theme") in Assets.recorderthemes) {
                            Objs.iter(Assets.recorderthemes[this.get("theme")], function(value, key) {
                                if (!this.isArgumentAttr(key))
    Severity: Minor
    Found in src/dynamics/image_capture/capture/capture.js - About 1 hr to fix

      Function _timerFire has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      _timerFire: function() {
                          if (this.destroyed())
                              return;
                          this.set("currentorientation", window.innerHeight > window.innerWidth ? "portrait" : "landscape");
                          try {
      Severity: Minor
      Found in src/dynamics/image_capture/capture/capture.js - About 1 hr to fix

        Function _bindMedia has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        _bindMedia: function() {
                            if (this._bound || !this.recorderAttached() || !this.recorder)
                                return;
                            this.recorder.ready.success(function() {
                                this.recorder.on("require_display", function() {
        Severity: Minor
        Found in src/dynamics/image_capture/capture/capture.js - About 1 hr to fix

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

                              try {
                                  if (this.recorderAttached() && this._timer.fire_count() % 20 === 0 && this._accessing_camera) {
                                      var signal = this.blankLevel() >= 0.01;
                                      if (signal !== this.__cameraSignal) {
                                          this.__cameraSignal = signal;
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 day to fix
          src/dynamics/video_recorder/recorder/recorder.js on lines 1240..1256

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

          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

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

                          _updateStretch: function() {
                              var newStretch = null;
                              if (this.get("stretch")) {
                                  var ar = this.aspectRatio();
                                  if (isFinite(ar)) {
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 day to fix
          src/dynamics/image_viewer/viewer/image_viewer.js on lines 492..514

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

          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

                                      this.recorder.enumerateDevices().success(function(devices) {
                                          var selected = this.recorder.currentDevices();
                                          this.set("selectedcamera", selected.video);
                                          this.set("cameras", new Collection(Objs.values(devices.video)));
                                      }, this);
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 2 hrs to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 383..387

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

                              if (this.get("theme") in Assets.recorderthemes) {
                                  Objs.iter(Assets.recorderthemes[this.get("theme")], function(value, key) {
                                      if (!this.isArgumentAttr(key))
                                          this.set(key, value);
                                  }, this);
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 5 other locations - About 2 hrs to fix
          src/dynamics/audio_player/player/player.js on lines 180..185
          src/dynamics/audio_recorder/recorder/recorder.js on lines 200..205
          src/dynamics/image_viewer/viewer/image_viewer.js on lines 117..122
          src/dynamics/video_player/player/player.js on lines 1033..1038
          src/dynamics/video_recorder/recorder/recorder.js on lines 372..377

          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

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

                                  this.recorder.bindMedia().error(function(e) {
                                      this.trigger("access_forbidden", e);
                                      this.set("hideoverlay", false);
                                      this.off("require_display", null, this);
                                      this._error("bind", e);
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 2 other locations - About 2 hrs to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 339..392
          src/dynamics/video_recorder/recorder/recorder.js on lines 628..666

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

          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

                          _updateCSSSize: function() {
                              var width = Dom.elementDimensions(this.activeElement()).width;
                              this.set("csssize", width > 400 ? "normal" : (width > 300 ? "medium" : "small"));
                          },
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 3 other locations - About 1 hr to fix
          src/dynamics/audio_player/player/player.js on lines 653..656
          src/dynamics/audio_recorder/recorder/recorder.js on lines 634..637
          src/dynamics/image_viewer/viewer/image_viewer.js on lines 445..448

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

          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

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

                          _afterActivate: function(element) {
                              inherited._afterActivate.call(this, element);
                              this.__activated = true;
                              if (this.__attachRequested)
                                  this._attachRecorder();
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 hr to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 472..478

          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

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

                              "change:webrtconmobile": function() {
                                  this.set("recordviafilecapture", Info.isMobile() && (!this.get("webrtconmobile") || !ImageRecorderWrapper.anySupport(this._imageCaptureWrapperOptions())));
                              },
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 2 other locations - About 1 hr to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 181..183
          src/dynamics/video_recorder/recorder/recorder.js on lines 346..348

          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

                          destroy: function() {
                              this._timer.destroy();
                              this.host.destroy();
                              this._detachRecorder();
                              inherited.destroy.call(this);
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 3 other locations - About 1 hr to fix
          src/dynamics/audio_player/player/player.js on lines 618..623
          src/dynamics/audio_recorder/recorder/recorder.js on lines 608..613
          src/dynamics/video_recorder/recorder/recorder.js on lines 1135..1140

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

          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

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

                          _error: function(error_type, error_code) {
                              this.__error = {
                                  error_type: error_type,
                                  error_code: error_code
                              };
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 4 other locations - About 1 hr to fix
          src/dynamics/audio_player/player/player.js on lines 251..258
          src/dynamics/audio_recorder/recorder/recorder.js on lines 264..271
          src/dynamics/video_player/player/player.js on lines 1370..1377
          src/dynamics/video_recorder/recorder/recorder.js on lines 510..517

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

          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

                              "nativeRecordingWidth:recordingwidth,record_media": function() {
                                  return this.get("recordingwidth") || (this.get("record_media") !== "screen" ? 640 : (window.innerWidth || document.body.clientWidth));
                              },
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 hr to fix
          src/dynamics/image_capture/capture/capture.js on lines 126..128

          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

                              "nativeRecordingHeight:recordingheight,record_media": function() {
                                  return this.get("recordingheight") || (this.get("record_media") !== "screen" ? 480 : (window.innerHeight || document.body.clientHeight));
                              },
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 hr to fix
          src/dynamics/image_capture/capture/capture.js on lines 123..125

          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

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

                          _softwareDependencies: function() {
                              if (!this.recorderAttached() || !this.recorder)
                                  return Promise.error("No recorder attached.");
                              return this.recorder.softwareDependencies();
                          },
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 2 other locations - About 1 hr to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 326..330
          src/dynamics/video_recorder/recorder/recorder.js on lines 614..618

          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

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

                          _detachRecorder: function() {
                              if (this.recorder)
                                  this.recorder.weakDestroy();
                              this.recorder = null;
                              this.set("hasrecorder", false);
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 1 other location - About 1 hr to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 277..282

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

          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

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

                              if (this.get("recordviafilecapture")) {
                                  this.set("skipinitial", false);
                                  this.set("skipinitialonrerecord", false);
                                  this.set("autorecord", false);
                              }
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 2 other locations - About 50 mins to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 185..189
          src/dynamics/audio_recorder/recorder/recorder.js on lines 211..215

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

          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

          Identical blocks of code found in 3 locations. Consider refactoring.
          Open

                          _unbindMedia: function() {
                              if (!this._bound)
                                  return;
                              this.recorder.unbindMedia();
                              this._bound = false;
          Severity: Minor
          Found in src/dynamics/image_capture/capture/capture.js and 2 other locations - About 35 mins to fix
          src/dynamics/audio_recorder/recorder/recorder.js on lines 414..419
          src/dynamics/video_recorder/recorder/recorder.js on lines 705..710

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

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

                              manual_submit: function() {
                                  this.set("rerecordable", false);
                                  this.set("manualsubmit", false);
                                  this.trigger("manually_submitted");
                              },
          Severity: Major
          Found in src/dynamics/image_capture/capture/capture.js and 6 other locations - About 30 mins to fix
          src/dynamics/audio_player/controlbar/controlbar.js on lines 174..178
          src/dynamics/audio_recorder/recorder/recorder.js on lines 587..591
          src/dynamics/image_viewer/controlbar/controlbar.js on lines 37..41
          src/dynamics/video_player/controlbar/controlbar.js on lines 286..290
          src/dynamics/video_player/playbutton/playbutton.js on lines 35..39
          src/dynamics/video_recorder/recorder/recorder.js on lines 1114..1118

          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

          There are no issues that match your filters.

          Category
          Status