zammad/zammad

View on GitHub
app/assets/javascripts/app/lib/flot/jquery.flot.js

Summary

Maintainability
F
1 mo
Test Coverage

Function Plot has 1911 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Plot(placeholder, data_, options_, plugins) {
        // data is on the form:
        //   [ series1, series2 ... ]
        // where series is either just the data as [ [x1, y1], [x2, y2], ... ]
        // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... }
Severity: Major
Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 wk to fix

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

    /*! Javascript plotting library for jQuery, v. 0.7.
     *
     * Released under the MIT license by IOLA, December 2007.
     *
     */
    Severity: Major
    Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 5 days to fix

      Function setupTickGeneration has 210 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function setupTickGeneration(axis) {
                  var opts = axis.options;
                      
                  // estimate number of ticks
                  var noTicks;
      Severity: Major
      Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 day to fix

        Function drawSeriesLines has 187 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function drawSeriesLines(series) {
                    function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                        var points = datapoints.points,
                            ps = datapoints.pointsize,
                            prevx = null, prevy = null;
        Severity: Major
        Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 7 hrs to fix

          Function processData has 149 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function processData() {
                      var topSentry = Number.POSITIVE_INFINITY,
                          bottomSentry = Number.NEGATIVE_INFINITY,
                          fakeInfinity = Number.MAX_VALUE,
                          i, j, k, m, length,
          Severity: Major
          Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 5 hrs to fix

            Function drawGrid has 128 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function drawGrid() {
                        var i;
                        
                        ctx.save();
                        ctx.translate(plotOffset.left, plotOffset.top);
            Severity: Major
            Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 5 hrs to fix

              Function plotLineArea has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function plotLineArea(datapoints, axisx, axisy) {
                              var points = datapoints.points,
                                  ps = datapoints.pointsize,
                                  bottom = Math.min(Math.max(0, axisy.min), axisy.max),
                                  i = 0, top, areaOpen = false,
              Severity: Major
              Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 3 hrs to fix

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

                        function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
                            var left, right, bottom, top,
                                drawLeft, drawRight, drawTop, drawBottom,
                                tmp;
                
                
                Severity: Major
                Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 3 hrs to fix

                  Function plotLine has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                                  var points = datapoints.points,
                                      ps = datapoints.pointsize,
                                      prevx = null, prevy = null;
                                  
                  Severity: Major
                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 2 hrs to fix

                    Function findNearbyItem has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function findNearbyItem(mouseX, mouseY, seriesFilter) {
                                var maxDistance = options.grid.mouseActiveRadius,
                                    smallestDistance = maxDistance * maxDistance + 1,
                                    item = null, foundPoint = false, i, j;
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 2 hrs to fix

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

                              function insertLegend() {
                                  placeholder.find(".legend").remove();
                      
                                  if (!options.legend.show)
                                      return;
                      Severity: Major
                      Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 2 hrs to fix

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

                                function fillInSeriesOptions() {
                                    var i;
                                    
                                    // collect what we already got of colors
                                    var neededColors = series.length,
                        Severity: Major
                        Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 2 hrs to fix

                          Function parseOptions has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function parseOptions(opts) {
                                      var i;
                                      
                                      $.extend(true, options, opts);
                                      
                          Severity: Minor
                          Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 2 hrs to fix

                            Function formatDate has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                $.plot.formatDate = function(d, fmt, monthNames) {
                                    var leftPad = function(n) {
                                        n = "" + n;
                                        return n.length == 1 ? "0" + n : n;
                                    };
                            Severity: Minor
                            Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

                              Function allocateAxisBoxFirstPhase has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      function allocateAxisBoxFirstPhase(axis) {
                                          // find the bounding box of the axis by looking at label
                                          // widths/heights and ticks, make room by diminishing the
                                          // plotOffset
                              
                              
                              Severity: Minor
                              Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

                                Function measureTickLabels has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function measureTickLabels(axis) {
                                            var opts = axis.options, i, ticks = axis.ticks || [], labels = [],
                                                l, w = opts.labelWidth, h = opts.labelHeight, dummyDiv;
                                
                                            function makeDummyDiv(labels, width) {
                                Severity: Minor
                                Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                          function drawSeriesPoints(series) {
                                              function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
                                                  var points = datapoints.points, ps = datapoints.pointsize;
                                  
                                                  for (var i = 0; i < points.length; i += ps) {
                                  Severity: Minor
                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                            function insertAxisLabels() {
                                                placeholder.find(".tickLabels").remove();
                                                
                                                var html = ['<div class="tickLabels" style="font-size:smaller">'];
                                    
                                    
                                    Severity: Minor
                                    Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                              function setupGrid() {
                                                  var i, axes = allAxes();
                                      
                                                  // first calculate the plot and axis box dimensions
                                      
                                      
                                      Severity: Minor
                                      Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

                                        Function drawBar has 12 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
                                        Severity: Major
                                        Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                                  function setupCanvases() {
                                                      var reused,
                                                          existingCanvas = placeholder.children("canvas.base"),
                                                          existingOverlay = placeholder.children("canvas.overlay");
                                          
                                          
                                          Severity: Minor
                                          Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                                    function setRange(axis) {
                                                        var opts = axis.options,
                                                            min = +(opts.min != null ? opts.min : axis.datamin),
                                                            max = +(opts.max != null ? opts.max : axis.datamax),
                                                            delta = max - min;
                                            Severity: Minor
                                            Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                                      function axisToCanvasCoords(pos) {
                                                          // get canvas coords from the first pair of x/y found in pos
                                                          var res = {}, i, axis, key;
                                              
                                                          for (i = 0; i < xaxes.length; ++i) {
                                              Severity: Minor
                                              Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                                        function setTicks(axis) {
                                                            var oticks = axis.options.ticks, ticks = [];
                                                            if (oticks == null || (typeof oticks == "number" && oticks > 0))
                                                                ticks = axis.tickGenerator(axis);
                                                            else if (oticks) {
                                                Severity: Minor
                                                Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

                                                  Function plotPoints has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                              function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
                                                  Severity: Major
                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

                                                    Consider simplifying this complex logical expression.
                                                    Open

                                                                            if (series[i].bars.horizontal ? 
                                                                                (mx <= Math.max(b, x) && mx >= Math.min(b, x) && 
                                                                                 my >= y + barLeft && my <= y + barRight) :
                                                                                (mx >= x + barLeft && mx <= x + barRight &&
                                                                                 my >= Math.min(b, y) && my <= Math.max(b, y)))
                                                    Severity: Major
                                                    Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 1 hr to fix

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

                                                                  function plotBars(datapoints, barLeft, barRight, offset, fillStyleCallback, axisx, axisy) {
                                                      Severity: Major
                                                      Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 50 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                    if (val > xmax)
                                                                                        xmax = val;
                                                        Severity: Major
                                                        Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                      if (val != null) {
                                                                                          f = format[m];
                                                                                          // extract min/max info
                                                                                          if (f.x)
                                                                                              updateAxis(s.xaxis, val, val);
                                                          Severity: Major
                                                          Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                                        if (val < ymin)
                                                                                            ymin = val;
                                                            Severity: Major
                                                            Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                          if (f) {
                                                                                              if (f.number && val != null) {
                                                                                                  val = +val; // convert to number
                                                                                                  if (isNaN(val))
                                                                                                      val = null;
                                                              Severity: Major
                                                              Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                            for (m = 0; m < ps; ++m)
                                                                                                points[k + ps + m] = points[k + m];
                                                                Severity: Major
                                                                Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                              if (val > ymax)
                                                                                                  ymax = val;
                                                                  Severity: Major
                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 45 mins to fix

                                                                    Avoid deeply nested control flow statements.
                                                                    Open

                                                                                                if (val < xmin)
                                                                                                    xmin = val;
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 45 mins to fix

                                                                      Consider simplifying this complex logical expression.
                                                                      Open

                                                                                          if (v < axis.min || v > axis.max
                                                                                              // skip those lying on the axes if we got a border
                                                                                              || (t == "full" && bw > 0
                                                                                                  && (v == axis.min || v == axis.max)))
                                                                                              continue;
                                                                      Severity: Major
                                                                      Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 40 mins to fix

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

                                                                                    function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
                                                                        Severity: Minor
                                                                        Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 35 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                          (function(B){B.color={};B.color.make=function(F,E,C,D){var G={};G.r=F||0;G.g=E||0;G.b=C||0;G.a=D!=null?D:1;G.add=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]+=I}return G.normalize()};G.scale=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]*=I}return G.normalize()};G.toString=function(){if(G.a>=1){return"rgb("+[G.r,G.g,G.b].join(",")+")"}else{return"rgba("+[G.r,G.g,G.b,G.a].join(",")+")"}};G.normalize=function(){function H(J,K,I){return K<J?J:(K>I?I:K)}G.r=H(0,parseInt(G.r),255);G.g=H(0,parseInt(G.g),255);G.b=H(0,parseInt(G.b),255);G.a=H(0,G.a,1);return G};G.clone=function(){return B.color.make(G.r,G.b,G.g,G.a)};return G.normalize()};B.color.extract=function(D,C){var E;do{E=D.css(C).toLowerCase();if(E!=""&&E!="transparent"){break}D=D.parent()}while(!B.nodeName(D.get(0),"body"));if(E=="rgba(0, 0, 0, 0)"){E="transparent"}return B.color.parse(E)};B.color.parse=function(F){var E,C=B.color.make;if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10))}if(E=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10),parseFloat(E[4]))}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55)}if(E=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55,parseFloat(E[4]))}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return C(parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16))}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return C(parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16))}var D=B.trim(F).toLowerCase();if(D=="transparent"){return C(255,255,255,0)}else{E=A[D]||[0,0,0];return C(E[0],E[1],E[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
                                                                          Severity: Major
                                                                          Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                            (function(B){B.color={};B.color.make=function(F,E,C,D){var G={};G.r=F||0;G.g=E||0;G.b=C||0;G.a=D!=null?D:1;G.add=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]+=I}return G.normalize()};G.scale=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]*=I}return G.normalize()};G.toString=function(){if(G.a>=1){return"rgb("+[G.r,G.g,G.b].join(",")+")"}else{return"rgba("+[G.r,G.g,G.b,G.a].join(",")+")"}};G.normalize=function(){function H(J,K,I){return K<J?J:(K>I?I:K)}G.r=H(0,parseInt(G.r),255);G.g=H(0,parseInt(G.g),255);G.b=H(0,parseInt(G.b),255);G.a=H(0,G.a,1);return G};G.clone=function(){return B.color.make(G.r,G.b,G.g,G.a)};return G.normalize()};B.color.extract=function(D,C){var E;do{E=D.css(C).toLowerCase();if(E!=""&&E!="transparent"){break}D=D.parent()}while(!B.nodeName(D.get(0),"body"));if(E=="rgba(0, 0, 0, 0)"){E="transparent"}return B.color.parse(E)};B.color.parse=function(F){var E,C=B.color.make;if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10))}if(E=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10),parseFloat(E[4]))}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55)}if(E=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55,parseFloat(E[4]))}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return C(parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16))}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return C(parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16))}var D=B.trim(F).toLowerCase();if(D=="transparent"){return C(255,255,255,0)}else{E=A[D]||[0,0,0];return C(E[0],E[1],E[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
                                                                            Severity: Major
                                                                            Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                              (function(B){B.color={};B.color.make=function(F,E,C,D){var G={};G.r=F||0;G.g=E||0;G.b=C||0;G.a=D!=null?D:1;G.add=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]+=I}return G.normalize()};G.scale=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]*=I}return G.normalize()};G.toString=function(){if(G.a>=1){return"rgb("+[G.r,G.g,G.b].join(",")+")"}else{return"rgba("+[G.r,G.g,G.b,G.a].join(",")+")"}};G.normalize=function(){function H(J,K,I){return K<J?J:(K>I?I:K)}G.r=H(0,parseInt(G.r),255);G.g=H(0,parseInt(G.g),255);G.b=H(0,parseInt(G.b),255);G.a=H(0,G.a,1);return G};G.clone=function(){return B.color.make(G.r,G.b,G.g,G.a)};return G.normalize()};B.color.extract=function(D,C){var E;do{E=D.css(C).toLowerCase();if(E!=""&&E!="transparent"){break}D=D.parent()}while(!B.nodeName(D.get(0),"body"));if(E=="rgba(0, 0, 0, 0)"){E="transparent"}return B.color.parse(E)};B.color.parse=function(F){var E,C=B.color.make;if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10))}if(E=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10),parseFloat(E[4]))}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55)}if(E=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55,parseFloat(E[4]))}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return C(parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16))}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return C(parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16))}var D=B.trim(F).toLowerCase();if(D=="transparent"){return C(255,255,255,0)}else{E=A[D]||[0,0,0];return C(E[0],E[1],E[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
                                                                              Severity: Major
                                                                              Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                (function(B){B.color={};B.color.make=function(F,E,C,D){var G={};G.r=F||0;G.g=E||0;G.b=C||0;G.a=D!=null?D:1;G.add=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]+=I}return G.normalize()};G.scale=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]*=I}return G.normalize()};G.toString=function(){if(G.a>=1){return"rgb("+[G.r,G.g,G.b].join(",")+")"}else{return"rgba("+[G.r,G.g,G.b,G.a].join(",")+")"}};G.normalize=function(){function H(J,K,I){return K<J?J:(K>I?I:K)}G.r=H(0,parseInt(G.r),255);G.g=H(0,parseInt(G.g),255);G.b=H(0,parseInt(G.b),255);G.a=H(0,G.a,1);return G};G.clone=function(){return B.color.make(G.r,G.b,G.g,G.a)};return G.normalize()};B.color.extract=function(D,C){var E;do{E=D.css(C).toLowerCase();if(E!=""&&E!="transparent"){break}D=D.parent()}while(!B.nodeName(D.get(0),"body"));if(E=="rgba(0, 0, 0, 0)"){E="transparent"}return B.color.parse(E)};B.color.parse=function(F){var E,C=B.color.make;if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10))}if(E=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10),parseFloat(E[4]))}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55)}if(E=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55,parseFloat(E[4]))}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return C(parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16))}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return C(parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16))}var D=B.trim(F).toLowerCase();if(D=="transparent"){return C(255,255,255,0)}else{E=A[D]||[0,0,0];return C(E[0],E[1],E[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
                                                                                Severity: Major
                                                                                Found in app/assets/javascripts/app/lib/flot/jquery.flot.js - About 30 mins to fix

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

                                                                                  (function(B){B.color={};B.color.make=function(F,E,C,D){var G={};G.r=F||0;G.g=E||0;G.b=C||0;G.a=D!=null?D:1;G.add=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]+=I}return G.normalize()};G.scale=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]*=I}return G.normalize()};G.toString=function(){if(G.a>=1){return"rgb("+[G.r,G.g,G.b].join(",")+")"}else{return"rgba("+[G.r,G.g,G.b,G.a].join(",")+")"}};G.normalize=function(){function H(J,K,I){return K<J?J:(K>I?I:K)}G.r=H(0,parseInt(G.r),255);G.g=H(0,parseInt(G.g),255);G.b=H(0,parseInt(G.b),255);G.a=H(0,G.a,1);return G};G.clone=function(){return B.color.make(G.r,G.b,G.g,G.a)};return G.normalize()};B.color.extract=function(D,C){var E;do{E=D.css(C).toLowerCase();if(E!=""&&E!="transparent"){break}D=D.parent()}while(!B.nodeName(D.get(0),"body"));if(E=="rgba(0, 0, 0, 0)"){E="transparent"}return B.color.parse(E)};B.color.parse=function(F){var E,C=B.color.make;if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10))}if(E=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10),parseFloat(E[4]))}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55)}if(E=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55,parseFloat(E[4]))}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return C(parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16))}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return C(parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16))}var D=B.trim(F).toLowerCase();if(D=="transparent"){return C(255,255,255,0)}else{E=A[D]||[0,0,0];return C(E[0],E[1],E[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 days to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.colorhelpers.js on lines 134..178

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

                                                                                  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 (y1 >= y2 && y1 > axisy.max) {
                                                                                                          if (y2 > axisy.max)
                                                                                                              continue;
                                                                                                          x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
                                                                                                          y1 = axisy.max;
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1766..1777

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

                                                                                  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 (x1 <= x2 && x1 < axisx.min) {
                                                                                                          if (x2 < axisx.min)
                                                                                                              continue;
                                                                                                          y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
                                                                                                          x1 = axisx.min;
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1752..1763

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

                                                                                  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 (x1 >= x2 && x1 > axisx.max) {
                                                                                                          if (x2 > axisx.max)
                                                                                                              continue;
                                                                                                          y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                                                                                          x1 = axisx.max;
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1780..1791

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

                                                                                  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 (x1 >= x2 && x1 > axisx.max) {
                                                                                                          if (x2 > axisx.max)
                                                                                                              continue;
                                                                                                          y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
                                                                                                          x1 = axisx.max;
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 6 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1863..1874

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

                                                                                  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 (i = 0; i < xaxes.length; ++i) {
                                                                                                  axis = xaxes[i];
                                                                                                  if (axis && axis.used) {
                                                                                                      key = "x" + axis.n;
                                                                                                      if (pos[key] == null && axis.n == 1)
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 5 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 386..398

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 136.

                                                                                  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 (i = 0; i < yaxes.length; ++i) {
                                                                                                  axis = yaxes[i];
                                                                                                  if (axis && axis.used) {
                                                                                                      key = "y" + axis.n;
                                                                                                      if (pos[key] == null && axis.n == 1)
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 5 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 372..384

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

                                                                                  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 (i = 0; i < axes.length; ++i) {
                                                                                                  axis = axes[i];
                                                                                                  if (axis.direction == coord) {
                                                                                                      key = coord + axis.n + "axis";
                                                                                                      if (!ranges[key] && axis.n == 1)
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 4 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.selection.js on lines 214..226

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 128.

                                                                                  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 (p.charAt(0) == "n")
                                                                                                      pos += 'top:' + (m[1] + plotOffset.top) + 'px;';
                                                                                                  else if (p.charAt(0) == "s")
                                                                                                      pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;';
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2224..2227

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

                                                                                  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 (p.charAt(1) == "e")
                                                                                                      pos += 'right:' + (m[0] + plotOffset.right) + 'px;';
                                                                                                  else if (p.charAt(1) == "w")
                                                                                                      pos += 'left:' + (m[0] + plotOffset.left) + 'px;';
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2220..2223

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

                                                                                  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 (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) {
                                                                                                          x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
                                                                                                          y1 = axisy.min;
                                                                                                      }
                                                                                                      else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) {
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1915..1922

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

                                                                                  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 (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) {
                                                                                                          x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
                                                                                                          y1 = axisy.max;
                                                                                                      }
                                                                                                      else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) {
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1905..1912

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

                                                                                  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 {
                                                                                                      y = 0;
                                                                                                      if (t == "full")
                                                                                                          x = (axis.position == "left" ? 0 : plotWidth);
                                                                                                      else
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1571..1577

                                                                                  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 (axis.direction == "x") {
                                                                                                      x = 0;
                                                                                                      if (t == "full")
                                                                                                          y = (axis.position == "top" ? 0 : plotHeight);
                                                                                                      else
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1578..1584

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 81.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                              for (i = 0; i < yaxes.length; ++i) {
                                                                                                  axis = yaxes[i];
                                                                                                  if (axis && axis.used)
                                                                                                      res["y" + axis.n] = axis.c2p(pos.top);
                                                                                              }
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 348..352

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 79.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                              for (i = 0; i < xaxes.length; ++i) {
                                                                                                  axis = xaxes[i];
                                                                                                  if (axis && axis.used)
                                                                                                      res["x" + axis.n] = axis.c2p(pos.left);
                                                                                              }
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 2 hrs to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 354..358

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 79.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                  plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis);
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1960..1960

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

                                                                                  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

                                                                                                  plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis);
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1958..1958

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

                                                                                  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 (y1 <= axisy.min && y2 <= axisy.min) {
                                                                                                          ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));
                                                                                                          ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));
                                                                                                          continue;
                                                                                                      }
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1884..1893

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 69.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                      if (y1 >= axisy.max && y2 >= axisy.max) {
                                                                                                          ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));
                                                                                                          ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));
                                                                                                          continue;
                                                                                                      }
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1889..1893

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 69.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                              if (options.x2axis) {
                                                                                                  options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);
                                                                                                  options.xaxes[1].position = "top";
                                                                                              }
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 273..276

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

                                                                                  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 (options.y2axis) {
                                                                                                  options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);
                                                                                                  options.yaxes[1].position = "right";
                                                                                              }
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 269..272

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

                                                                                  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

                                                                                                      $('<div style="position:absolute;width:' + div.width() + 'px;height:' + div.height() + 'px;' + pos +'background-color:' + c + ';"> </div>').prependTo(legend).css('opacity', options.legend.backgroundOpacity);
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.pie.js on lines 476..476

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 64.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                      if (axis.direction == "x") {
                                                                                                          x = axis.p2c(v);
                                                                                                          yoff = t == "full" ? -plotHeight : t;
                                                                                                          
                                                                                                          if (axis.position == "top")
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1625..1631

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 58.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                      else {
                                                                                                          y = axis.p2c(v);
                                                                                                          xoff = t == "full" ? -plotWidth : t;
                                                                                                          
                                                                                                          if (axis.position == "left")
                                                                                  Severity: Major
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 1 hr to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1618..1624

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 58.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                  item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left);
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 55 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2376..2376

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 54.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                  item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top);
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 55 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2375..2375

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 54.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                          pos.top = Math.round(plotOffset.top + axis.p2c(tick.v) - axis.labelHeight/2);
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 50 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1679..1679

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 51.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                          pos.left = Math.round(plotOffset.left + axis.p2c(tick.v) - axis.labelWidth/2);
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 50 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 1686..1686

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 51.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                              if (from != null && to != null && from > to) {
                                                                                                  var tmp = from;
                                                                                                  from = to;
                                                                                                  to = tmp;
                                                                                              }
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 45 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.selection.js on lines 236..240

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 50.

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                  if (right < left) {
                                                                                                      tmp = right;
                                                                                                      right = left;
                                                                                                      left = tmp;
                                                                                                      drawLeft = true;
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 40 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2064..2070

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

                                                                                  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 {
                                                                                                      axis.box = { top: plotOffset.top + axismargin, height: lh };
                                                                                                      plotOffset.top += lh + axismargin;
                                                                                                  }
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 40 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 968..971

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

                                                                                  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 (top < bottom) {
                                                                                                      tmp = top;
                                                                                                      top = bottom;
                                                                                                      bottom = tmp;
                                                                                                      drawBottom = true;
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 40 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2047..2053

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

                                                                                  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 {
                                                                                                      plotOffset.right += lw + axismargin;
                                                                                                      axis.box = { left: canvasWidth - plotOffset.right, width: lw };
                                                                                                  }
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 40 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 956..959

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

                                                                                  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 (pos == "left") {
                                                                                                      axis.box = { left: plotOffset.left + axismargin, width: lw };
                                                                                                      plotOffset.left += lw + axismargin;
                                                                                                  }
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 40 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 960..963

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

                                                                                  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 (pos == "bottom") {
                                                                                                      plotOffset.bottom += lh + axismargin;
                                                                                                      axis.box = { top: canvasHeight - plotOffset.bottom, height: lh };
                                                                                                  }
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 40 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 972..975

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

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

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

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

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

                                                                                  Refactorings

                                                                                  Further Reading

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

                                                                                                  s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min));
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 35 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 830..830

                                                                                  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

                                                                                                  s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min));
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 35 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 834..834

                                                                                  Duplicated Code

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

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

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

                                                                                  Tuning

                                                                                  This issue has a mass of 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

                                                                                              if (right < axisx.min || left > axisx.max ||
                                                                                                  top < axisy.min || bottom > axisy.max)
                                                                                                  return;
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 35 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2477..2478

                                                                                  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

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

                                                                                              if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)
                                                                                                  return;
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/app/lib/flot/jquery.flot.js and 1 other location - About 35 mins to fix
                                                                                  app/assets/javascripts/app/lib/flot/jquery.flot.js on lines 2074..2076

                                                                                  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