Undev/redmine_lightbox

View on GitHub

Showing 74 of 74 total issues

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

                if (_this.s.loop) {
                    _this.index = 0;
                    _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
                    _this.slide(_this.index, fromTouch, false);
                } else if (_this.s.slideEndAnimatoin) {
Severity: Major
Found in assets/javascripts/lightgallery-all.js and 1 other location - About 1 hr to fix
assets/javascripts/lightgallery-all.js on lines 927..936

Duplicated Code

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

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

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

Tuning

This issue has a mass of 59.

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

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

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

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

Refactorings

Further Reading

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

    Plugin.prototype.build = function(index) {

        var _this = this;

        _this.structure();
Severity: Minor
Found in assets/javascripts/lightgallery-all.js - About 1 hr to fix

    Function getThumb has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function getThumb(src, thumb, index) {
                var isVideo = _this.core.isVideo(src, index) || {};
                var thumbImg;
                var vimeoId = '';
    
    
    Severity: Minor
    Found in assets/javascripts/lightgallery-all.js - About 1 hr to fix

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

              var actualSize = function(event, $image, index, fromIcon) {
                  var w = $image.width();
                  var nw;
                  if (_this.core.s.dynamic) {
                      nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w;
      Severity: Minor
      Found in assets/javascripts/lightgallery-all.js - About 1 hr to fix

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

                    if (allowY) {
                        _$el.attr('data-y', Math.abs(distanceY));
                    } else {
                        distanceY = -Math.abs(_$el.attr('data-y'));
                    }
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 1 hr to fix
        assets/javascripts/lightgallery-all.js on lines 2870..2874

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

        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 (allowX) {
                        _$el.attr('data-x', Math.abs(distanceX));
                    } else {
                        distanceX = -Math.abs(_$el.attr('data-x'));
                    }
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 1 hr to fix
        assets/javascripts/lightgallery-all.js on lines 2864..2868

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

        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 ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
                    if (allowY) {
                        if (distanceY <= -maxY) {
                            distanceY = -maxY;
                        } else if (distanceY >= -minY) {
        Severity: Minor
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 55 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2712..2717

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

        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 ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
                            _$el.css({
                                left: distanceX + 'px',
                                top: distanceY + 'px'
                            });
        Severity: Minor
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 55 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2847..2881

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

        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

                        allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js and 3 other locations - About 55 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2668..2668
        assets/javascripts/lightgallery-all.js on lines 2755..2755
        assets/javascripts/lightgallery-all.js on lines 2756..2756

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

                        allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js and 3 other locations - About 55 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2669..2669
        assets/javascripts/lightgallery-all.js on lines 2755..2755
        assets/javascripts/lightgallery-all.js on lines 2756..2756

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

                    allowY = $image.outerHeight() * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js and 3 other locations - About 55 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2668..2668
        assets/javascripts/lightgallery-all.js on lines 2669..2669
        assets/javascripts/lightgallery-all.js on lines 2756..2756

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

                    allowX = $image.outerWidth() * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js and 3 other locations - About 55 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2668..2668
        assets/javascripts/lightgallery-all.js on lines 2669..2669
        assets/javascripts/lightgallery-all.js on lines 2755..2755

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

                        } else if (_next) {
        
                            // next slide
                            this.$slide.eq(index).addClass('lg-next-slide');
                            this.$slide.eq(_prevIndex).addClass('lg-prev-slide');
        Severity: Minor
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 50 mins to fix
        assets/javascripts/lightgallery-all.js on lines 817..827

        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 (_prev) {
        
                            //prevslide
                            this.$slide.eq(index).addClass('lg-prev-slide');
                            this.$slide.eq(_prevIndex).addClass('lg-next-slide');
        Severity: Minor
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 50 mins to fix
        assets/javascripts/lightgallery-all.js on lines 822..827

        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 (allowX) {
                        if (distanceX <= -maxX) {
                            distanceX = -maxX;
                        } else if (distanceX >= -minX) {
                            distanceX = -minX;
        Severity: Minor
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 50 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2848..2854

        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 (allowY) {
                        if (distanceY <= -maxY) {
                            distanceY = -maxY;
                        } else if (distanceY >= -minY) {
                            distanceY = -minY;
        Severity: Minor
        Found in assets/javascripts/lightgallery-all.js and 1 other location - About 50 mins to fix
        assets/javascripts/lightgallery-all.js on lines 2856..2862

        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

        Avoid deeply nested control flow statements.
        Open

                            if (_this.core.s.loadDailymotionThumbnail) {
                                thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
                            } else {
                                thumbImg = thumb;
                            }
        Severity: Major
        Found in assets/javascripts/lightgallery-all.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if ((index === _length - 1) && (_prevIndex === 0) && !fromThumb) {
                                  _prev = true;
                                  _next = false;
                              }
          Severity: Major
          Found in assets/javascripts/lightgallery-all.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                    } else if (isVideo.vk) {
            
                        a = '&autoplay=' + autoplay;
                        if (this.core.s.vkPlayerParams) {
                            a = a + '&' + $.param(this.core.s.vkPlayerParams);
            Severity: Major
            Found in assets/javascripts/lightgallery-all.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                          if (fL === '.' || fL === '#') {
                              html = $(html).html();
                          }
              Severity: Major
              Found in assets/javascripts/lightgallery-all.js - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language