Undev/redmine_lightbox

View on GitHub

Showing 74 of 74 total issues

File lightgallery-all.js has 2099 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! lightgallery - v1.2.22 - 2016-07-20
* http://sachinchoolur.github.io/lightGallery/
* Copyright (c) 2016 Sachin N; Licensed Apache 2.0 */
(function($, window, document, undefined) {

Severity: Major
Found in assets/javascripts/lightgallery-all.js - About 5 days to fix

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

                        if (youtubePlayer) {
                            youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
                        } else if (vimeoPlayer) {
                            try {
                                $f(vimeoPlayer).api('play');
    Severity: Major
    Found in assets/javascripts/lightgallery-all.js and 1 other location - About 7 hrs to fix
    assets/javascripts/lightgallery-all.js on lines 2308..2329

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

    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 (youtubePlayer) {
                    youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
                } else if (vimeoPlayer) {
                    try {
                        $f(vimeoPlayer).api('pause');
    Severity: Major
    Found in assets/javascripts/lightgallery-all.js and 1 other location - About 7 hrs to fix
    assets/javascripts/lightgallery-all.js on lines 2258..2279

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

    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

    Function init has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Video.prototype.init = function() {
            var _this = this;
    
            // Event triggered when video url found without poster
            _this.core.$el.on('hasVideo.lg.tm', function(event, index, src, html) {
    Severity: Major
    Found in assets/javascripts/lightgallery-all.js - About 5 hrs to fix

      Function loadContent has 126 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Plugin.prototype.loadContent = function(index, rec, delay) {
      
              var _this = this;
              var _hasPoster = false;
              var _$img;
      Severity: Major
      Found in assets/javascripts/lightgallery-all.js - About 5 hrs to fix

        Function init has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Zoom.prototype.init = function() {
        
                var _this = this;
                var zoomIcons = '<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-icon"></span>';
        
        
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js - About 4 hrs to fix

          Function build has 111 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Thumbnail.prototype.build = function() {
                  var _this = this;
                  var thumbList = '';
                  var vimeoErrorThumbSize = '';
                  var $thumb;
          Severity: Major
          Found in assets/javascripts/lightgallery-all.js - About 4 hrs to fix

            Function slide has 94 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Plugin.prototype.slide = function(index, fromTouch, fromThumb) {
            
                    var _prevIndex = this.$outer.find('.lg-current').index();
                    var _this = this;
            
            
            Severity: Major
            Found in assets/javascripts/lightgallery-all.js - About 3 hrs to fix

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

                      } else if (isVideo.vimeo) {
              
                          a = '?autoplay=' + autoplay + '&api=1';
                          if (this.core.s.vimeoPlayerParams) {
                              a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
              Severity: Major
              Found in assets/javascripts/lightgallery-all.js and 2 other locations - About 3 hrs to fix
              assets/javascripts/lightgallery-all.js on lines 2370..2414
              assets/javascripts/lightgallery-all.js on lines 2388..2414

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

              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 (isVideo.youtube) {
              
                          a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
                          if (this.core.s.youtubePlayerParams) {
                              a = a + '&' + $.param(this.core.s.youtubePlayerParams);
              Severity: Major
              Found in assets/javascripts/lightgallery-all.js and 2 other locations - About 3 hrs to fix
              assets/javascripts/lightgallery-all.js on lines 2379..2414
              assets/javascripts/lightgallery-all.js on lines 2388..2414

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

              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

                      } else if (isVideo.dailymotion) {
              
                          a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
                          if (this.core.s.dailymotionPlayerParams) {
                              a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
              Severity: Major
              Found in assets/javascripts/lightgallery-all.js and 2 other locations - About 3 hrs to fix
              assets/javascripts/lightgallery-all.js on lines 2370..2414
              assets/javascripts/lightgallery-all.js on lines 2379..2414

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

              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

              Function structure has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Plugin.prototype.structure = function() {
                      var list = '';
                      var controls = '';
                      var i = 0;
                      var subHtmlCont = '';
              Severity: Major
              Found in assets/javascripts/lightgallery-all.js - About 2 hrs to fix

                Function zoomDrag has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Zoom.prototype.zoomDrag = function() {
                
                        var _this = this;
                        var startCoords = {};
                        var endCoords = {};
                Severity: Major
                Found in assets/javascripts/lightgallery-all.js - About 2 hrs to fix

                  Function loadOnClick has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          var loadOnClick = function($el) {
                              // check slide has poster
                              if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
                  
                                  // check already video element present
                  Severity: Major
                  Found in assets/javascripts/lightgallery-all.js - About 2 hrs to fix

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

                            if (document.exitFullscreen) {
                                document.exitFullscreen();
                            } else if (document.msExitFullscreen) {
                                document.msExitFullscreen();
                            } else if (document.mozCancelFullScreen) {
                    Severity: Major
                    Found in assets/javascripts/lightgallery-all.js and 1 other location - About 2 hrs to fix
                    assets/javascripts/lightgallery-all.js on lines 1548..1556

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 87.

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

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

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

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

                    Refactorings

                    Further Reading

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

                            if (el.requestFullscreen) {
                                el.requestFullscreen();
                            } else if (el.msRequestFullscreen) {
                                el.msRequestFullscreen();
                            } else if (el.mozRequestFullScreen) {
                    Severity: Major
                    Found in assets/javascripts/lightgallery-all.js and 1 other location - About 2 hrs to fix
                    assets/javascripts/lightgallery-all.js on lines 1560..1568

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 87.

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

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

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

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

                    Refactorings

                    Further Reading

                    Function zoomSwipe has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        Zoom.prototype.zoomSwipe = function() {
                            var _this = this;
                            var startCoords = {};
                            var endCoords = {};
                            var isMoved = false;
                    Severity: Major
                    Found in assets/javascripts/lightgallery-all.js - About 2 hrs to fix

                      Function addHtml has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          Plugin.prototype.addHtml = function(index) {
                              var subHtml = null;
                              var subHtmlUrl;
                              var $currentEle;
                              if (this.s.dynamic) {
                      Severity: Major
                      Found in assets/javascripts/lightgallery-all.js - About 2 hrs to fix

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

                                        if (allowY) {
                                            distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
                                        } else {
                                            distanceY = -Math.abs(_$el.attr('data-y'));
                                        }
                        Severity: Major
                        Found in assets/javascripts/lightgallery-all.js and 3 other locations - About 2 hrs to fix
                        assets/javascripts/lightgallery-all.js on lines 2706..2710
                        assets/javascripts/lightgallery-all.js on lines 2792..2796
                        assets/javascripts/lightgallery-all.js on lines 2798..2802

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

                        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

                                        if (allowX) {
                                            distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
                                        } else {
                                            distanceX = -Math.abs(_$el.attr('data-x'));
                                        }
                        Severity: Major
                        Found in assets/javascripts/lightgallery-all.js and 3 other locations - About 2 hrs to fix
                        assets/javascripts/lightgallery-all.js on lines 2700..2704
                        assets/javascripts/lightgallery-all.js on lines 2792..2796
                        assets/javascripts/lightgallery-all.js on lines 2798..2802

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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language