betajs/betajs-media-components

View on GitHub
src/dynamics/image_viewer/viewer/image_viewer.js

Summary

Maintainability
F
1 wk
Test Coverage

File image_viewer.js has 451 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Scoped.define("module:ImageViewer.Dynamics.ImageViewer", [
    "dynamics:Dynamic",
    "module:Assets",
    "browser:Info",
    "browser:Dom",
Severity: Minor
Found in src/dynamics/image_viewer/viewer/image_viewer.js - About 6 hrs to fix

    Function _open_image has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    _open_image: function(sourceFile) {
                        this.__imageViewer.counter = 0;
                        // Main container
                        this.__imageViewer.imageViewer = document.createElement('div');
    
    
    Severity: Minor
    Found in src/dynamics/image_viewer/viewer/image_viewer.js - About 1 hr to fix

      Function _findNextTabStop has 37 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, _imagePlayersCount;
                          _maxIndex = _minIndex = 0;
                          _direction = direction || 1;
                          _element = ev.target;
      Severity: Minor
      Found in src/dynamics/image_viewer/viewer/image_viewer.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/image_viewer/viewer/image_viewer.js - About 1 hr to fix

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

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

            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/image_viewer/viewer/image_viewer.js and 1 other location - About 1 day to fix
            src/dynamics/audio_player/player/player.js on lines 565..602

            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

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 240.

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

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

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

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

            Refactorings

            Further Reading

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

                            computed: {
                                "widthHeightStyles:width,height": function() {
                                    var result = {};
                                    var width = this.get("width");
                                    var height = this.get("height");
            Severity: Major
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 4 hrs to fix
            src/dynamics/audio_recorder/recorder/recorder.js on lines 130..141

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

            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 (_keyCode === 9 && ev.shiftKey) {
                                    this._resetActivity();
                                    this._findNextTabStop(element, ev, function(target, index) {
                                        target.focus();
                                    }, -1);
            Severity: Major
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 3 hrs to fix
            src/dynamics/video_player/player/player.js on lines 1913..1923

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

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

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 85.

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

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

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

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

            Refactorings

            Further Reading

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

                                if (_keyCode === 32 || _keyCode === 13 || _keyCode === 9) {
                                    this._resetActivity();
                                    if (this.get("fullscreened") && this.get("hideoninactivity")) this.set("hideoninactivity", false);
                                }
            Severity: Major
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 1 hr to fix
            src/dynamics/video_player/player/player.js on lines 1908..1911

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

            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

                            types: {
                                "rerecordable": "boolean",
                                "ready": "boolean",
                                "nofullscreen": "boolean",
                                "stretch": "boolean",
            Severity: Major
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 1 hr to fix
            src/dynamics/_common/circle_progress/circle-progress.js on lines 41..55

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

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

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

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

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

            Refactorings

            Further Reading

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

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

            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

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

            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

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

                            destroy: function() {
                                this._timer.destroy();
                                this.host.destroy();
                                inherited.destroy.call(this);
                            },
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 55 mins to fix
            src/dynamics/popup_helper/popup_helper.js on lines 72..76

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

            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/image_viewer/viewer/image_viewer.js and 2 other locations - About 50 mins to fix
            src/dynamics/audio_player/player/player.js on lines 436..436
            src/dynamics/video_player/player/player.js on lines 1906..1906

            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

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

                                if (this.__imageViewer.counter < 1.05) {
                                    this.__imageViewer.imageViewer.style.opacity = this.__imageViewer.counter;
                                    this.__imageViewer.counter += 0.05;
                                } else {
                                    this.__imageViewer.imageViewer.opacity = 1.00;
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 45 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 422..428

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

            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.__imageViewer.counter > 0) {
                                    this.__imageViewer.imageViewer.style.opacity = this.__imageViewer.counter;
                                    this.__imageViewer.counter -= 0.05;
                                } else {
                                    this.__imageViewer.fadeInCounter.stop();
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 45 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 410..416

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

            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.__imageViewer.fadeInCounter = new Timers.Timer({
                                    context: this,
                                    fire: this.__fadeIn,
                                    delay: 40,
                                    start: true
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 35 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 399..404

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

            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.__imageViewer.fadeInCounter = new Timers.Timer({
                                    context: this,
                                    fire: this.__fadeOut,
                                    delay: 20,
                                    start: true
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 35 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 385..390

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

            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

                            aspectRatio: function() {
                                // Don't use shortcut way of getting aspect ratio, will act as not expected.
                                var height = this.imageHeight();
                                var width = this.imageWidth();
            
            
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 35 mins to fix
            src/dynamics/video_player/player/player.js on lines 2617..2623

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

            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/image_viewer/viewer/image_viewer.js and 2 other locations - About 30 mins to fix
            src/dynamics/audio_player/player/player.js on lines 658..662
            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.__imageViewer.clickEvent.on(this.__imageViewer.closeButton, "click", function() {
                                        this._close_image();
                                    }, this);
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 30 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 359..361

            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.__imageViewer.clickEvent.on(this.__imageViewer.closeButton, "keydown", function() {
                                        this._close_image();
                                    }, this);
            Severity: Minor
            Found in src/dynamics/image_viewer/viewer/image_viewer.js and 1 other location - About 30 mins to fix
            src/dynamics/image_viewer/viewer/image_viewer.js on lines 356..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

            There are no issues that match your filters.

            Category
            Status