betajs/betajs-media-components

View on GitHub
src/dynamics/audio_recorder/recorder/states.js

Summary

Maintainability
F
3 wks
Test Coverage

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

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

    Function _started has 64 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/audio_recorder/recorder/states.js - About 2 hrs to fix

      Function selectUpload has 59 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/audio_recorder/recorder/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_microphone = true;
        Severity: Minor
        Found in src/dynamics/audio_recorder/recorder/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("settingsvisible", false);
                      this.dyn.set("recordvisible", false);
                      this.dyn.set("rerecordvisible", false);
                      this.dyn.set("stopvisible", false);
          Severity: Minor
          Found in src/dynamics/audio_recorder/recorder/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("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/audio_recorder/recorder/states.js - About 1 hr to fix

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

                      stop: function() {
                          var minlimit = this.dyn.get("timeminlimit");
                          if (minlimit) {
                              var delta = (Time.now() - this._startTime - this.__pauseDelta) / 1000;
                              if (delta < minlimit) {
              Severity: Minor
              Found in src/dynamics/audio_recorder/recorder/states.js - About 1 hr to fix

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

                Scoped.define("module:AudioRecorder.Dynamics.RecorderStates.RecordPrepare", [
                    "module:AudioRecorder.Dynamics.RecorderStates.State",
                    "base:Timers.Timer",
                    "base:Time"
                ], function(State, Timer, Time, scoped) {
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 4 days to fix
                src/dynamics/video_recorder/recorder/states.js on lines 825..903

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

                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 (!(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/audio_recorder/recorder/states.js and 1 other location - About 2 days to fix
                src/dynamics/image_capture/capture/states.js on lines 169..200

                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:AudioRecorder.Dynamics.RecorderStates.Initial", [
                    "module:AudioRecorder.Dynamics.RecorderStates.State"
                ], function(State, scoped) {
                    return State.extend({
                        scoped: scoped
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 1 day to fix
                src/dynamics/image_capture/capture/states.js on lines 71..104

                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:AudioRecorder.Dynamics.RecorderStates.RequiredSoftwareWait", [
                    "module:AudioRecorder.Dynamics.RecorderStates.State",
                    "base:Promise",
                    "browser:Dom"
                ], function(State, Promise, Dom, scoped) {
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 1 day to fix
                src/dynamics/image_capture/capture/states.js on lines 288..322

                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 (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._audioFile));
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 7 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 573..581

                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:AudioRecorder.Dynamics.RecorderStates.FatalError", [
                    "module:AudioRecorder.Dynamics.RecorderStates.State",
                    "browser:Info",
                    "base:Timers.Timer"
                ], function(State, Info, Timer, scoped) {
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 7 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 46..68

                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/audio_recorder/recorder/states.js and 2 other locations - About 7 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 268..281
                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/audio_recorder/recorder/states.js and 2 other locations - About 7 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 548..562
                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/audio_recorder/recorder/states.js and 2 other locations - About 7 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 563..572
                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

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

                                    if (data.duration && this.dyn.get("enforce-duration")) {
                                        if ((this.dyn.get("timeminlimit") && data.duration < this.dyn.get("timeminlimit")) || (this.dyn.get("timelimit") && data.duration > this.dyn.get("timelimit"))) {
                                            this.next("FatalError", {
                                                message: this.dyn.string("upload-error-duration"),
                                                retry: "Chooser"
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 5 hrs to fix
                src/dynamics/video_recorder/recorder/states.js on lines 345..353

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

                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:AudioRecorder.Dynamics.RecorderStates.Player", [
                    "module:AudioRecorder.Dynamics.RecorderStates.State"
                ], function(State, scoped) {
                    return State.extend({
                        scoped: scoped
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 5 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 107..129

                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/audio_recorder/recorder/states.js and 2 other locations - About 4 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 618..625
                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

                            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/audio_recorder/recorder/states.js and 1 other location - About 3 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 387..388

                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

                            Async.eventually(function() {
                                this.dyn._stopRecording().success(function() {
                                    this._hasStopped();
                                    this.next("Uploading");
                                }, this).error(function(s) {
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 3 hrs to fix
                src/dynamics/video_recorder/recorder/states.js on lines 990..1000

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

                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

                        record: function() {
                            if (this.dyn.get("autorecord"))
                                return;
                            if (this.dyn.get("audio-test-mandatory") && !this.dyn.get("microphonehealthy") && !this._preparePromise)
                                return;
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 2 hrs to fix
                src/dynamics/video_recorder/recorder/states.js on lines 812..820

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

                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/audio_recorder/recorder/states.js and 1 other location - About 2 hrs to fix
                src/dynamics/image_capture/capture/states.js on lines 626..641

                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/audio_recorder/recorder/states.js and 2 other locations - About 1 hr to fix
                src/dynamics/image_capture/capture/states.js on lines 540..547
                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

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

                            if (this.dyn.get("timeminlimit"))
                                this.dyn.set("mintimeindicator", (Time.now() - this._startTime) / 1000 <= this.dyn.get("timeminlimit"));
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 1 hr to fix
                src/dynamics/video_recorder/recorder/states.js on lines 951..952

                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

                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/audio_recorder/recorder/states.js and 3 other locations - About 1 hr to fix
                src/dynamics/audio_recorder/recorder/states.js on lines 739..744
                src/dynamics/image_capture/capture/states.js on lines 587..592
                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 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/audio_recorder/recorder/states.js and 3 other locations - About 1 hr to fix
                src/dynamics/audio_recorder/recorder/states.js on lines 683..688
                src/dynamics/image_capture/capture/states.js on lines 587..592
                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/audio_recorder/recorder/states.js and 2 other locations - About 1 hr to fix
                src/dynamics/image_capture/capture/states.js on lines 594..598
                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._audioFileName = file.files[0].name;
                                this.dyn._audioFile = file.files[0];
                            } catch (e) {}
                Severity: Major
                Found in src/dynamics/audio_recorder/recorder/states.js and 2 other locations - About 1 hr to fix
                src/dynamics/image_capture/capture/states.js on lines 225..228
                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/audio_recorder/recorder/states.js and 5 other locations - About 1 hr to fix
                src/dynamics/audio_recorder/recorder/states.js on lines 279..284
                src/dynamics/image_capture/capture/states.js on lines 261..266
                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 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/audio_recorder/recorder/states.js and 5 other locations - About 1 hr to fix
                src/dynamics/audio_recorder/recorder/states.js on lines 365..370
                src/dynamics/image_capture/capture/states.js on lines 261..266
                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/audio_recorder/recorder/states.js and 1 other location - About 1 hr to fix
                src/dynamics/image_capture/capture/states.js on lines 362..367

                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

                            this._timer = this.auto_destroy(new Timer({
                                immediate: true,
                                delay: this.__timerDelay,
                                context: this,
                                fire: this._timerFire
                Severity: Minor
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 50 mins to fix
                src/dynamics/video_recorder/recorder/states.js on lines 934..939

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

                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 (limit && this._startTime + limit * 1000 <= current) {
                                this._timer.stop();
                                this.stop();
                            }
                Severity: Minor
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 50 mins to fix
                src/dynamics/video_recorder/recorder/states.js on lines 954..957

                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

                                if (this.dyn.get("recordings"))
                                    this.dyn.set("recordings", this.dyn.get("recordings") - 1);
                Severity: Minor
                Found in src/dynamics/audio_recorder/recorder/states.js and 2 other locations - About 40 mins to fix
                src/dynamics/image_capture/capture/states.js on lines 629..630
                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

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

                            this.dyn.set("controlbarlabel", this.dyn.get("display-timer") ? TimeFormat.format(TimeFormat.ELAPSED_MINUTES_SECONDS, display) : "");
                Severity: Minor
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 35 mins to fix
                src/dynamics/video_recorder/recorder/states.js on lines 949..949

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

                            var display = Math.max(0, limit ? (this._startTime + limit * 1000 - current) : (current - this._startTime));
                Severity: Minor
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 35 mins to fix
                src/dynamics/video_recorder/recorder/states.js on lines 947..947

                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

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

                                if (delta < minlimit) {
                                    var limit = this.dyn.get("timelimit");
                                    if (!limit || limit > delta)
                                        return;
                                }
                Severity: Minor
                Found in src/dynamics/audio_recorder/recorder/states.js and 1 other location - About 30 mins to fix
                src/dynamics/video_recorder/recorder/states.js on lines 976..980

                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