woothemes/woocommerce

View on GitHub
assets/js/zeroclipboard/jquery.zeroclipboard.js

Summary

Maintainability
F
1 wk
Test Coverage

File jquery.zeroclipboard.js has 1417 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jquery.zeroclipboard
 * Bind to the `beforecopy`, `copy`, `aftercopy`, and `copy-error` events, custom DOM-like events for clipboard injection generated using jQuery's Special Events API and ZeroClipboard's Core module.
 * Copyright (c) 2014 
 * Licensed MIT
Severity: Major
Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 3 days to fix

    Function _preprocessEvent has 105 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var _preprocessEvent = function(event) {
          var element = event.target || _currentElement || null;
          var sourceIsSwf = event._source === "swf";
          delete event._source;
          var flashErrorNames = [ "flash-disabled", "flash-outdated", "flash-unavailable", "flash-deactivated", "flash-overdue" ];
    Severity: Major
    Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 4 hrs to fix

      Function _detectFlashSupport has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var _detectFlashSupport = function(ActiveXObject) {
            var plugin, ax, mimeType, hasFlash = false, isActiveX = false, isPPAPI = false, flashVersion = "";
            /**
         * Derived from Apple's suggested sniffer.
         * @param {String} desc e.g. "Shockwave Flash 7.0 r61"
      Severity: Major
      Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 2 hrs to fix

        Function _createEvent has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var _createEvent = function(event) {
              var eventType;
              if (typeof event === "string" && event) {
                eventType = event;
                event = {};
        Severity: Major
        Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {
                  do {
                    if (el === ancestorEl) {
                      return true;
                    }
          Severity: Critical
          Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 2 hrs to fix

            Function _determineScriptAccess has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var _determineScriptAccess = function() {
                  var _extractAllDomains = function(origins) {
                    var i, len, tmp, resultsArray = [];
                    if (typeof origins === "string") {
                      origins = [ origins ];
            Severity: Minor
            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if (!(_clipData["text/html"] || _clipData["text/plain"]) && targetEl && (htmlContent = targetEl.value || targetEl.outerHTML || targetEl.innerHTML) && (textContent = targetEl.value || targetEl.textContent || targetEl.innerText)) {
                        event.clipboardData.clearData();
                        event.clipboardData.setData("text/plain", textContent);
                        if (htmlContent !== textContent) {
                          event.clipboardData.setData("text/html", htmlContent);
              Severity: Critical
              Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

                Function _addMouseData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var _addMouseData = function(event) {
                      if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
                        var srcElement = event.target;
                        var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
                        var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined;
                Severity: Minor
                Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                      var _mapClipDataToFlash = function(clipData) {
                        var newClipData = {}, formatMap = {};
                        if (!(typeof clipData === "object" && clipData)) {
                          return;
                        }
                  Severity: Minor
                  Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                        var _on = function(eventType, listener) {
                          var i, len, events, added = {};
                          if (typeof eventType === "string" && eventType) {
                            events = eventType.toLowerCase().split(/\s+/);
                          } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
                    Severity: Minor
                    Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                          var _swfPath = function() {
                            var i, jsDir, tmpJsPath, jsPath, swfPath = "ZeroClipboard.swf";
                            if (!(_document.currentScript && (jsPath = _document.currentScript.src))) {
                              var scripts = _document.getElementsByTagName("script");
                              if ("readyState" in scripts[0]) {
                      Severity: Minor
                      Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                            var _unembedSwf = function() {
                              var flashBridge = _flashState.bridge;
                              if (flashBridge) {
                                var htmlBridge = _getHtmlBridge(flashBridge);
                                if (htmlBridge) {
                        Severity: Minor
                        Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                              var _vars = function(options) {
                                var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
                                if (options.trustedDomains) {
                                  if (typeof options.trustedDomains === "string") {
                                    domains = [ options.trustedDomains ];
                          Severity: Minor
                          Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                  if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
                                    var srcElement = event.target;
                                    var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
                                    var toElement = event.type === "_mouseout" && event.relatedTarget ? event.relatedTarget : undefined;
                                    var pos = _getDOMObjectPosition(srcElement);
                            Severity: Critical
                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                                  var _off = function(eventType, listener) {
                                    var i, len, foundIndex, events, perEventHandlers;
                                    if (arguments.length === 0) {
                                      events = _keys(_handlers);
                                    } else if (typeof eventType === "string" && eventType) {
                              Severity: Minor
                              Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                                    var _embedSwf = function() {
                                      var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
                                      if (!flashBridge) {
                                        var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
                                        var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
                                Severity: Minor
                                Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                                      var _addClass = function(element, value) {
                                        if (!element || element.nodeType !== 1) {
                                          return element;
                                        }
                                        if (element.classList) {
                                  Severity: Minor
                                  Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                                        var _dispatchCallbacks = function(event) {
                                          if (!(typeof event === "object" && event && event.type)) {
                                            return;
                                          }
                                          var async = _shouldPerformAsync(event);
                                    Severity: Minor
                                    Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                                          var _config = function(options) {
                                            if (typeof options === "object" && options !== null) {
                                              for (var prop in options) {
                                                if (_hasOwn.call(options, prop)) {
                                                  if (/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(prop)) {
                                      Severity: Minor
                                      Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

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

                                            function convertHtmlToRtf(html) {
                                              if (!(typeof html === "string" && html)) {
                                                return null;
                                              }
                                              var tmpRichText, hasHyperlinks, richText = html;
                                        Severity: Minor
                                        Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 1 hr to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                        while (foundIndex !== -1) {
                                                          perEventHandlers.splice(foundIndex, 1);
                                                          foundIndex = perEventHandlers.indexOf(listener, foundIndex);
                                                        }
                                          Severity: Major
                                          Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                        if (jsDir == null) {
                                                          jsDir = tmpJsPath;
                                                        } else if (jsDir !== tmpJsPath) {
                                                          jsDir = null;
                                                          break;
                                            Severity: Major
                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                              if (flashBridge.parentNode) {
                                                                flashBridge.parentNode.removeChild(flashBridge);
                                                              }
                                              Severity: Major
                                              Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                for (var prop in flashBridge) {
                                                                  if (typeof flashBridge[prop] === "function") {
                                                                    flashBridge[prop] = null;
                                                                  }
                                                                }
                                                Severity: Major
                                                Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                              if (!tmpJsPath) {
                                                                jsDir = null;
                                                                break;
                                                              }
                                                  Severity: Major
                                                  Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                  if (className.indexOf(" " + classNames[c] + " ") < 0) {
                                                                    setClass += " " + classNames[c];
                                                                  }
                                                    Severity: Major
                                                    Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                    if (prop === "containerId" || prop === "swfObjectId") {
                                                                      if (_isValidHtml4Id(options[prop])) {
                                                                        _globalConfig[prop] = options[prop];
                                                                      } else {
                                                                        throw new Error("The specified `" + prop + "` value is not valid as an HTML4 Element ID");
                                                      Severity: Major
                                                      Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                      if (target !== copy && copy !== undefined) {
                                                                        target[prop] = copy;
                                                                      }
                                                        Severity: Major
                                                        Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                          if (htmlBridge.parentNode) {
                                                                            htmlBridge.parentNode.removeChild(htmlBridge);
                                                                          }
                                                          Severity: Major
                                                          Found in assets/js/zeroclipboard/jquery.zeroclipboard.js - About 45 mins to fix

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

                                                                    if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
                                                                      if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
                                                                        _fireMouseEvent(_extend({}, event, {
                                                                          type: "mouseleave",
                                                                          bubbles: false,
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 3 hrs to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 823..834

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

                                                            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 (_globalConfig.bubbleEvents === true && sourceIsSwf) {
                                                                      if (element && element !== event.relatedTarget && !_containedBy(event.relatedTarget, element)) {
                                                                        _fireMouseEvent(_extend({}, event, {
                                                                          type: "mouseenter",
                                                                          bubbles: false,
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 3 hrs to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 839..850

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

                                                            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 (typeof eventType === "string" && eventType) {
                                                                    events = eventType.split(/\s+/);
                                                                  } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
                                                                    for (i in eventType) {
                                                                      if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 3 hrs to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 331..339

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

                                                            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 (typeof eventType === "string" && eventType) {
                                                                    events = eventType.toLowerCase().split(/\s+/);
                                                                  } else if (typeof eventType === "object" && eventType && typeof listener === "undefined") {
                                                                    for (i in eventType) {
                                                                      if (_hasOwn.call(eventType, i) && typeof i === "string" && i && typeof eventType[i] === "function") {
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 3 hrs to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 377..385

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

                                                            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 ($event.target && $event.target !== ZeroClipboard.activeElement() && $event.target !== $("#" + ZeroClipboard.config("containerId"))[0] && $event.target !== $("#" + ZeroClipboard.config("swfObjectId"))[0]) {
                                                                    ZeroClipboard.focus($event.target);
                                                                  }
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 2 hrs to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 1785..1787

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

                                                            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 ($event.relatedTarget && $event.relatedTarget !== ZeroClipboard.activeElement() && $event.relatedTarget !== $("#" + ZeroClipboard.config("containerId"))[0] && $event.relatedTarget !== $("#" + ZeroClipboard.config("swfObjectId"))[0]) {
                                                                    ZeroClipboard.blur();
                                                                  }
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 2 hrs to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 1779..1781

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

                                                            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 "_mouseup":
                                                                    _removeClass(element, _globalConfig.activeClass);
                                                                    if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
                                                                      _fireMouseEvent(_extend({}, event, {
                                                                        type: event.type.slice(1)
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 1 hr to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 853..860

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

                                                            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 namespaces = customEventNamespace + (handleObj.namespace ? "." + handleObj.namespace : ""), selector = handleObj.selector, zcDataKey = "zc|{" + selector + "}|{" + namespaces + "}|count", $this = $(this);
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 1 hr to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 1800..1800

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

                                                            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 namespaces = customEventNamespace + (handleObj.namespace ? "." + handleObj.namespace : ""), selector = handleObj.selector, zcDataKey = "zc|{" + selector + "}|{" + namespaces + "}|count", $this = $(this);
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 1 hr to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 1817..1817

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

                                                            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 "_mousedown":
                                                                    _addClass(element, _globalConfig.activeClass);
                                                                    if (_globalConfig.bubbleEvents === true && sourceIsSwf) {
                                                                      _fireMouseEvent(_extend({}, event, {
                                                                        type: event.type.slice(1)
                                                            Severity: Major
                                                            Found in assets/js/zeroclipboard/jquery.zeroclipboard.js and 1 other location - About 1 hr to fix
                                                            assets/js/zeroclipboard/jquery.zeroclipboard.js on lines 862..869

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

                                                            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