SUSE/hackweek

View on GitHub
app/assets/javascripts/holder.js

Summary

Maintainability
F
3 wks
Test Coverage

File holder.js has 3089 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!

Holder - client side image placeholders
Version 2.9.9+jl7z
© 2021 Ivan Malopinsky - https://imsky.co
Severity: Major
Found in app/assets/javascripts/holder.js - About 1 wk to fix

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

        function buildSceneGraph(scene) {
            var fontSize = App.defaults.size;
            var fixedSize = scene.flags.fixedSize != null ? scene.flags.fixedSize : scene.theme.fixedSize;
            if (parseFloat(scene.theme.size)) {
                fontSize = scene.theme.size;
    Severity: Major
    Found in app/assets/javascripts/holder.js - About 5 hrs to fix

      Function shaven has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function shaven(arrayOrObject) {
            var isArray = Array.isArray(arrayOrObject);
            var objType = typeof arrayOrObject === 'undefined' ? 'undefined' : _typeof(arrayOrObject);
      
            if (!isArray && objType !== 'object') {
      Severity: Major
      Found in app/assets/javascripts/holder.js - About 5 hrs to fix

        Function prepareDOMElement has 114 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function prepareDOMElement(prepSettings) {
                var mode = prepSettings.mode;
                var el = prepSettings.el;
                var flags = prepSettings.flags;
                var _engineSettings = prepSettings.engineSettings;
        Severity: Major
        Found in app/assets/javascripts/holder.js - About 4 hrs to fix

          Function run has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  run: function(userOptions) {
                      //todo: split processing into separate queues
                      userOptions = userOptions || {};
                      var engineSettings = {};
                      var options = extend(App.settings, userOptions);
          Severity: Major
          Found in app/assets/javascripts/holder.js - About 4 hrs to fix

            Function _onDomReady has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function _onDomReady(win) {
                    //Lazy loading fix for Firefox < 3.6
                    //http://webreflection.blogspot.com/2009/11/195-chars-to-help-lazy-loading.html
                    if (document.readyState == null && document.addEventListener) {
                        document.addEventListener("DOMContentLoaded", function DOMContentLoaded() {
            Severity: Major
            Found in app/assets/javascripts/holder.js - About 3 hrs to fix

              Function buildDom has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function buildDom(elemArray) {
                      if (Array.isArray(elemArray) && elemArray.length === 0) {
                        // Ignore empty arrays
                        return {};
                      }
              Severity: Major
              Found in app/assets/javascripts/holder.js - About 3 hrs to fix

                Function SceneGraph has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var SceneGraph = function(sceneProperties) {
                        var nodeCount = 1;
                
                        //todo: move merge to helpers section
                        function merge(parent, child) {
                Severity: Major
                Found in app/assets/javascripts/holder.js - About 3 hrs to fix

                  Function render has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function render(renderSettings) {
                          var image = null;
                          var mode = renderSettings.mode;
                          var el = renderSettings.el;
                          var holderSettings = renderSettings.holderSettings;
                  Severity: Major
                  Found in app/assets/javascripts/holder.js - About 3 hrs to fix

                    Function formatValue has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function formatValue(ctx, value, recurseTimes) {
                          // Provide a hook for user-specified inspect functions.
                          // Check that value is an object with an inspect function on it
                          if (ctx.customInspect &&
                              value &&
                    Severity: Major
                    Found in app/assets/javascripts/holder.js - About 3 hrs to fix

                      Function exports has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          module.exports = function (sceneGraph, renderSettings) {
                            var engineSettings = renderSettings.engineSettings;
                            var stylesheets = engineSettings.stylesheets;
                            var stylesheetXml = stylesheets.map(function (stylesheet) {
                              return '<?xml-stylesheet rel="stylesheet" href="' + stylesheet + '"?>';
                      Severity: Major
                      Found in app/assets/javascripts/holder.js - About 3 hrs to fix

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

                            var stagingRenderer = (function() {
                                var svg = null,
                                    stagingText = null,
                                    stagingTextNode = null;
                                return function(graph) {
                        Severity: Major
                        Found in app/assets/javascripts/holder.js - About 3 hrs to fix

                          Function parseURL has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function parseURL(url, instanceOptions) {
                                  var holder = {
                                      theme: extend(App.settings.themes.gray, null),
                                      stylesheets: instanceOptions.stylesheets,
                                      instanceOptions: instanceOptions
                          Severity: Major
                          Found in app/assets/javascripts/holder.js - About 2 hrs to fix

                            Function formatProperty has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
                                  var name, str, desc;
                                  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
                                  if (desc.get) {
                                    if (desc.set) {
                            Severity: Major
                            Found in app/assets/javascripts/holder.js - About 2 hrs to fix

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

                                  function updateResizableElements(element) {
                                      var images;
                                      if (element == null || element.nodeType == null) {
                                          images = App.vars.resizableImages;
                                      } else {
                              Severity: Minor
                              Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                    module.exports = (function() {
                                        var canvas = DOM.newEl('canvas');
                                        var ctx = null;
                                
                                        return function(sceneGraph) {
                                Severity: Minor
                                Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                      exports.initSVG = function(svg, width, height) {
                                          var defs, style, initialize = false;
                                  
                                          if (svg && svg.querySelector) {
                                              style = svg.querySelector('style');
                                  Severity: Minor
                                  Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                        exports.parse = function(str){
                                          if ('string' !== typeof str) return {};
                                    
                                          str = trim(str);
                                          if ('' === str) return {};
                                    Severity: Minor
                                    Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                          function _deepEqual(actual, expected, strict, memos) {
                                            // 7.1. All identical values are equivalent, as determined by ===.
                                            if (actual === expected) {
                                              return true;
                                            } else if (isBuffer(actual) && isBuffer(expected)) {
                                      Severity: Minor
                                      Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                            exports.format = function(f) {
                                              if (!isString(f)) {
                                                var objects = [];
                                                for (var i = 0; i < arguments.length; i++) {
                                                  objects.push(inspect(arguments[i]));
                                        Severity: Minor
                                        Found in app/assets/javascripts/holder.js - About 1 hr to fix

                                          Function objEquiv has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                              function objEquiv(a, b, strict, actualVisitedObjects) {
                                                if (a === null || a === undefined || b === null || b === undefined)
                                                  return false;
                                                // if one is a primitive, the other must be same
                                                if (util.isPrimitive(a) || util.isPrimitive(b))
                                          Severity: Minor
                                          Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                                function shouldUseNative() {
                                                    try {
                                                        if (!Object.assign) {
                                                            return false;
                                                        }
                                            Severity: Minor
                                            Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                                  Color.hsl2rgb = function (h, s, l) {
                                                      var H = h / 60;
                                                      var C = (1 - Math.abs(2 * l - 1)) * s;
                                                      var X = C * (1 - Math.abs(parseInt(H) % 2 - 1));
                                                      var m = l - (C / 2);
                                              Severity: Minor
                                              Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                                    global.atob = global.atob || function (input) {
                                                      input = String(input);
                                                      var position = 0,
                                                          output = [],
                                                          buffer = 0, bits = 0, n;
                                                Severity: Minor
                                                Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                                      exports.parseColor = function(val) {
                                                          var hexre = /(^(?:#?)[0-9a-f]{6}$)|(^(?:#?)[0-9a-f]{3}$)/i;
                                                          var rgbre = /^rgb\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/;
                                                          var rgbare = /^rgba\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0*\.\d{1,}|1)\)$/;
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                                        assert.AssertionError = function AssertionError(options) {
                                                          this.name = 'AssertionError';
                                                          this.actual = options.actual;
                                                          this.expected = options.expected;
                                                          this.operator = options.operator;
                                                    Severity: Minor
                                                    Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                                          function _throws(shouldThrow, block, expected, message) {
                                                            var actual;
                                                      
                                                            if (typeof block !== 'function') {
                                                              throw new TypeError('"block" argument must be a function');
                                                      Severity: Minor
                                                      Found in app/assets/javascripts/holder.js - About 1 hr to fix

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

                                                            global.btoa = global.btoa || function (input) {
                                                              input = String(input);
                                                              var position = 0,
                                                                  out = [],
                                                                  o1, o2, o3,
                                                        Severity: Minor
                                                        Found in app/assets/javascripts/holder.js - About 1 hr to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                      if (canvas.getContext) {
                                                                          var ctx = canvas.getContext('2d');
                                                                          devicePixelRatio = global.devicePixelRatio || 1;
                                                                          backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
                                                                      }
                                                          Severity: Major
                                                          Found in app/assets/javascripts/holder.js - About 1 hr to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                          for (var attributeKey in array[index]) {
                                                                            if (!array[index].hasOwnProperty(attributeKey)) continue;
                                                            
                                                                            var attributeValue = array[index][attributeKey];
                                                            
                                                            
                                                            Severity: Major
                                                            Found in app/assets/javascripts/holder.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                      switch (fluidConfig.mode) {
                                                                                          case 'width':
                                                                                              dimensions.height = dimensions.width / fluidConfig.ratio;
                                                                                              break;
                                                                                          case 'height':
                                                              Severity: Major
                                                              Found in app/assets/javascripts/holder.js - About 45 mins to fix

                                                                Function formatProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                Open

                                                                    function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
                                                                Severity: Minor
                                                                Found in app/assets/javascripts/holder.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                  if (index !== 0) continue;
                                                                  Severity: Major
                                                                  Found in app/assets/javascripts/holder.js - About 45 mins to fix

                                                                    Consider simplifying this complex logical expression.
                                                                    Open

                                                                          if (ctx.customInspect &&
                                                                              value &&
                                                                              isFunction(value.inspect) &&
                                                                              // Filter out the util module, it's inspect function is special
                                                                              value.inspect !== exports.inspect &&
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/holder.js - About 40 mins to fix

                                                                      Consider simplifying this complex logical expression.
                                                                      Open

                                                                            } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
                                                                              return actual.source === expected.source &&
                                                                                     actual.global === expected.global &&
                                                                                     actual.multiline === expected.multiline &&
                                                                                     actual.lastIndex === expected.lastIndex &&
                                                                      Severity: Major
                                                                      Found in app/assets/javascripts/holder.js - About 40 mins to fix

                                                                        Consider simplifying this complex logical expression.
                                                                        Open

                                                                              if ((shouldThrow && actual && expected &&
                                                                                  !expectedException(actual, expected)) || (!shouldThrow && actual)) {
                                                                                throw actual;
                                                                              }
                                                                        Severity: Major
                                                                        Found in app/assets/javascripts/holder.js - About 40 mins to fix

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

                                                                              function fail(actual, expected, message, operator, stackStartFunction) {
                                                                          Severity: Minor
                                                                          Found in app/assets/javascripts/holder.js - About 35 mins to fix

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

                                                                                function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
                                                                            Severity: Minor
                                                                            Found in app/assets/javascripts/holder.js - About 35 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                      return compare(new Uint8Array(actual.buffer),
                                                                                                     new Uint8Array(expected.buffer)) === 0;
                                                                              Severity: Major
                                                                              Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                      return false;
                                                                                Severity: Major
                                                                                Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                                  return cachedClearTimeout.call(this, marker);
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                              return false;
                                                                                    Severity: Major
                                                                                    Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                            return expected.call({}, actual) === true;
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                    return true;
                                                                                        Severity: Major
                                                                                        Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                  return false;
                                                                                          Severity: Major
                                                                                          Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                  return true;
                                                                                            Severity: Major
                                                                                            Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                        return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
                                                                                              Severity: Major
                                                                                              Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                      return reduceToSingleString(output, base, braces);
                                                                                                Severity: Major
                                                                                                Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                          return objEquiv(actual, expected, strict, memos);
                                                                                                  Severity: Major
                                                                                                  Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                            return null;
                                                                                                    Severity: Major
                                                                                                    Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                              return braces[0] + base + braces[1];
                                                                                                      Severity: Major
                                                                                                      Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                return true;
                                                                                                        Severity: Major
                                                                                                        Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                  return true;
                                                                                                          Severity: Major
                                                                                                          Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                    return strict ? actual === expected : actual == expected;
                                                                                                            Severity: Major
                                                                                                            Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                          return false;
                                                                                                              Severity: Major
                                                                                                              Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                        return false;
                                                                                                                Severity: Major
                                                                                                                Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                            return false;
                                                                                                                  Severity: Major
                                                                                                                  Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                              return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
                                                                                                                    Severity: Major
                                                                                                                    Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                                      return cachedSetTimeout.call(this, fun, 0);
                                                                                                                      Severity: Major
                                                                                                                      Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                return _deepEqual(a, b, strict);
                                                                                                                        Severity: Major
                                                                                                                        Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                      return true;
                                                                                                                          Severity: Major
                                                                                                                          Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                  return typeof val;
                                                                                                                            Severity: Major
                                                                                                                            Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                        return ctx.stylize(Date.prototype.toString.call(value), 'date');
                                                                                                                              Severity: Major
                                                                                                                              Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                          return formatError(value);
                                                                                                                                Severity: Major
                                                                                                                                Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                  Open

                                                                                                                                          return ctx.stylize('null', 'null');
                                                                                                                                  Severity: Major
                                                                                                                                  Found in app/assets/javascripts/holder.js - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                    Open

                                                                                                                                              return ctx.stylize('[Object]', 'special');
                                                                                                                                    Severity: Major
                                                                                                                                    Found in app/assets/javascripts/holder.js - About 30 mins to fix

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

                                                                                                                                          var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
                                                                                                                                      Severity: Major
                                                                                                                                      Found in app/assets/javascripts/holder.js and 2 other locations - About 3 hrs to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 3024..3024
                                                                                                                                      app/assets/javascripts/holder.js on lines 3089..3089

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

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                          var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
                                                                                                                                      Severity: Major
                                                                                                                                      Found in app/assets/javascripts/holder.js and 2 other locations - About 3 hrs to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 2732..2732
                                                                                                                                      app/assets/javascripts/holder.js on lines 3024..3024

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

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                          var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
                                                                                                                                      Severity: Major
                                                                                                                                      Found in app/assets/javascripts/holder.js and 2 other locations - About 3 hrs to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 2732..2732
                                                                                                                                      app/assets/javascripts/holder.js on lines 3089..3089

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

                                                                                                                                      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 (dimensions.width.slice(-1) == '%') {
                                                                                                                                                      el.style.width = dimensions.width;
                                                                                                                                                  } else if (flags.auto == null || !flags.auto) {
                                                                                                                                                      el.style.width = dimensions.width + 'px';
                                                                                                                                                  }
                                                                                                                                      Severity: Major
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 2 hrs to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 839..843

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

                                                                                                                                      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 (dimensions.height.slice(-1) == '%') {
                                                                                                                                                      el.style.height = dimensions.height;
                                                                                                                                                  } else if (flags.auto == null || !flags.auto) {
                                                                                                                                                      el.style.height = dimensions.height + 'px';
                                                                                                                                                  }
                                                                                                                                      Severity: Major
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 2 hrs to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 844..848

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

                                                                                                                                      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 (window.mozRequestAnimationFrame && window.mozCancelAnimationFrame) {
                                                                                                                                            //https://github.com/Financial-Times/polyfill-service/blob/master/polyfills/requestAnimationFrame/polyfill-moz.js
                                                                                                                                          (function (global) {
                                                                                                                                            global.requestAnimationFrame = function (callback) {
                                                                                                                                              return mozRequestAnimationFrame(function () {
                                                                                                                                      Severity: Major
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 2 hrs to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 213..243

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 81.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                          if (window.webkitRequestAnimationFrame && window.webkitCancelAnimationFrame) {
                                                                                                                                          //https://github.com/Financial-Times/polyfill-service/blob/master/polyfills/requestAnimationFrame/polyfill-webkit.js
                                                                                                                                          (function (global) {
                                                                                                                                            global.requestAnimationFrame = function (callback) {
                                                                                                                                              return webkitRequestAnimationFrame(function () {
                                                                                                                                      Severity: Major
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 2 hrs to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 224..243

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 81.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                          assert.strictEqual = function strictEqual(actual, expected, message) {
                                                                                                                                            if (actual !== expected) {
                                                                                                                                              fail(actual, expected, message, '===', assert.strictEqual);
                                                                                                                                            }
                                                                                                                                          };
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 55 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 3339..3343

                                                                                                                                      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

                                                                                                                                          assert.notEqual = function notEqual(actual, expected, message) {
                                                                                                                                            if (actual == expected) {
                                                                                                                                              fail(actual, expected, message, '!=', assert.notEqual);
                                                                                                                                            }
                                                                                                                                          };
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 55 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 3492..3496

                                                                                                                                      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

                                                                                                                                              for (var x in a) {
                                                                                                                                                  if (Object.prototype.hasOwnProperty.call(a,x)) {
                                                                                                                                                      c[x] = a[x];
                                                                                                                                                  }
                                                                                                                                              }
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 50 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 1983..1987

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 52.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                              try {
                                                                                                                                                  if (typeof clearTimeout === 'function') {
                                                                                                                                                      cachedClearTimeout = clearTimeout;
                                                                                                                                                  } else {
                                                                                                                                                      cachedClearTimeout = defaultClearTimeout;
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 50 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 4326..4334

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 52.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                              try {
                                                                                                                                                  if (typeof setTimeout === 'function') {
                                                                                                                                                      cachedSetTimeout = setTimeout;
                                                                                                                                                  } else {
                                                                                                                                                      cachedSetTimeout = defaultSetTimout;
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 50 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 4335..4343

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 52.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                                  for (var y in b) {
                                                                                                                                                      if (Object.prototype.hasOwnProperty.call(b, y)) {
                                                                                                                                                          c[y] = b[y];
                                                                                                                                                      }
                                                                                                                                                  }
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 50 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 1977..1981

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 52.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                          assert.deepEqual = function deepEqual(actual, expected, message) {
                                                                                                                                            if (!_deepEqual(actual, expected, false)) {
                                                                                                                                              fail(actual, expected, message, 'deepEqual', assert.deepEqual);
                                                                                                                                            }
                                                                                                                                          };
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 45 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 3354..3358

                                                                                                                                      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

                                                                                                                                          assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
                                                                                                                                            if (!_deepEqual(actual, expected, true)) {
                                                                                                                                              fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
                                                                                                                                            }
                                                                                                                                          };
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 45 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 3348..3352

                                                                                                                                      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

                                                                                                                                                (0, _assert2.default)(!config.returnObject.ids.hasOwnProperty(properties.id), 'Ids must be unique and "' + properties.id + '" is already assigned');
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 40 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 2808..2808

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

                                                                                                                                      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

                                                                                                                                                (0, _assert2.default)(!config.returnObject.ids.hasOwnProperty(properties.reference), 'References must be unique and "' + properties.id + '" is already assigned');
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 40 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 2801..2801

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

                                                                                                                                      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 g = Ca.alpha * Ca.rgb.g + (1 - Ca.alpha) * Cb.rgb.g;
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 35 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 2533..2533

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 47.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                              var b = Ca.alpha * Ca.rgb.b + (1 - Ca.alpha) * Cb.rgb.b;
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 35 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 2532..2532

                                                                                                                                      Duplicated Code

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

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

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

                                                                                                                                      Tuning

                                                                                                                                      This issue has a mass of 47.

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                                          if (el.nodeName.toLowerCase() === 'img') {
                                                                                                                                                              DOM.setAttr(el, {
                                                                                                                                                                  'src': image
                                                                                                                                                              });
                                                                                                                                                          } else if (el.nodeName.toLowerCase() === 'object') {
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 35 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 928..937

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

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

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

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

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

                                                                                                                                      Refactorings

                                                                                                                                      Further Reading

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

                                                                                                                                                  if (el.nodeName.toLowerCase() === 'img') {
                                                                                                                                                      DOM.setAttr(el, {
                                                                                                                                                          'src': image
                                                                                                                                                      });
                                                                                                                                                  } else if (el.nodeName.toLowerCase() === 'object') {
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in app/assets/javascripts/holder.js and 1 other location - About 35 mins to fix
                                                                                                                                      app/assets/javascripts/holder.js on lines 945..954

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

                                                                                                                                      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