sleepepi/sleepportal

View on GitHub
app/assets/javascripts/external/jquery.sparkline.js

Summary

Maintainability
F
3 wks
Test Coverage

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

/**
*
* jquery.sparkline.js
*
* v2.1.1
Severity: Major
Found in app/assets/javascripts/external/jquery.sparkline.js - About 6 days to fix

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

            render: function () {
                var options = this.options,
                    target = this.target,
                    canvasWidth = this.canvasWidth,
                    canvasHeight = this.canvasHeight,
    Severity: Major
    Found in app/assets/javascripts/external/jquery.sparkline.js - About 6 hrs to fix

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

              render: function () {
                  var target = this.target,
                      values = this.values,
                      vlen = values.length,
                      options = this.options,
      Severity: Major
      Found in app/assets/javascripts/external/jquery.sparkline.js - About 5 hrs to fix

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

                init: function (el, values, options, width, height) {
                    var barWidth = parseInt(options.get('barWidth'), 10),
                        barSpacing = parseInt(options.get('barSpacing'), 10),
                        chartRangeMin = options.get('chartRangeMin'),
                        chartRangeMax = options.get('chartRangeMax'),
        Severity: Major
        Found in app/assets/javascripts/external/jquery.sparkline.js - About 4 hrs to fix

          Function sparkline has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.sparkline = function (userValues, userOptions) {
                  return this.each(function () {
                      var options = new $.fn.sparkline.options(this, userOptions),
                           $this = $(this),
                           render, i;
          Severity: Major
          Found in app/assets/javascripts/external/jquery.sparkline.js - About 2 hrs to fix

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

                    getCurrentRegionTooltip: function () {
                        var options = this.options,
                            header = '',
                            entries = [],
                            fields, formats, formatlen, fclass, text, i,
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js - About 2 hrs to fix

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

                      renderRegion: function (valuenum, highlight) {
                          var vals = this.values[valuenum],
                              options = this.options,
                              xaxisOffset = this.xaxisOffset,
                              result = [],
              Severity: Major
              Found in app/assets/javascripts/external/jquery.sparkline.js - About 2 hrs to fix

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

                        scanValues: function () {
                            var values = this.values,
                                valcount = values.length,
                                xvalues = this.xvalues,
                                yvalues = this.yvalues,
                Severity: Minor
                Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                          render: function (fieldset, lookups, options) {
                              var self = this,
                                  fields = fieldset,
                                  match, token, lookupkey, fieldvalue, prec;
                              return this.format.replace(this.fre, function () {
                  Severity: Minor
                  Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                            updateDisplay: function () {
                                var splist = this.splist,
                                     spcount = splist.length,
                                     needsRefresh = false,
                                     offset = this.$canvas.offset(),
                    Severity: Minor
                    Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

                      Function _drawPieSlice has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) {
                                  var vpath, startx, starty, endx, endy, stroke, fill, vel;
                                  if (startAngle === endAngle) {
                                      return '';  // VML seems to have problem when start angle equals end angle.
                                  }
                      Severity: Minor
                      Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                getTagSetting: function (key) {
                                    var prefix = this.tagOptionsPrefix,
                                        val, i, pairs, keyval;
                                    if (prefix === false || prefix === undefined) {
                                        return UNSET_OPTION;
                        Severity: Minor
                        Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                  updatePosition: function (x, y) {
                                      if (x === undefined) {
                                          if (this.mousex === undefined) {
                                              return;
                                          }
                          Severity: Minor
                          Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                    render: function () {
                                        var values = this.values,
                                            target = this.target,
                                            regionShapes = this.regionShapes,
                                            shapes, ids, i, j;
                            Severity: Minor
                            Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                      renderSlice: function (valuenum, highlight) {
                                          var target = this.target,
                                              options = this.options,
                                              radius = this.radius,
                                              borderWidth = options.get('borderWidth'),
                              Severity: Minor
                              Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                        renderRegion: function (valuenum, highlight) {
                                            var values = this.values,
                                                options = this.options,
                                                target = this.target,
                                                canvasHeight, height, halfHeight,
                                Severity: Minor
                                Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                          _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) {
                                  Severity: Major
                                  Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                            _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) {
                                    Severity: Major
                                    Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

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

                                              drawPieSlice: function (x, y, radius, startAngle, endAngle, lineColor, fillColor) {
                                      Severity: Major
                                      Found in app/assets/javascripts/external/jquery.sparkline.js - About 50 mins to fix

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

                                                _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
                                        Severity: Major
                                        Found in app/assets/javascripts/external/jquery.sparkline.js - About 50 mins to fix

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

                                                  _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
                                          Severity: Major
                                          Found in app/assets/javascripts/external/jquery.sparkline.js - About 50 mins to fix

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

                                                    _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
                                            Severity: Major
                                            Found in app/assets/javascripts/external/jquery.sparkline.js - About 50 mins to fix

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

                                                      _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
                                              Severity: Major
                                              Found in app/assets/javascripts/external/jquery.sparkline.js - About 50 mins to fix

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

                                                        drawRect: function (x, y, width, height, lineColor, fillColor) {
                                                Severity: Minor
                                                Found in app/assets/javascripts/external/jquery.sparkline.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                              if (stackMin < 0 && stackMax > 0) {
                                                                                  if (val < 0) {
                                                                                      stackRangesNeg[i] += Math.abs(val);
                                                                                  } else {
                                                                                      stackRanges[i] += val;
                                                  Severity: Major
                                                  Found in app/assets/javascripts/external/jquery.sparkline.js - About 45 mins to fix

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

                                                            drawCircle: function (x, y, radius, lineColor, fillColor, lineWidth) {
                                                    Severity: Minor
                                                    Found in app/assets/javascripts/external/jquery.sparkline.js - About 45 mins to fix

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

                                                              drawLine: function (x1, y1, x2, y2, lineColor, lineWidth) {
                                                      Severity: Minor
                                                      Found in app/assets/javascripts/external/jquery.sparkline.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                    if (val > 0) {
                                                                                        stackTotals[i] += val;
                                                                                    }
                                                        Severity: Major
                                                        Found in app/assets/javascripts/external/jquery.sparkline.js - About 45 mins to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                      if (($(this).html() && !options.get('disableHiddenCheck') && $(this).is(':hidden')) || ($.fn.jquery < '1.3.0' && $(this).parents().is(':hidden')) || !$(this).parents('body').length) {
                                                                          if (!options.get('composite') && $.data(this, '_jqs_pending')) {
                                                                              // remove any existing references to the element
                                                                              for (i = pending.length; i; i--) {
                                                                                  if (pending[i - 1][0] == this) {
                                                          Severity: Major
                                                          Found in app/assets/javascripts/external/jquery.sparkline.js - About 40 mins to fix

                                                            Consider simplifying this complex logical expression.
                                                            Open

                                                                            if (hlSpotsEnabled || options.get('spotColor') ||
                                                                                (options.get('minSpotColor') || options.get('maxSpotColor') &&
                                                                                    (yvalues[yvallast] === this.miny || yvalues[yvallast] === this.maxy))) {
                                                                                canvasWidth -= Math.ceil(spotRadius);
                                                                            }
                                                            Severity: Major
                                                            Found in app/assets/javascripts/external/jquery.sparkline.js - About 40 mins to fix

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

                                                                      drawNormalRange: function (canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey) {
                                                              Severity: Minor
                                                              Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                        _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) {
                                                                Severity: Minor
                                                                Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                          init: function (el, values, options, width, height) {
                                                                  Severity: Minor
                                                                  Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                            init: function (el, values, options, width, height) {
                                                                    Severity: Minor
                                                                    Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                              _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) {
                                                                      Severity: Minor
                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                                init: function (el, values, options, width, height) {
                                                                        Severity: Minor
                                                                        Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                                  init: function (el, values, options, width, height) {
                                                                          Severity: Minor
                                                                          Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                                    init: function (el, values, options, width, height) {
                                                                            Severity: Minor
                                                                            Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                                      init: function (el, values, options, width, height) {
                                                                              Severity: Minor
                                                                              Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                                        init: function (el, values, options, width, height) {
                                                                                Severity: Minor
                                                                                Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

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

                                                                                          init: function (el, values, options, width, height) {
                                                                                  Severity: Minor
                                                                                  Found in app/assets/javascripts/external/jquery.sparkline.js - About 35 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                                return '';
                                                                                    Severity: Major
                                                                                    Found in app/assets/javascripts/external/jquery.sparkline.js - About 30 mins to fix

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

                                                                                                      if (spotRadius && options.get('minSpotColor')) {
                                                                                                          x = xvalues[$.inArray(this.minyorg, yvalues)];
                                                                                                          target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
                                                                                                              canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))),
                                                                                                              spotRadius, undefined,
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 5 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1664..1670

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

                                                                                      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 (spotRadius && options.get('maxSpotColor')) {
                                                                                                          x = xvalues[$.inArray(this.maxyorg, yvalues)];
                                                                                                          target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
                                                                                                              canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))),
                                                                                                              spotRadius, undefined,
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 5 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1657..1663

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

                                                                                      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 ($.isArray(options.get('colorMap'))) {
                                                                                                      this.colorMapByIndex = options.get('colorMap');
                                                                                                      this.colorMapByValue = null;
                                                                                                  } else {
                                                                                                      this.colorMapByIndex = null;
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 4 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1953..1962

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

                                                                                      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 ($.isArray(options.get('colorMap'))) {
                                                                                                      this.colorMapByIndex = options.get('colorMap');
                                                                                                      this.colorMapByValue = null;
                                                                                                  } else {
                                                                                                      this.colorMapByIndex = null;
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 4 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1811..1820

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

                                                                                      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

                                                                                                  target.drawLine(
                                                                                                      Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight / 4),
                                                                                                      Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight - canvasHeight / 4),
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 3 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2496..2501

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

                                                                                      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

                                                                                                  target.drawLine(
                                                                                                      Math.round((rwhisker - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight / 4),
                                                                                                      Math.round((rwhisker - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight - canvasHeight / 4),
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 3 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2484..2489

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

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  target.drawLine(Math.round((rwhisker - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight / 2),
                                                                                                      Math.round((q3 - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight / 2),
                                                                                                      options.get('lineColor')).append();
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 3 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2478..2483
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2503..2508

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

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  target.drawLine(
                                                                                                      Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight / 2),
                                                                                                      Math.round((q1 - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight / 2),
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 3 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2491..2495
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2503..2508

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

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  target.drawLine(
                                                                                                      Math.round((q2 - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight * 0.1),
                                                                                                      Math.round((q2 - minValue) * unitSize + canvasLeft),
                                                                                                      Math.round(canvasHeight * 0.9),
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 3 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2478..2483
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2491..2495

                                                                                      Duplicated Code

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

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

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

                                                                                      Tuning

                                                                                      This issue has a mass of 96.

                                                                                      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

                                                                                                  vel = '<v:shape coordorigin="0 0" coordsize="' + this.pixelWidth + ' ' + this.pixelHeight + '" ' +
                                                                                                       ' id="jqsshape' + shapeid + '" ' +
                                                                                                       stroke +
                                                                                                       fill +
                                                                                                      ' style="position:absolute;left:0px;top:0px;height:' + this.pixelHeight + 'px;width:' + this.pixelWidth + 'px;padding:0px;margin:0px;" ' +
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 2 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2915..2920

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

                                                                                      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

                                                                                                  vel = '<v:shape coordorigin="0 0" coordsize="' + this.pixelWidth + ' ' + this.pixelHeight + '" ' +
                                                                                                       ' id="jqsshape' + shapeid + '" ' +
                                                                                                       stroke +
                                                                                                       fill +
                                                                                                      ' style="position:absolute;left:0px;top:0px;height:' + this.pixelHeight + 'px;width:' + this.pixelWidth + 'px;padding:0px;margin:0px;" ' +
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 2 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2972..2977

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

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  if (this.values[1] !== null) {
                                                                                                      shape = this.renderPerformance().append();
                                                                                                      this.shapes[shape.id] = 'p1';
                                                                                                      this.valueShapes.p1 = shape.id;
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 2 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2221..2225

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

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  if (this.values[0] !== null) {
                                                                                                      shape = this.renderTarget().append();
                                                                                                      this.shapes[shape.id] = 't0';
                                                                                                      this.valueShapes.t0 = shape.id;
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 2 hrs to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2216..2220

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

                                                                                      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 (loutlier < lwhisker) {
                                                                                                          target.drawCircle((loutlier - minValue) * unitSize + canvasLeft,
                                                                                                              canvasHeight / 2,
                                                                                                              options.get('spotRadius'),
                                                                                                              options.get('outlierLineColor'),
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2460..2466

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

                                                                                      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 (routlier > rwhisker) {
                                                                                                          target.drawCircle((routlier - minValue) * unitSize + canvasLeft,
                                                                                                              canvasHeight / 2,
                                                                                                              options.get('spotRadius'),
                                                                                                              options.get('outlierLineColor'),
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2453..2459

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

                                                                                      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

                                                                                              getRegion: function (el, x, y) {
                                                                                                  var shapeid = this.target.getShapeAt(el, x, y);
                                                                                                  return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
                                                                                              },
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2259..2262

                                                                                      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

                                                                                              getRegion: function (el, x, y) {
                                                                                                  var shapeid = this.target.getShapeAt(el, x, y);
                                                                                                  return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
                                                                                              },
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2136..2139

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

                                                                                                  if (options.get('chartRangeMaxX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX') > this.maxx)) {
                                                                                                      this.maxx = options.get('chartRangeMaxX');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                                                                                                  if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.miny)) {
                                                                                                      this.miny = options.get('chartRangeMin');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                                                                                                  if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.max)) {
                                                                                                      this.max = options.get('chartRangeMax');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052

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

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

                                                                                                  if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.maxy)) {
                                                                                                      this.maxy = options.get('chartRangeMax');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                                                                                                  if (options.get('chartRangeMinX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMinX') < this.minx)) {
                                                                                                      this.minx = options.get('chartRangeMinX');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2050..2052
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

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

                                                                                                  if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.min)) {
                                                                                                      this.min = options.get('chartRangeMin');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 5 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1468..1470
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1471..1473
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1474..1476
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1477..1479
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2053..2055

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

                                                                                      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.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > max)) {
                                                                                                      max = options.get('chartRangeMax');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1774..1776

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

                                                                                      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.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < min)) {
                                                                                                      min = options.get('chartRangeMin');
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 1777..1779

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

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  if (this.targetX !== undefined && this.targetY !== undefined &&
                                                                                                      context.isPointInPath(this.targetX, this.targetY)) {
                                                                                                      this.currentTargetShapeId = shapeid;
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2753..2756
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2778..2781

                                                                                      Duplicated Code

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

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

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

                                                                                      Tuning

                                                                                      This issue has a mass of 59.

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  if (this.targetX !== undefined && this.targetY !== undefined &&
                                                                                                      context.isPointInPath(this.targetX, this.targetY)) {
                                                                                                      this.currentTargetShapeId = shapeid;
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2743..2746
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2778..2781

                                                                                      Duplicated Code

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

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

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

                                                                                      Tuning

                                                                                      This issue has a mass of 59.

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  if (this.targetX !== undefined && this.targetY !== undefined &&
                                                                                                      context.isPointInPath(this.targetX, this.targetY)) {
                                                                                                      this.currentTargetShapeId = shapeid;
                                                                                                  }
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2743..2746
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2753..2756

                                                                                      Duplicated Code

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

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

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

                                                                                      Tuning

                                                                                      This issue has a mass of 59.

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                      return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 :  values[vl-1];
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 486..486

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

                                                                                      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

                                                                                                      return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1];
                                                                                      Severity: Major
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 489..489

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

                                                                                      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 (match) {
                                                                                                      this.pixelWidth = match[1];
                                                                                                  } else {
                                                                                                      this.pixelWidth = $(canvas).width();
                                                                                                  }
                                                                                      Severity: Minor
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 40 mins to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2624..2628

                                                                                      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 (match) {
                                                                                                      this.pixelHeight = match[1];
                                                                                                  } else {
                                                                                                      this.pixelHeight = $(canvas).height();
                                                                                                  }
                                                                                      Severity: Minor
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 40 mins to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 2630..2634

                                                                                      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

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

                                                                                                  var existing = $('#jqsshape' + shapeid),
                                                                                                      vel = this['_draw' + shape.type].apply(this, shape.args);
                                                                                      Severity: Minor
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 30 mins to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 3023..3024

                                                                                      Duplicated Code

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

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

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

                                                                                      Tuning

                                                                                      This issue has a mass of 45.

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

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

                                                                                                  var existing = $('#jqsshape' + shapeid),
                                                                                                       vel = this['_draw' + shape.type].apply(this, shape.args);
                                                                                      Severity: Minor
                                                                                      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 30 mins to fix
                                                                                      app/assets/javascripts/external/jquery.sparkline.js on lines 3002..3003

                                                                                      Duplicated Code

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

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

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

                                                                                      Tuning

                                                                                      This issue has a mass of 45.

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

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

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

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

                                                                                      Refactorings

                                                                                      Further Reading

                                                                                      There are no issues that match your filters.

                                                                                      Category
                                                                                      Status