Halyul/hexo-theme-mdui

View on GitHub
source/js/_files/lightgallery.js

Summary

Maintainability
F
2 wks
Test Coverage

Function 2 has 1023 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],2:[function(require,module,exports){
(function (global, factory) {
    if (typeof define === "function" && define.amd) {
        define(['./lg-utils'], factory);
    } else if (typeof exports !== "undefined") {
Severity: Major
Found in source/js/_files/lightgallery.js - About 5 days to fix

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

    /**!
     * lightgallery.js | 1.0.1 | December 22nd 2016
     * http://sachinchoolur.github.io/lightgallery.js/
     * Copyright (c) 2016 Sachin N;
     * @license GPLv3
    Severity: Major
    Found in source/js/_files/lightgallery.js - About 3 days to fix

      Function 1 has 141 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

       */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Lightgallery = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
      (function (global, factory) {
          if (typeof define === "function" && define.amd) {
              define(['exports'], factory);
          } else if (typeof exports !== "undefined") {
      Severity: Major
      Found in source/js/_files/lightgallery.js - About 5 hrs to fix

        Function loadContent has 135 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 source/js/_files/lightgallery.js - About 5 hrs to fix

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

              Plugin.prototype.slide = function (index, fromTouch, fromThumb) {
          
                  var _prevIndex = 0;
                  for (var i = 0; i < this.___slide.length; i++) {
                      if (_lgUtils2.default.hasClass(this.___slide[i], 'lg-current')) {
          Severity: Major
          Found in source/js/_files/lightgallery.js - About 4 hrs to fix

            Function structure has 62 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 source/js/_files/lightgallery.js - About 2 hrs to fix

              Function enableDrag has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  Plugin.prototype.enableDrag = function () {
                      var _this = this;
                      var startCoords = 0;
                      var endCoords = 0;
                      var isDraging = false;
              Severity: Minor
              Found in source/js/_files/lightgallery.js - About 1 hr to fix

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

                    Plugin.prototype.destroy = function (d) {
                
                        var _this = this;
                
                        if (!d) {
                Severity: Minor
                Found in source/js/_files/lightgallery.js - About 1 hr to fix

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

                      Plugin.prototype.addHtml = function (index) {
                          var subHtml = null;
                          var currentEle;
                          if (this.s.dynamic) {
                              subHtml = this.s.dynamicEl[index].subHtml;
                  Severity: Minor
                  Found in source/js/_files/lightgallery.js - About 1 hr to fix

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

                        Plugin.prototype.init = function () {
                    
                            var _this = this;
                    
                            // s.preload should not be more than $item.length
                    Severity: Minor
                    Found in source/js/_files/lightgallery.js - About 1 hr to fix

                      Function enableSwipe has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          Plugin.prototype.enableSwipe = function () {
                              var _this = this;
                              var startCoords = 0;
                              var endCoords = 0;
                              var isMoved = false;
                      Severity: Minor
                      Found in source/js/_files/lightgallery.js - About 1 hr to fix

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

                            Plugin.prototype.isVideo = function (src, index) {
                        
                                if (!src) {
                                    throw new Error("Make sure that slide " + index + " has an image/video src");
                                }
                        Severity: Minor
                        Found in source/js/_files/lightgallery.js - About 1 hr to fix

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

                              function Plugin(element, options) {
                          
                                  // Current lightGallery element
                                  this.el = element;
                          
                          
                          Severity: Minor
                          Found in source/js/_files/lightgallery.js - About 1 hr to fix

                            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 source/js/_files/lightgallery.js - About 1 hr to fix

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

                                      off: function off(el, event) {
                                          if (!el) {
                                              return;
                                          }
                              
                              
                              Severity: Minor
                              Found in source/js/_files/lightgallery.js - About 1 hr to fix

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

                                    Plugin.prototype.touchEnd = function (distance) {
                                        var _this = this;
                                
                                        // keep slide animation for any mode while dragg/swipe
                                        if (_this.s.mode !== 'lg-slide') {
                                Severity: Minor
                                Found in source/js/_files/lightgallery.js - About 1 hr to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              for (var key in utils.Listener) {
                                                                  if (utils.Listener.hasOwnProperty(key)) {
                                                                      if (key.split('.').indexOf(_event.split('.')[1]) > -1) {
                                                                          el.removeEventListener(key.split('.')[0], utils.Listener[key]);
                                                                          el.setAttribute('lg-event-uid', el.getAttribute('lg-event-uid').replace('&' + _id[i], ''));
                                  Severity: Major
                                  Found in source/js/_files/lightgallery.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                if (!_this.lgBusy) {
                                                                    _this.manageSwipeClass();
                                                                    startCoords = e.pageX;
                                                                    isDraging = true;
                                    
                                    
                                    Severity: Major
                                    Found in source/js/_files/lightgallery.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 source/js/_files/lightgallery.js - About 45 mins to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                        if (_this.s.dynamic) {
                                                            _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src);
                                                        } else {
                                                            _src = _this.items[index].getAttribute('data-download-url') !== 'false' && (_this.items[index].getAttribute('data-download-url') || _this.items[index].getAttribute('href') || _this.items[index].getAttribute('data-src'));
                                                        }
                                        Severity: Major
                                        Found in source/js/_files/lightgallery.js - About 40 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                      return {
                                                          vk: vk
                                                      };
                                          Severity: Major
                                          Found in source/js/_files/lightgallery.js - About 30 mins to fix

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

                                             */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Lightgallery = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
                                            (function (global, factory) {
                                                if (typeof define === "function" && define.amd) {
                                                    define(['exports'], factory);
                                                } else if (typeof exports !== "undefined") {
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 3 other locations - About 1 day to fix
                                            source/js/_files/lg-autoplay.js on lines 27..261
                                            source/js/_files/lg-fullscreen.js on lines 27..170
                                            source/js/_files/lg-zoom.js on lines 27..613

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

                                            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 (key.split('.').indexOf(_event.split('.')[1]) > -1) {
                                                                                    el.removeEventListener(key.split('.')[0], utils.Listener[key]);
                                                                                    el.setAttribute('lg-event-uid', el.getAttribute('lg-event-uid').replace('&' + _id[i], ''));
                                                                                    delete utils.Listener[key];
                                                                                }
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 2 hrs to fix
                                            source/js/_files/lightgallery.js on lines 158..162

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 85.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                                    } else {
                                                                        el.removeEventListener(_event.split('.')[0], utils.Listener[_event]);
                                                                        el.setAttribute('lg-event-uid', el.getAttribute('lg-event-uid').replace('&' + _id[i], ''));
                                                                        delete utils.Listener[_event];
                                                                    }
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 2 hrs to fix
                                            source/js/_files/lightgallery.js on lines 151..155

                                            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

                                                    function CustomEvent(event, params) {
                                                        params = params || {
                                                            bubbles: false,
                                                            cancelable: false,
                                                            detail: undefined
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 2 hrs to fix
                                            source/js/_files/smooth-scroll.js on lines 34..39

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

                                            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

                                                            for (var j = 0; j < this.___slide.length; j++) {
                                                                _lgUtils2.default.removeClass(this.___slide[j], 'lg-prev-slide');
                                                                _lgUtils2.default.removeClass(this.___slide[j], 'lg-next-slide');
                                                            }
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 2 hrs to fix
                                            source/js/_files/lightgallery.js on lines 1445..1448

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

                                            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

                                                    for (var i = 0; i < this.___slide.length; i++) {
                                                        _lgUtils2.default.removeClass(this.___slide[i], 'lg-next-slide');
                                                        _lgUtils2.default.removeClass(this.___slide[i], 'lg-prev-slide');
                                                    }
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 2 hrs to fix
                                            source/js/_files/lightgallery.js on lines 1027..1030

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

                                            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.s.loop) {
                                                                _this.index = _this.items.length - 1;
                                                                _lgUtils2.default.trigger(_this.el, 'onBeforePrevSlide', {
                                                                    index: _this.index,
                                                                    fromTouch: fromTouch
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 1 hr to fix
                                            source/js/_files/lightgallery.js on lines 1143..1154

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

                                            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.s.loop) {
                                                                _this.index = 0;
                                                                _lgUtils2.default.trigger(_this.el, 'onBeforeNextSlide', {
                                                                    index: _this.index
                                                                });
                                            Severity: Major
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 1 hr to fix
                                            source/js/_files/lightgallery.js on lines 1174..1186

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

                                            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
                                                                _lgUtils2.default.addClass(this.___slide[index], 'lg-next-slide');
                                                                _lgUtils2.default.addClass(this.___slide[_prevIndex], 'lg-prev-slide');
                                            Severity: Minor
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 55 mins to fix
                                            source/js/_files/lightgallery.js on lines 1046..1056

                                            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 (_prev) {
                                            
                                                                //prevslide
                                                                _lgUtils2.default.addClass(this.___slide[index], 'lg-prev-slide');
                                                                _lgUtils2.default.addClass(this.___slide[_prevIndex], 'lg-next-slide');
                                            Severity: Minor
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 55 mins to fix
                                            source/js/_files/lightgallery.js on lines 1051..1056

                                            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

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

                                                        if (!_lgUtils2.default.hasClass(document.body, 'lg-on')) {
                                                            _lgUtils2.default.addClass(document.body, 'lg-on');
                                                            setTimeout(function () {
                                                                _this.build(_this.index);
                                                            });
                                            Severity: Minor
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 50 mins to fix
                                            source/js/_files/lightgallery.js on lines 393..398

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 51.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                                        if (!_lgUtils2.default.hasClass(document.body, 'lg-on')) {
                                                            _lgUtils2.default.addClass(document.body, 'lg-on');
                                                            setTimeout(function () {
                                                                _this.build(_this.index);
                                                            });
                                            Severity: Minor
                                            Found in source/js/_files/lightgallery.js and 1 other location - About 50 mins to fix
                                            source/js/_files/lightgallery.js on lines 408..413

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 51.

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

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

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

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

                                            Refactorings

                                            Further Reading

                                            There are no issues that match your filters.

                                            Category
                                            Status