Halyul/hexo-theme-mdui

View on GitHub
source/js/_files/lg-zoom.js

Summary

Maintainability
F
1 wk
Test Coverage

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

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

    File lg-zoom.js has 460 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**!
     * lg-zoom.js | 1.0.1 | December 22nd 2016
     * http://sachinchoolur.github.io/lg-zoom.js
     * Copyright (c) 2016 Sachin N;
     * @license GPLv3
    Severity: Minor
    Found in source/js/_files/lg-zoom.js - About 7 hrs to fix

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

              Zoom.prototype.init = function() {
      
                var _this = this;
                var zoomIcons = '<button id="lg-zoom-in" class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white mdui-float-right"><i class="mdui-icon mdui-text-color-white-icon material-icons">&#xe8ff;</i></button><button id="lg-zoom-out" class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white mdui-float-right"><i class="mdui-icon mdui-text-color-white-icon material-icons">&#xe900;</i></button>';
      
      
      Severity: Major
      Found in source/js/_files/lg-zoom.js - About 5 hrs to fix

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

                Zoom.prototype.zoomDrag = function() {
        
                  var _this = this;
                  var startCoords = {};
                  var endCoords = {};
        Severity: Major
        Found in source/js/_files/lg-zoom.js - About 2 hrs to fix

          Function zoomSwipe has 67 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 source/js/_files/lg-zoom.js - About 2 hrs to fix

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

                    Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) {
            
                      var _this = this;
                      var _el = _this.core.___slide[_this.core.index].querySelector('.lg-img-wrap');
                      var image = _this.core.___slide[_this.core.index].querySelector('.lg-object');
            Severity: Minor
            Found in source/js/_files/lg-zoom.js - About 1 hr to fix

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

                        var actualSize = function actualSize(event, image, index, fromIcon) {
                          var w = image.clientWidth;
                          var nw;
                          if (_this.core.s.dynamic) {
                            nw = _this.core.s.dynamicEl[index].width || image.naturalWidth || w;
              Severity: Minor
              Found in source/js/_files/lg-zoom.js - About 1 hr to fix

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

                  return (function e(t, n, r) {
                    function s(o, u) {
                      if (!n[o]) {
                        if (!t[o]) {
                          var a = typeof require == "function" && require;
                Severity: Major
                Found in source/js/_files/lg-zoom.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/lightgallery.js on lines 6..1603

                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 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)
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 6 hrs to fix
                source/js/_files/lg-autoplay.js on lines 7..262
                source/js/_files/lg-fullscreen.js on lines 7..171
                source/js/_files/lightgallery.js on lines 6..1604

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

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

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

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

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

                Refactorings

                Further Reading

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

                        var _extends = Object.assign || function(target) {
                          for (var i = 1; i < arguments.length; i++) {
                            var source = arguments[i];
                
                            for (var key in source) {
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 2 other locations - About 3 hrs to fix
                source/js/_files/lg-autoplay.js on lines 67..79
                source/js/_files/lg-fullscreen.js on lines 67..79

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 114.

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

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

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

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

                Refactorings

                Further Reading

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

                      (function(global, factory) {
                        if (typeof define === "function" && define.amd) {
                          define([], factory);
                        } else if (typeof exports !== "undefined") {
                          factory();
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 2 other locations - About 3 hrs to fix
                source/js/_files/lg-autoplay.js on lines 52..258
                source/js/_files/lg-fullscreen.js on lines 52..167

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

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

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

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

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

                Refactorings

                Further Reading

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

                              if (_this.core.s.useLeftForZoom) {
                                _el.style.left = distanceX + 'px';
                                _el.style.top = distanceY + 'px';
                              } else {
                                utils.setVendor(_el, 'Transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 2 other locations - About 2 hrs to fix
                source/js/_files/lg-zoom.js on lines 411..416
                source/js/_files/lg-zoom.js on lines 583..588

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

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

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

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

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

                Refactorings

                Further Reading

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

                            if (_this.core.s.useLeftForZoom) {
                              _el.style.left = distanceX + 'px';
                              _el.style.top = distanceY + 'px';
                            } else {
                              utils.setVendor(_el, 'Transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 2 other locations - About 2 hrs to fix
                source/js/_files/lg-zoom.js on lines 411..416
                source/js/_files/lg-zoom.js on lines 510..515

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

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

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

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

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

                Refactorings

                Further Reading

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

                                  if (_this.core.s.useLeftForZoom) {
                                    _el.style.left = distanceX + 'px';
                                    _el.style.top = distanceY + 'px';
                                  } else {
                                    utils.setVendor(_el, 'Transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 2 other locations - About 2 hrs to fix
                source/js/_files/lg-zoom.js on lines 510..515
                source/js/_files/lg-zoom.js on lines 583..588

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

                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 (allowY) {
                                distanceY = -Math.abs(_el.getAttribute('data-y')) + (endCoords.y - startCoords.y);
                              } else {
                                distanceY = -Math.abs(_el.getAttribute('data-y'));
                              }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 2 hrs to fix
                source/js/_files/lg-zoom.js on lines 397..401
                source/js/_files/lg-zoom.js on lines 403..407
                source/js/_files/lg-zoom.js on lines 504..508

                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 (allowY) {
                                  distanceY = -Math.abs(_el.getAttribute('data-y')) + (endCoords.y - startCoords.y);
                                } else {
                                  distanceY = -Math.abs(_el.getAttribute('data-y'));
                                }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 2 hrs to fix
                source/js/_files/lg-zoom.js on lines 403..407
                source/js/_files/lg-zoom.js on lines 498..502
                source/js/_files/lg-zoom.js on lines 504..508

                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.getAttribute('data-x')) + (endCoords.x - startCoords.x);
                                } else {
                                  distanceX = -Math.abs(_el.getAttribute('data-x'));
                                }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 2 hrs to fix
                source/js/_files/lg-zoom.js on lines 397..401
                source/js/_files/lg-zoom.js on lines 498..502
                source/js/_files/lg-zoom.js on lines 504..508

                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.getAttribute('data-x')) + (endCoords.x - startCoords.x);
                              } else {
                                distanceX = -Math.abs(_el.getAttribute('data-x'));
                              }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 2 hrs to fix
                source/js/_files/lg-zoom.js on lines 397..401
                source/js/_files/lg-zoom.js on lines 403..407
                source/js/_files/lg-zoom.js on lines 498..502

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

                          utils.on(document.getElementById('lg-zoom-in'), 'click.lg', function() {
                            if (_this.core.outer.querySelector('.lg-current .lg-image')) {
                              scale += _this.core.s.scale;
                              callScale();
                            }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 285..290

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

                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

                          utils.on(document.getElementById('lg-zoom-out'), 'click.lg', function() {
                            if (_this.core.outer.querySelector('.lg-current .lg-image')) {
                              scale -= _this.core.s.scale;
                              callScale();
                            }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 292..297

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

                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

                          var maxY = Math.abs(image.offsetHeight * Math.abs(image.getAttribute('data-scale')) - _this.core.outer.querySelector('.lg').clientHeight + minY);
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 552..552

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

                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

                          var maxX = Math.abs(image.offsetWidth * Math.abs(image.getAttribute('data-scale')) - _this.core.outer.querySelector('.lg').clientWidth + minX);
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 550..550

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

                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.setAttribute('data-x', Math.abs(distanceX));
                            } else {
                              distanceX = -Math.abs(_el.getAttribute('data-x'));
                            }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 571..575

                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 (allowY) {
                              _el.setAttribute('data-y', Math.abs(distanceY));
                            } else {
                              distanceY = -Math.abs(_el.getAttribute('data-y'));
                            }
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 1 other location - About 1 hr to fix
                source/js/_files/lg-zoom.js on lines 577..581

                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

                Identical 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 (_this.core.s.useLeftForZoom) {
                                    _el.style.left = distanceX + 'px';
                                    _el.style.top = distanceY + 'px';
                Severity: Minor
                Found in source/js/_files/lg-zoom.js and 1 other location - About 55 mins to fix
                source/js/_files/lg-zoom.js on lines 554..589

                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 (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 source/js/_files/lg-zoom.js and 1 other location - About 55 mins to fix
                source/js/_files/lg-zoom.js on lines 409..417

                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 (allowY) {
                              if (distanceY <= -maxY) {
                                distanceY = -maxY;
                              } else if (distanceY >= -minY) {
                                distanceY = -minY;
                Severity: Minor
                Found in source/js/_files/lg-zoom.js and 1 other location - About 50 mins to fix
                source/js/_files/lg-zoom.js on lines 563..569

                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 source/js/_files/lg-zoom.js and 1 other location - About 50 mins to fix
                source/js/_files/lg-zoom.js on lines 555..561

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

                              allowX = image.offsetWidth * image.getAttribute('data-scale') > _this.core.outer.querySelector('.lg').clientWidth;
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 35 mins to fix
                source/js/_files/lg-zoom.js on lines 362..362
                source/js/_files/lg-zoom.js on lines 363..363
                source/js/_files/lg-zoom.js on lines 459..459

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                                allowY = image.offsetHeight * image.getAttribute('data-scale') > _this.core.outer.querySelector('.lg').clientHeight;
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 35 mins to fix
                source/js/_files/lg-zoom.js on lines 363..363
                source/js/_files/lg-zoom.js on lines 459..459
                source/js/_files/lg-zoom.js on lines 460..460

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                                allowX = image.offsetWidth * image.getAttribute('data-scale') > _this.core.outer.querySelector('.lg').clientWidth;
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 35 mins to fix
                source/js/_files/lg-zoom.js on lines 362..362
                source/js/_files/lg-zoom.js on lines 459..459
                source/js/_files/lg-zoom.js on lines 460..460

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

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

                              allowY = image.offsetHeight * image.getAttribute('data-scale') > _this.core.outer.querySelector('.lg').clientHeight;
                Severity: Major
                Found in source/js/_files/lg-zoom.js and 3 other locations - About 35 mins to fix
                source/js/_files/lg-zoom.js on lines 362..362
                source/js/_files/lg-zoom.js on lines 363..363
                source/js/_files/lg-zoom.js on lines 460..460

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 47.

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

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

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

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

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status