betajs/betajs-media-components

View on GitHub
src/dynamics/audio_player/player/player.js

Summary

Maintainability
F
1 wk
Test Coverage

File player.js has 585 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:AudioPlayer.Dynamics.Player", [
    "dynamics:Dynamic",
    "module:Assets",
    "module:AudioVisualization",
    "browser:Info",
Severity: Major
Found in src/dynamics/audio_player/player/player.js - About 1 day to fix

    Function _attachAudio has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    _attachAudio: function() {
                        if (this.audioAttached())
                            return;
                        if (!this.__activated) {
                            this.__attachRequested = true;
    Severity: Major
    Found in src/dynamics/audio_player/player/player.js - About 4 hrs to fix

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

                      create: function() {
                          if (this.get("visualeffectvisible") && (!this.get("height") || this.get("height") < this.get("visualeffectminheight")))
                              this.set("height", this.get("visualeffectminheight"));
                          // Will set volume initial state
                          this.set("initialoptions", Objs.tree_merge(this.get("initialoptions"), {
      Severity: Minor
      Found in src/dynamics/audio_player/player/player.js - About 1 hr to fix

        Function _findNextTabStop has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        _findNextTabStop: function(parentElement, ev, callback, direction) {
                            var _currentIndex, _direction, _tabIndexes, _tabIndexesArray, _maxIndex, _minIndex, _looked, _tabIndex, _delta, _element, _audioPlayersCount;
                            _maxIndex = _minIndex = 0;
                            _direction = direction || 1;
                            _element = ev.target;
        Severity: Minor
        Found in src/dynamics/audio_player/player/player.js - About 1 hr to fix

          Function tab_index_move has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                              tab_index_move: function(ev, nextSelector, focusingSelector) {
                                  var _targetElement, _activeElement, _selector, _keyCode;
                                  _keyCode = ev.which || ev.keyCode;
                                  _activeElement = this.activeElement();
                                  if (_keyCode === 13 || _keyCode === 32) {
          Severity: Minor
          Found in src/dynamics/audio_player/player/player.js - About 1 hr to fix

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

                            _findNextTabStop: function(parentElement, ev, callback, direction) {
                                var _currentIndex, _direction, _tabIndexes, _tabIndexesArray, _maxIndex, _minIndex, _looked, _tabIndex, _delta, _element, _audioPlayersCount;
                                _maxIndex = _minIndex = 0;
                                _direction = direction || 1;
                                _element = ev.target;
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 3 days to fix
            src/dynamics/video_player/player/player.js on lines 1917..1960

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

            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

                                tab_index_move: function(ev, nextSelector, focusingSelector) {
                                    var _targetElement, _activeElement, _selector, _keyCode;
                                    _keyCode = ev.which || ev.keyCode;
                                    _activeElement = this.activeElement();
                                    if (_keyCode === 13 || _keyCode === 32) {
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 1 day to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 276..313

            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

                            _playWhenVisible: function(audio) {
                                var _self = this;
            
                                if (Dom.isElementVisible(audio, this.get("visibilityfraction"))) {
                                    this.player.play();
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 1 day to fix
            src/dynamics/video_player/player/player.js on lines 1792..1811

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

            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.get("height") && this.get("height") > this.get("visualeffectminheight")) {
                                            this.set('visualeffectheight', this.get("height"));
                                        } else if (this.get("visualeffectheight") < this.get("visualeffectminheight")) {
                                            this.set('visualeffectheight', this.get("visualeffectminheight"));
                                        }
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 3 hrs to fix
            src/dynamics/audio_recorder/recorder/recorder.js on lines 351..355

            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

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 85.

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

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

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

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

            Refactorings

            Further Reading

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

                            _detachAudio: function() {
                                this.set("playing", false);
                                if (this.player)
                                    this.player.weakDestroy();
                                this.player = null;
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 2 hrs to fix
            src/dynamics/video_player/player/player.js on lines 1443..1449

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

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 68.

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

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

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

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

            Refactorings

            Further Reading

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

                                        if (this.get("totalduration") || this.player.duration() < Infinity)
                                            this.set("duration", this.get("totalduration") || this.player.duration());
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 1 hr to fix
            src/dynamics/video_player/player/player.js on lines 1716..1717

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 63.

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

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

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

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

            Refactorings

            Further Reading

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 63.

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

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

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

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

            Refactorings

            Further Reading

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

                                submit: function() {
                                    if (!this.get("submittable"))
                                        return;
                                    this.trigger("submit");
                                    this.set("submittable", false);
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 1 hr to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 268..274

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

            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 sources = filter ? Objs.filter(this.get("sources"), function(source) {
                                    return Objs.subset_of(filter, source);
                                }, this) : this.get("sources");
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 1 hr to fix
            src/dynamics/video_player/player/player.js on lines 1752..1754

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

            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 (_keyCode === 32 || _keyCode === 37 || _keyCode === 38 || _keyCode === 39 || _keyCode === 40) ev.preventDefault();
            Severity: Major
            Found in src/dynamics/audio_player/player/player.js and 2 other locations - About 50 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 167..167
            src/dynamics/video_player/player/player.js on lines 1897..1897

            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

                                    return this.get("playing") && this.get("buffered") < this.get("position") && this.get("last_position_change_delta") > 1000;
            Severity: Minor
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 50 mins to fix
            src/dynamics/video_player/player/player.js on lines 916..916

            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

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

                                    if (this.audioLoaded()) {
                                        this.player.setVolume(volume);
                                        this.player.setMuted(volume <= 0);
                                    }
            Severity: Minor
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 40 mins to fix
            src/dynamics/video_player/player/player.js on lines 631..634

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

                            cloneAttrs: function() {
                                return Objs.map(this.attrs, function(value, key) {
                                    return this.get(key);
                                }, this);
                            }
            Severity: Minor
            Found in src/dynamics/audio_player/player/player.js and 2 other locations - About 30 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 516..520
            src/dynamics/video_recorder/recorder/recorder.js on lines 1326..1330

            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

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

                                this.set("initialoptions", Objs.tree_merge(this.get("initialoptions"), {
                                    volumelevel: this.get("volume")
                                }));
            Severity: Minor
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 30 mins to fix
            src/dynamics/video_player/player/player.js on lines 1059..1061

            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

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

                                    this.player.on("playing", function() {
                                        this.set("playing", true);
                                        this.trigger("playing");
                                    }, this);
            Severity: Minor
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 30 mins to fix
            src/dynamics/audio_player/player/player.js on lines 355..358

            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

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

                                    this.player.on("paused", function() {
                                        this.set("playing", false);
                                        this.trigger("paused");
                                    }, this);
            Severity: Minor
            Found in src/dynamics/audio_player/player/player.js and 1 other location - About 30 mins to fix
            src/dynamics/audio_player/player/player.js on lines 346..349

            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