d3yii2/d3files

View on GitHub
assets/js/d3photo-view.js

Summary

Maintainability
F
3 wks
Test Coverage

File d3photo-view.js has 2087 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.photoviewer = factory());
}(this, (function () { 'use strict';
Severity: Major
Found in assets/js/d3photo-view.js - About 5 days to fix

    Function PhotoViewer has 606 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var PhotoViewer = /*#__PURE__*/function () {
        function PhotoViewer(items, options, el) {
          _classCallCheck(this, PhotoViewer);
    
          this.options = $.extend(true, {}, DEFAULTS, options);
    Severity: Major
    Found in assets/js/d3photo-view.js - About 3 days to fix

      Function resizable has 200 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          resizable: function resizable(modal, stage, image, minWidth, minHeight) {
            var _this = this;
      
            var resizableHandleE = $("<div class=\"".concat(NS, "-resizable-handle ").concat(NS, "-resizable-handle-e\"></div>"));
            var resizableHandleW = $("<div class=\"".concat(NS, "-resizable-handle ").concat(NS, "-resizable-handle-w\"></div>"));
      Severity: Major
      Found in assets/js/d3photo-view.js - About 1 day to fix

        Function movable has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            movable: function movable(stage, image) {
              var _this = this;
        
              var isDragging = false;
              var startX = 0;
        Severity: Major
        Found in assets/js/d3photo-view.js - About 3 hrs to fix

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

                value: function _keydown(e) {
                  if (!this.options.keyboard) {
                    return false;
                  }
          
          
          Severity: Major
          Found in assets/js/d3photo-view.js - About 2 hrs to fix

            Function zoomTo has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  value: function zoomTo(ratio, origin, e) {
                    var $image = this.$image;
                    var $stage = this.$stage;
                    var imgData = {
                      w: this.imageData.width,
            Severity: Major
            Found in assets/js/d3photo-view.js - About 2 hrs to fix

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

                var anim = function (properties, duration, ease, callback, delay) {
                  var key, cssValues = {}, cssProperties, transforms = '',
                    that = this, wrappedCallback, endEvent = D.fx.transitionEnd,
                    fired = false;
              
              
              Severity: Minor
              Found in assets/js/d3photo-view.js - About 1 hr to fix

                Function _addEvents has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      value: function _addEvents() {
                        var _this6 = this;
                
                        this.$stage.off(WHEEL_EVENT + EVENT_NS).on(WHEEL_EVENT + EVENT_NS, function (e) {
                          $('.photoviewer-image').removeClass('starting-position');
                Severity: Minor
                Found in assets/js/d3photo-view.js - About 1 hr to fix

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

                      draggable: function draggable(modal, dragHandle, dragCancel) {
                        var _this = this;
                  
                        var isDragging = false;
                        var startX = 0;
                  Severity: Minor
                  Found in assets/js/d3photo-view.js - About 1 hr to fix

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

                      D.extend = D.fn.extend = function () {
                        var options, name, src, copy, copyIsArray, clone,
                          target = arguments[0] || {},
                          i = 1,
                          length = arguments.length,
                    Severity: Minor
                    Found in assets/js/d3photo-view.js - About 1 hr to fix

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

                            var getImageOpts = function getImageOpts(dir, offsetX, offsetY) {
                              // Image should not move when modal width to the min width
                              // The minwidth is modal width, so we should clac the stage minwidth
                              var widthDiff = offsetX + modalData.w > minWidth ? stageData.w - imgWidth + offsetX - δ : minWidth - (modalData.w - stageData.w) - imgWidth - δ;
                              var heightDiff = offsetY + modalData.h > minHeight ? stageData.h - imgHeight + offsetY + δ : minHeight - (modalData.h - stageData.h) - imgHeight + δ;
                      Severity: Minor
                      Found in assets/js/d3photo-view.js - About 1 hr to fix

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

                              var getModalOpts = function getModalOpts(dir, offsetX, offsetY) {
                                // Modal should not move when its width to the minwidth
                                var modalLeft = -offsetX + modalData.w > minWidth ? offsetX + modalData.l : modalData.l + modalData.w - minWidth;
                                var modalTop = -offsetY + modalData.h > minHeight ? offsetY + modalData.t : modalData.t + modalData.h - minHeight;
                                var opts = {
                        Severity: Minor
                        Found in assets/js/d3photo-view.js - About 1 hr to fix

                          Function setModalSize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                value: function setModalSize(img) {
                                  var _this2 = this;
                          
                                  var winWidth = $W.width();
                                  var winHeight = $W.height();
                          Severity: Minor
                          Found in assets/js/d3photo-view.js - About 1 hr to fix

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

                                  value: function setImageSize(img) {
                                    var stageData = {
                                      w: this.$stage.width(),
                                      h: this.$stage.height()
                                    };
                            Severity: Minor
                            Found in assets/js/d3photo-view.js - About 1 hr to fix

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

                                  init: function (selector, context) {
                                    var dom;
                                    // If nothing given, return an empty D collection
                                    if (!selector) {
                                      return this;
                              Severity: Minor
                              Found in assets/js/d3photo-view.js - About 1 hr to fix

                                Function dragMove has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                      var dragMove = function dragMove(e) {
                                        e = e || window.event;
                                        e.preventDefault();
                                
                                        if (isDragging) {
                                Severity: Minor
                                Found in assets/js/d3photo-view.js - About 1 hr to fix

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

                                    var domMani = function (elem, args, fn, inside) {
                                      // arguments can be nodes, arrays of nodes, D objects and HTML strings
                                      var argType,
                                        nodes = D.map(args, function (arg) {
                                          var arr = [];
                                  Severity: Minor
                                  Found in assets/js/d3photo-view.js - About 1 hr to fix

                                    Function css has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function css(property, value) {
                                        if (arguments.length < 2) {
                                          var element = this[0];
                                          if (typeof property == 'string') {
                                            if (!element) return;
                                    Severity: Minor
                                    Found in assets/js/d3photo-view.js - About 1 hr to fix

                                      Function maximize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                            value: function maximize() {
                                              if (!this.isMaximized) {
                                                // Store modal data before maximize
                                                this.modalData = {
                                                  width: this.$photoviewer.width(),
                                      Severity: Minor
                                      Found in assets/js/d3photo-view.js - About 1 hr to fix

                                        Function dragStart has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                              var dragStart = function dragStart(dir, e) {
                                                e = e || window.event;
                                                e.preventDefault();
                                                isDragging = true;
                                                PUBLIC_VARS['isResizing'] = true;
                                        Severity: Minor
                                        Found in assets/js/d3photo-view.js - About 1 hr to fix

                                          Function on has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                            var on = function (event, selector, data, callback, one) {
                                              var autoRemove, delegator, $this = this;
                                              if (event && !isString(event)) {
                                                D.each(event, function (type, fn) {
                                                  $this.on(type, selector, data, fn, one);
                                          Severity: Minor
                                          Found in assets/js/d3photo-view.js - About 1 hr to fix

                                            Function loadImage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                  value: function loadImage(imgSrc, fn, err) {
                                                    var _this3 = this;
                                            
                                                    // Reset image
                                                    this.$image.removeAttr('style').attr('src', '');
                                            Severity: Minor
                                            Found in assets/js/d3photo-view.js - About 1 hr to fix

                                              Function add has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                function add(element, events, fn, data, selector, delegator, capture) {
                                                  var id = zid(element), set = (handlers[id] || (handlers[id] = []));
                                                  events.split(/\s/).forEach(function (event) {
                                                    if (event == 'ready') return D(document).ready(fn);
                                                    var handler = parse(event);
                                              Severity: Minor
                                              Found in assets/js/d3photo-view.js - About 1 hr to fix

                                                Function add has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                  function add(element, events, fn, data, selector, delegator, capture) {
                                                Severity: Major
                                                Found in assets/js/d3photo-view.js - About 50 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                              if (copyIsArray) {
                                                                copyIsArray = false;
                                                                clone = src && isArray(src) ? src : [];
                                                              } else {
                                                                clone = src && isPlainObject(src) ? src : {};
                                                  Severity: Major
                                                  Found in assets/js/d3photo-view.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                              } else if (copy !== undefined) {
                                                                target[name] = copy;
                                                              }
                                                    Severity: Major
                                                    Found in assets/js/d3photo-view.js - About 45 mins to fix

                                                      Function animate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                      Open

                                                        var animate = function (properties, duration, ease, callback, delay) {
                                                      Severity: Minor
                                                      Found in assets/js/d3photo-view.js - About 35 mins to fix

                                                        Function on has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                          var on = function (event, selector, data, callback, one) {
                                                        Severity: Minor
                                                        Found in assets/js/d3photo-view.js - About 35 mins to fix

                                                          Function remove$1 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                            function remove$1(element, events, fn, selector, capture) {
                                                          Severity: Minor
                                                          Found in assets/js/d3photo-view.js - About 35 mins to fix

                                                            Function resizable has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                resizable: function resizable(modal, stage, image, minWidth, minHeight) {
                                                            Severity: Minor
                                                            Found in assets/js/d3photo-view.js - About 35 mins to fix

                                                              Function anim has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                var anim = function (properties, duration, ease, callback, delay) {
                                                              Severity: Minor
                                                              Found in assets/js/d3photo-view.js - About 35 mins to fix

                                                                Function anim$1 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                  function anim$1(el, speed, opacity, scale, callback) {
                                                                Severity: Minor
                                                                Found in assets/js/d3photo-view.js - About 35 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                          return D(context).find(selector);
                                                                  Severity: Major
                                                                  Found in assets/js/d3photo-view.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                        return this.each(function () { this.style.cssText += ';' + css; });
                                                                    Severity: Major
                                                                    Found in assets/js/d3photo-view.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                            return D.makeArray(dom, selector, this);
                                                                      Severity: Major
                                                                      Found in assets/js/d3photo-view.js - About 30 mins to fix

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

                                                                                  se: {
                                                                                    top: heightDiff >= δ ? (heightDiff + δ) / 2 + 'px' : imgTop > heightDiff ? imgTop + 'px' : heightDiff + 'px',
                                                                                    left: widthDiff >= -δ ? (widthDiff - δ) / 2 + 'px' : imgLeft > widthDiff ? imgLeft + 'px' : widthDiff + 'px'
                                                                                  },
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 3 other locations - About 3 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1749..1752
                                                                        assets/js/d3photo-view.js on lines 1753..1756
                                                                        assets/js/d3photo-view.js on lines 1757..1760

                                                                        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

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

                                                                                  sw: {
                                                                                    top: heightDiff >= δ ? (heightDiff + δ) / 2 + 'px' : imgTop > heightDiff ? imgTop + 'px' : heightDiff + 'px',
                                                                                    left: widthDiff2 >= -δ ? (widthDiff2 - δ) / 2 + 'px' : imgLeft2 > widthDiff2 ? imgLeft2 + 'px' : widthDiff2 + 'px'
                                                                                  }
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 3 other locations - About 3 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1739..1742
                                                                        assets/js/d3photo-view.js on lines 1749..1752
                                                                        assets/js/d3photo-view.js on lines 1753..1756

                                                                        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

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

                                                                                  nw: {
                                                                                    top: heightDiff2 >= δ ? (heightDiff2 + δ) / 2 + 'px' : imgTop2 > heightDiff2 ? imgTop2 + 'px' : heightDiff2 + 'px',
                                                                                    left: widthDiff2 >= -δ ? (widthDiff2 - δ) / 2 + 'px' : imgLeft2 > widthDiff2 ? imgLeft2 + 'px' : widthDiff2 + 'px'
                                                                                  },
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 3 other locations - About 3 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1739..1742
                                                                        assets/js/d3photo-view.js on lines 1753..1756
                                                                        assets/js/d3photo-view.js on lines 1757..1760

                                                                        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

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

                                                                                  ne: {
                                                                                    top: heightDiff2 >= δ ? (heightDiff2 + δ) / 2 + 'px' : imgTop2 > heightDiff2 ? imgTop2 + 'px' : heightDiff2 + 'px',
                                                                                    left: widthDiff >= -δ ? (widthDiff - δ) / 2 + 'px' : imgLeft > widthDiff ? imgLeft + 'px' : widthDiff + 'px'
                                                                                  },
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 3 other locations - About 3 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1739..1742
                                                                        assets/js/d3photo-view.js on lines 1749..1752
                                                                        assets/js/d3photo-view.js on lines 1757..1760

                                                                        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

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

                                                                                imageData = {
                                                                                  w: $(image).width(),
                                                                                  h: $(image).height(),
                                                                                  l: $(image).position().left,
                                                                                  t: $(image).position().top
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 2 other locations - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1773..1778
                                                                        assets/js/d3photo-view.js on lines 1779..1784

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

                                                                                modalData = {
                                                                                  w: $(modal).width(),
                                                                                  h: $(modal).height(),
                                                                                  l: $(modal).offset().left,
                                                                                  t: $(modal).offset().top
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 2 other locations - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1779..1784
                                                                        assets/js/d3photo-view.js on lines 1785..1790

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

                                                                                stageData = {
                                                                                  w: $(stage).width(),
                                                                                  h: $(stage).height(),
                                                                                  l: $(stage).offset().left,
                                                                                  t: $(stage).offset().top
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 2 other locations - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1773..1778
                                                                        assets/js/d3photo-view.js on lines 1785..1790

                                                                        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

                                                                                  case 173:
                                                                                    this.zoom(-this.options.ratioThreshold * 3, {
                                                                                      x: this.$stage.width() / 2,
                                                                                      y: this.$stage.height() / 2
                                                                                    }, e);
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 2482..2487

                                                                        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

                                                                                  case 189:
                                                                                    this.zoom(-this.options.ratioThreshold * 3, {
                                                                                      x: this.$stage.width() / 2,
                                                                                      y: this.$stage.height() / 2
                                                                                    }, e);
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 2498..2503

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

                                                                                var imgTop = (heightDiff > 0 ? $(image).position().top : $(image).position().top < 0 ? $(image).position().top : 0) + δ;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 2 other locations - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1730..1730
                                                                        assets/js/d3photo-view.js on lines 1731..1731

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

                                                                        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

                                                                                var imgLeft2 = (widthDiff2 > 0 ? $(image).position().left : $(image).position().left < 0 ? $(image).position().left : 0) - δ;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 2 other locations - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1729..1729
                                                                        assets/js/d3photo-view.js on lines 1731..1731

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

                                                                        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

                                                                                var imgTop2 = (heightDiff2 > 0 ? $(image).position().top : $(image).position().top < 0 ? $(image).position().top : 0) + δ;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 2 other locations - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 1729..1729
                                                                        assets/js/d3photo-view.js on lines 1730..1730

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

                                                                        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

                                                                                  case 187:
                                                                                    this.zoom(this.options.ratioThreshold * 3, {
                                                                                      x: this.$stage.width() / 2,
                                                                                      y: this.$stage.height() / 2
                                                                                    }, e);
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 2490..2495

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

                                                                        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

                                                                                  case 61:
                                                                                    this.zoom(this.options.ratioThreshold * 3, {
                                                                                      x: this.$stage.width() / 2,
                                                                                      y: this.$stage.height() / 2
                                                                                    }, e);
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 2 hrs to fix
                                                                        assets/js/d3photo-view.js on lines 2474..2479

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

                                                                        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 heightDiff2 = -offsetY + modalData.h > minHeight ? stageData.h - imgHeight - offsetY + δ : minHeight - (modalData.h - stageData.h) - imgHeight + δ; // Get image position in dragging
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 1725..1725

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

                                                                        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 widthDiff2 = -offsetX + modalData.w > minWidth ? stageData.w - imgWidth - offsetX - δ : minWidth - (modalData.w - stageData.w) - imgWidth - δ;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 1726..1726

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

                                                                        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 heightDiff = offsetY + modalData.h > minHeight ? stageData.h - imgHeight + offsetY + δ : minHeight - (modalData.h - stageData.h) - imgHeight + δ;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 1723..1723

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

                                                                        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 widthDiff = offsetX + modalData.w > minWidth ? stageData.w - imgWidth + offsetX - δ : minWidth - (modalData.w - stageData.w) - imgWidth - δ;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 1724..1724

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

                                                                        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 (value === undefined) return hasScrollLeft
                                                                              ? this[0].scrollLeft
                                                                              : isWindow(this[0])
                                                                                ? this[0].pageXOffset
                                                                                : this[0].defaultView.pageXOffset;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 611..615

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 59.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                            if (value === undefined) return hasScrollTop
                                                                              ? this[0].scrollTop
                                                                              : isWindow(this[0])
                                                                                ? this[0].pageYOffset
                                                                                : this[0].defaultView.pageYOffset;
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 624..628

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 59.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                var modalWidth = img.width + parseFloat(stageCSS.left) + parseFloat(stageCSS.right) + parseFloat(stageCSS.borderLeft) + parseFloat(stageCSS.borderRight);
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 2082..2082

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

                                                                        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 modalHeight = img.height + parseFloat(stageCSS.top) + parseFloat(stageCSS.bottom) + parseFloat(stageCSS.borderTop) + parseFloat(stageCSS.borderBottom);
                                                                        Severity: Major
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 1 hr to fix
                                                                        assets/js/d3photo-view.js on lines 2081..2081

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

                                                                        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 (selector[0] == '<' && fragmentRE.test(selector)) {
                                                                                  dom = D.fragment(selector, RegExp.$1, context);
                                                                                  selector = null;
                                                                                }
                                                                                // If there's a context, create a collection on that context first, and select
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 55 mins to fix
                                                                        assets/js/d3photo-view.js on lines 241..252

                                                                        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

                                                                              else if (isObject(selector)) {
                                                                                dom = [selector], selector = null;
                                                                              }
                                                                              // If there's a context, create a collection on that context first, and select
                                                                              // nodes from there
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 55 mins to fix
                                                                        assets/js/d3photo-view.js on lines 214..226

                                                                        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

                                                                                  e: {
                                                                                    left: widthDiff >= -δ ? (widthDiff - δ) / 2 + 'px' : imgLeft > widthDiff ? imgLeft + 'px' : widthDiff + 'px'
                                                                                  },
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 55 mins to fix
                                                                        assets/js/d3photo-view.js on lines 1743..1745

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 53.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                  w: {
                                                                                    left: widthDiff2 >= -δ ? (widthDiff2 - δ) / 2 + 'px' : imgLeft2 > widthDiff2 ? imgLeft2 + 'px' : widthDiff2 + 'px'
                                                                                  },
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 55 mins to fix
                                                                        assets/js/d3photo-view.js on lines 1733..1735

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 53.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                  n: {
                                                                                    top: heightDiff2 >= δ ? (heightDiff2 + δ) / 2 + 'px' : imgTop2 > heightDiff2 ? imgTop2 + 'px' : heightDiff2 + 'px'
                                                                                  },
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 50 mins to fix
                                                                        assets/js/d3photo-view.js on lines 1736..1738

                                                                        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

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

                                                                                  s: {
                                                                                    top: heightDiff >= δ ? (heightDiff + δ) / 2 + 'px' : imgTop > heightDiff ? imgTop + 'px' : heightDiff + 'px'
                                                                                  },
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 50 mins to fix
                                                                        assets/js/d3photo-view.js on lines 1746..1748

                                                                        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

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

                                                                                var modalTop = -offsetY + modalData.h > minHeight ? offsetY + modalData.t : modalData.t + modalData.h - minHeight;
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 45 mins to fix
                                                                        assets/js/d3photo-view.js on lines 1678..1678

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 50.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                var modalLeft = -offsetX + modalData.w > minWidth ? offsetX + modalData.l : modalData.l + modalData.w - minWidth;
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 45 mins to fix
                                                                        assets/js/d3photo-view.js on lines 1679..1679

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 50.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                if (this.options.initAnimation && !this.options.progressiveLoading) {
                                                                                  this.$image.hide();
                                                                                }
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 30 mins to fix
                                                                        assets/js/d3photo-view.js on lines 2162..2164

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 45.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

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

                                                                                  if (this.options.initAnimation && !this.options.progressiveLoading) {
                                                                                    this.$image.fadeIn();
                                                                                  }
                                                                        Severity: Minor
                                                                        Found in assets/js/d3photo-view.js and 1 other location - About 30 mins to fix
                                                                        assets/js/d3photo-view.js on lines 2185..2187

                                                                        Duplicated Code

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

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

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

                                                                        Tuning

                                                                        This issue has a mass of 45.

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

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

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

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

                                                                        Refactorings

                                                                        Further Reading

                                                                        There are no issues that match your filters.

                                                                        Category
                                                                        Status