crowbar/crowbar-core

View on GitHub
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js

Summary

Maintainability
F
3 wks
Test Coverage

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

/**
 *
 * jquery.sparkline.js
 *
 * v2.1.2
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 1 hr to fix

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

    $.fn.simpledraw = function (width, height, useExisting, interact) {
      var target, mhandler;
      if (useExisting && (target = this.data('_jqs_vcanvas'))) {
        return target;
      }
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 1 hr 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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 50 mins 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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 50 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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 45 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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 45 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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js - About 35 mins to fix

Avoid too many return statements within this function.
Open

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

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,
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1678..1684

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('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,
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1685..1691

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;
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1974..1983

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;
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1832..1841

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((rwhisker - minValue) * unitSize + canvasLeft),
          Math.round(canvasHeight / 4),
          Math.round((rwhisker - minValue) * unitSize + canvasLeft),
          Math.round(canvasHeight - canvasHeight / 4),
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2505..2510

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((lwhisker - minValue) * unitSize + canvasLeft),
          Math.round(canvasHeight / 4),
          Math.round((lwhisker - minValue) * unitSize + canvasLeft),
          Math.round(canvasHeight - canvasHeight / 4),
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2517..2522

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();
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2499..2504
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2524..2529

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),
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2499..2504
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2512..2516

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),
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2512..2516
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2524..2529

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;" ' +
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2979..2984

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;" ' +
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2922..2927

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[0] !== null) {
          shape = this.renderTarget().append();
          this.shapes[shape.id] = 't0';
          this.valueShapes.t0 = shape.id;
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2237..2241

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[1] !== null) {
          shape = this.renderPerformance().append();
          this.shapes[shape.id] = 'p1';
          this.valueShapes.p1 = shape.id;
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2242..2246

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 (routlier > rwhisker) {
            target.drawCircle((routlier - minValue) * unitSize + canvasLeft,
              canvasHeight / 2,
              options.get('spotRadius'),
              options.get('outlierLineColor'),
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2474..2480

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 (loutlier < lwhisker) {
            target.drawCircle((loutlier - minValue) * unitSize + canvasLeft,
              canvasHeight / 2,
              options.get('spotRadius'),
              options.get('outlierLineColor'),
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2481..2487

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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;
      },
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2280..2283

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;
      },
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2157..2160

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('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.min)) {
          this.min = options.get('chartRangeMin');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1489..1491
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1492..1494
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1495..1497
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1498..1500
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2074..2076

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1492..1494
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1495..1497
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1498..1500
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2071..2073
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2074..2076

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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('chartRangeMaxX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX') > this.maxx)) {
          this.maxx = options.get('chartRangeMaxX');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1489..1491
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1492..1494
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1495..1497
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2071..2073
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2074..2076

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1489..1491
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1492..1494
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1495..1497
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1498..1500
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2071..2073

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');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1489..1491
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1495..1497
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1498..1500
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2071..2073
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2074..2076

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1489..1491
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1492..1494
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1498..1500
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2071..2073
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2074..2076

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < min)) {
          min = options.get('chartRangeMin');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1798..1800

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > max)) {
          max = options.get('chartRangeMax');
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 1795..1797

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;
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2750..2753
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2785..2788

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;
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2760..2763
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2785..2788

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;
        }
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2750..2753
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2760..2763

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

    defaultStyles = '.jqstooltip { ' +
      'position: absolute;' +
      'left: 0px;' +
      'top: 0px;' +
      'visibility: hidden;' +
crowbar_framework/vendor/assets/javascripts/misc/handlebars.js on lines 2043..2057

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];
crowbar_framework/vendor/assets/javascripts/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];
crowbar_framework/vendor/assets/javascripts/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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js and 1 other location - About 40 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2631..2635

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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js and 1 other location - About 40 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 2637..2641

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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js and 1 other location - About 30 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 3009..3010

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 crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js and 1 other location - About 30 mins to fix
crowbar_framework/vendor/assets/javascripts/jquery/sparkline.js on lines 3030..3031

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