betajs/betajs-media-components

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

Summary

Maintainability
F
2 wks
Test Coverage

File states.js has 571 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:ImageCapture.Dynamics.RecorderStates.State", [
    "base:States.State",
    "base:Events.ListenMixin",
    "base:Objs"
], function(State, ListenMixin, Objs, scoped) {
Severity: Major
Found in src/dynamics/image_capture/capture/states.js - About 1 day to fix

    Consider simplifying this complex logical expression.
    Open

                        if ((data.width && this.dyn.get("minuploadingwidth") && this.dyn.get("minuploadingwidth") > data.width) ||
                            (data.width && this.dyn.get("maxuploadingwidth") && this.dyn.get("maxuploadingwidth") < data.width) ||
                            (data.height && this.dyn.get("minuploadingheight") && this.dyn.get("minuploadingheight") > data.height) ||
                            (data.height && this.dyn.get("maxuploadingheight") && this.dyn.get("maxuploadingheight") < data.height)) {
                            this.next("FatalError", {
    Severity: Critical
    Found in src/dynamics/image_capture/capture/states.js - About 2 hrs to fix

      Function _started has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _started: function() {
                  this.dyn.set("cancancel", true);
                  this.dyn.set("skipinitial", this.dyn.get("skipinitial") || this.dyn.get("skipinitialonrerecord"));
                  this.dyn.set("settingsvisible", false);
                  this.dyn.set("recordvisible", false);
      Severity: Major
      Found in src/dynamics/image_capture/capture/states.js - About 2 hrs to fix

        Function selectUpload has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                selectUpload: function(file) {
                    if (!(Info.isMobile() && Info.isAndroid() && Info.isCordova())) {
                        if (this.dyn.get("allowedextensions")) {
                            var filename = (file.files[0].name || "").toLowerCase();
                            var found = false;
        Severity: Major
        Found in src/dynamics/image_capture/capture/states.js - About 2 hrs to fix

          Function _started has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _started: function() {
                      this.dyn.set("message", "");
                      this.dyn.set("loaderlabel", "");
                      var startedRecording = false;
                      this.dyn._accessing_camera = true;
          Severity: Minor
          Found in src/dynamics/image_capture/capture/states.js - About 1 hr to fix

            Function _started has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _started: function() {
                        this.dyn.set("settingsvisible", true);
                        this.dyn.set("recordvisible", true);
                        this.dyn.set("rerecordvisible", false);
                        this.dyn.set("controlbarlabel", "");
            Severity: Minor
            Found in src/dynamics/image_capture/capture/states.js - About 1 hr to fix

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

                      _started: function() {
                          this.dyn.set("loadlabel", "");
                          this.dyn.trigger("verifying");
                          this.dyn.set("message", this.dyn.string("verifying") + "...");
                          this.dyn.set("playertopmessage", this.dyn.get("message"));
              Severity: Minor
              Found in src/dynamics/image_capture/capture/states.js - About 1 hr to fix

                Function _started has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _started: function() {
                            this.dyn.set("settingsvisible", false);
                            this.dyn.set("recordvisible", false);
                            this.dyn.set("rerecordvisible", false);
                            this.dyn.set("stopvisible", false);
                Severity: Minor
                Found in src/dynamics/image_capture/capture/states.js - About 1 hr to fix

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

                              if (!(Info.isMobile() && Info.isAndroid() && Info.isCordova())) {
                                  if (this.dyn.get("allowedextensions")) {
                                      var filename = (file.files[0].name || "").toLowerCase();
                                      var found = false;
                                      this.dyn.get("allowedextensions").forEach(function(extension) {
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 2 days to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 165..196

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

                  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

                  Scoped.define("module:ImageCapture.Dynamics.RecorderStates.Initial", [
                      "module:ImageCapture.Dynamics.RecorderStates.State"
                  ], function(State, scoped) {
                      return State.extend({
                          scoped: scoped
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 1 day to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 81..114

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

                  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

                  Scoped.define("module:ImageCapture.Dynamics.RecorderStates.RequiredSoftwareWait", [
                      "module:ImageCapture.Dynamics.RecorderStates.State",
                      "base:Promise",
                      "browser:Dom"
                  ], function(State, Promise, Dom, scoped) {
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 1 day to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 306..340

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

                  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

                                      if ((data.width && this.dyn.get("minuploadingwidth") && this.dyn.get("minuploadingwidth") > data.width) ||
                                          (data.width && this.dyn.get("maxuploadingwidth") && this.dyn.get("maxuploadingwidth") < data.width) ||
                                          (data.height && this.dyn.get("minuploadingheight") && this.dyn.get("minuploadingheight") > data.height) ||
                                          (data.height && this.dyn.get("maxuploadingheight") && this.dyn.get("maxuploadingheight") < data.height)) {
                                          this.next("FatalError", {
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 1 day to fix
                  src/dynamics/video_recorder/recorder/states.js on lines 354..363

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

                  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

                              if (this.dyn.get("localplayback") && this.dyn.isFormatSupported()) {
                                  if (this.dyn.recorder && this.dyn.recorder.supportsLocalPlayback())
                                      this.dyn.set("playbacksource", this.dyn.recorder.localPlaybackSource());
                                  else
                                      this.dyn.set("playbacksource", (window.URL || window.webkitURL).createObjectURL(this.dyn._imageFile));
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 7 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 669..677

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

                  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

                  Scoped.define("module:ImageCapture.Dynamics.RecorderStates.FatalError", [
                      "module:ImageCapture.Dynamics.RecorderStates.State",
                      "browser:Info",
                      "base:Timers.Timer"
                  ], function(State, Info, Timer, scoped) {
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 7 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 56..78

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

                  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

                              if (this.dyn) {
                                  this.dyn.on("message-link-click", function(link) {
                                      link.execute();
                                      this.next("RequiredSoftwareWait");
                                  }, this);
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 7 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 286..299
                  src/dynamics/video_recorder/recorder/states.js on lines 642..655

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

                  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.listenOn(uploader, "error", function(e) {
                                  var bestError = this.dyn.string("uploading-failed");
                                  try {
                                      e.forEach(function(ee) {
                                          for (var key in ee)
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 7 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 644..658
                  src/dynamics/video_recorder/recorder/states.js on lines 1415..1429

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

                  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

                              this.listenOn(uploader, "progress", function(uploaded, total) {
                                  this.dyn.trigger("upload_progress", uploaded, total);
                                  if (total !== 0 && total > 0 && uploaded >= 0) {
                                      var up = Math.min(100, Math.round(uploaded / total * 100));
                                      if (!isNaN(up)) {
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 7 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 659..668
                  src/dynamics/video_recorder/recorder/states.js on lines 1430..1439

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

                  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

                          _started: function() {
                              this.listenOn(this.dyn, "change:orientation change:currentorientation", function() {
                                  var orientation = this.dyn.get("orientation");
                                  var currentorientation = this.dyn.get("currentorientation");
                                  var result = orientation && orientation !== currentorientation;
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 6 hrs to fix
                  src/dynamics/video_recorder/recorder/states.js on lines 234..246

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

                  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

                  Scoped.define("module:ImageCapture.Dynamics.RecorderStates.Player", [
                      "module:ImageCapture.Dynamics.RecorderStates.State"
                  ], function(State, scoped) {
                      return State.extend({
                          scoped: scoped
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 5 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 117..139

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

                  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.dyn.get("localplayback") && this.dyn.isFormatSupported()) {
                                  this.dyn.set("loader_active", false);
                                  this.dyn.set("message_active", false);
                              } else {
                                  this.dyn.set("rerecordvisible", this.dyn.get("early-rerecord"));
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 4 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 714..721
                  src/dynamics/video_recorder/recorder/states.js on lines 1509..1516

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

                  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

                                  var timer = this.auto_destroy(new Timer({
                                      start: true,
                                      delay: 100,
                                      context: this,
                                      fire: function() {
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 3 hrs to fix
                  src/dynamics/video_recorder/recorder/states.js on lines 736..746

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

                  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

                              if (this.dyn.get("countdown") > 0 && this.dyn.recorder && this.dyn.recorder.recordDelay(this.dyn.get("uploadoptions")) > this.dyn.get("countdown") * 1000)
                                  this._preparePromise = this.dyn._prepareRecording();
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 3 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 396..397

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

                  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

                              Objs.iter(Objs.extend({
                                  "message": false,
                                  "chooser": false,
                                  "topmessage": false,
                                  "controlbar": false,
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 2 hrs to fix
                  src/dynamics/video_player/player/states.js on lines 14..22

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 87.

                  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

                              this.dyn._verifyRecording().success(function() {
                                  this.dyn.trigger("verified");
                                  this.dyn._detachRecorder();
                                  if (this.dyn.get("recordings"))
                                      this.dyn.set("recordings", this.dyn.get("recordings") - 1);
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 2 hrs to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 722..736

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

                  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.listenOn(uploader, "success", function() {
                                  Async.eventually(function() {
                                      if (this.destroyed())
                                          return;
                                      this._finished();
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 636..643
                  src/dynamics/video_recorder/recorder/states.js on lines 1407..1414

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

                          rerecord: function() {
                              this.dyn._detachRecorder();
                              this.dyn.trigger("rerecord");
                              this.dyn.set("recordermode", true);
                              this.next("Initial");
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 3 other locations - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 683..688
                  src/dynamics/audio_recorder/recorder/states.js on lines 739..744
                  src/dynamics/image_capture/capture/states.js on lines 587..592

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 66.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                          rerecord: function() {
                              this.dyn._detachRecorder();
                              this.dyn.trigger("rerecord");
                              this.dyn.set("recordermode", true);
                              this.next("Initial");
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 3 other locations - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 683..688
                  src/dynamics/audio_recorder/recorder/states.js on lines 739..744
                  src/dynamics/image_capture/capture/states.js on lines 644..649

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 66.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                          _finished: function() {
                              this.dyn.set("cancancel", false);
                              this.dyn.trigger("uploaded");
                              this.dyn.set("end-upload-time", Time.now());
                          }
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 690..694
                  src/dynamics/video_recorder/recorder/states.js on lines 1485..1489

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

                              try {
                                  this.dyn._imageFileName = file.files[0].name;
                                  this.dyn._imageFile = file.files[0];
                              } catch (e) {}
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 229..232
                  src/dynamics/video_recorder/recorder/states.js on lines 393..396

                  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

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

                              this.listenOn(this.dyn, "error", function(s) {
                                  this.next("FatalError", {
                                      message: this.dyn.string("attach-error"),
                                      retry: "Initial"
                                  });
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 5 other locations - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 279..284
                  src/dynamics/audio_recorder/recorder/states.js on lines 365..370
                  src/dynamics/image_capture/capture/states.js on lines 261..266
                  src/dynamics/video_recorder/recorder/states.js on lines 635..640
                  src/dynamics/video_recorder/recorder/states.js on lines 748..753

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

                              this.listenOn(this.dyn, "error", function(s) {
                                  this.next("FatalError", {
                                      message: this.dyn.string("attach-error"),
                                      retry: "Initial"
                                  });
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 5 other locations - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 279..284
                  src/dynamics/audio_recorder/recorder/states.js on lines 365..370
                  src/dynamics/image_capture/capture/states.js on lines 356..361
                  src/dynamics/video_recorder/recorder/states.js on lines 635..640
                  src/dynamics/video_recorder/recorder/states.js on lines 748..753

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

                              this.listenOn(this.dyn, "access_forbidden", function() {
                                  this.next("FatalError", {
                                      message: this.dyn.string("access-forbidden"),
                                      retry: "Initial"
                                  });
                  Severity: Major
                  Found in src/dynamics/image_capture/capture/states.js and 1 other location - About 1 hr to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 371..376

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

                                  if (this.dyn.get("recordings"))
                                      this.dyn.set("recordings", this.dyn.get("recordings") - 1);
                  Severity: Minor
                  Found in src/dynamics/image_capture/capture/states.js and 2 other locations - About 40 mins to fix
                  src/dynamics/audio_recorder/recorder/states.js on lines 725..726
                  src/dynamics/video_recorder/recorder/states.js on lines 1521..1522

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 48.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status