d4l3k/WebSync

View on GitHub
assets/lib/Chart.js

Summary

Maintainability
F
1 mo
Test Coverage

File Chart.js has 2512 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Chart.js
 * http://chartjs.org/
 * Version: 1.0.1-beta.4
 *
Severity: Major
Found in assets/lib/Chart.js - About 1 wk to fix

    Function showTooltip has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            showTooltip : function(ChartElements, forceRedraw){
                // Only redraw the chart if we've actually changed what we're hovering on.
                if (typeof this.activeElements === 'undefined') this.activeElements = [];
    
                var isChanged = (function(Elements){
    Severity: Major
    Found in assets/lib/Chart.js - About 4 hrs to fix

      Function draw has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              draw: function(){
                  if (this.display){
                      var ctx = this.ctx;
                      each(this.yLabels, function(label, index){
                          // Don't draw a centre value
      Severity: Major
      Found in assets/lib/Chart.js - About 3 hrs to fix

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

                draw : function(ease){
                    var easingDecimal = ease || 1;
                    this.clear();
        
                    var ctx = this.chart.ctx;
        Severity: Major
        Found in assets/lib/Chart.js - About 3 hrs to fix

          Function draw has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  draw : function(){
                      var ctx = this.ctx,
                          yLabelGap = (this.endPoint - this.startPoint) / this.steps,
                          xStart = Math.round(this.xScalePaddingLeft);
                      if (this.display){
          Severity: Major
          Found in assets/lib/Chart.js - About 2 hrs to fix

            Function initialize has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    initialize:  function(data){
            
                        //Expose options as a scope variable here so we can access it in the ScaleClass
                        var options = this.options;
            
            
            Severity: Major
            Found in assets/lib/Chart.js - About 2 hrs to fix

              Function calculateScaleRange has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      calculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){
              
                          //Set a minimum step of two - a point at the top of the graph, and a point at the base
                          var minSteps = 2,
                              maxSteps = Math.floor(drawingSize/(textSize * 1.5)),
              Severity: Major
              Found in assets/lib/Chart.js - About 2 hrs to fix

                Function initialize has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        initialize:  function(data){
                            //Declare the extension of the default point, to cater for the options passed in to the constructor
                            this.PointClass = Chart.Point.extend({
                                strokeWidth : this.options.pointDotStrokeWidth,
                                radius : this.options.pointDotRadius,
                Severity: Major
                Found in assets/lib/Chart.js - About 2 hrs to fix

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

                          setScaleSize: function(){
                              /*
                               * Right, this is really confusing and there is a lot of maths going on here
                               * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
                               *
                  Severity: Major
                  Found in assets/lib/Chart.js - About 2 hrs to fix

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

                            draw : function(){
                    
                                var ctx = this.chart.ctx;
                    
                                ctx.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);
                    Severity: Major
                    Found in assets/lib/Chart.js - About 2 hrs to fix

                      Function initialize has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              initialize: function(data){
                                  this.PointClass = Chart.Point.extend({
                                      strokeWidth : this.options.pointDotStrokeWidth,
                                      radius : this.options.pointDotRadius,
                                      display: this.options.pointDot,
                      Severity: Major
                      Found in assets/lib/Chart.js - About 2 hrs to fix

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

                                buildScale : function(labels){
                                    var self = this;
                        
                                    var dataTotal = function(){
                                        var values = [];
                        Severity: Minor
                        Found in assets/lib/Chart.js - About 2 hrs to fix

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

                                  buildScale : function(labels){
                                      var self = this;
                          
                                      var dataTotal = function(){
                                          var values = [];
                          Severity: Minor
                          Found in assets/lib/Chart.js - About 2 hrs to fix

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

                                    initialize:  function(data){
                                        this.segments = [];
                                        //Declare segment class as a chart instance specific class, so it can share props for this instance
                                        this.SegmentArc = Chart.Arc.extend({
                                            showStroke : this.options.segmentShowStroke,
                            Severity: Minor
                            Found in assets/lib/Chart.js - About 2 hrs to fix

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

                                      calculateXLabelRotation : function(){
                                          //Get the width of each grid by calculating the difference
                                          //between x offsets between 0 and 1.
                              
                                          this.ctx.font = this.font;
                              Severity: Minor
                              Found in assets/lib/Chart.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                if (this.datasets && this.datasets.length > 1) {
                                                    var dataArray,
                                                        dataIndex;
                                
                                                    for (var i = this.datasets.length - 1; i >= 0; i--) {
                                Severity: Critical
                                Found in assets/lib/Chart.js - About 1 hr to fix

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

                                          updateScaleRange: function(datasets){
                                              var valuesArray = (function(){
                                                  var totalDataArray = [];
                                                  helpers.each(datasets,function(dataset){
                                                      if (dataset.data){
                                  Severity: Minor
                                  Found in assets/lib/Chart.js - About 1 hr to fix

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

                                            buildScale : function(data){
                                                this.scale = new Chart.RadialScale({
                                                    display: this.options.showScale,
                                                    fontStyle: this.options.scaleFontStyle,
                                                    fontSize: this.options.scaleFontSize,
                                    Severity: Minor
                                    Found in assets/lib/Chart.js - About 1 hr to fix

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

                                                              medianPosition = (function(index) {
                                      
                                                                  // Get all the points at that particular index
                                                                  var Elements = [],
                                                                      dataCollection,
                                      Severity: Minor
                                      Found in assets/lib/Chart.js - About 1 hr to fix

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

                                                draw : function(ease){
                                                    var easeDecimal = ease || 1,
                                                        ctx = this.chart.ctx;
                                                    this.clear();
                                                    this.scale.draw();
                                        Severity: Minor
                                        Found in assets/lib/Chart.js - About 1 hr to fix

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

                                                  updateScaleRange: function(datapoints){
                                                      var valuesArray = [];
                                                      helpers.each(datapoints,function(segment){
                                                          valuesArray.push(segment.value);
                                                      });
                                          Severity: Minor
                                          Found in assets/lib/Chart.js - About 1 hr to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                            for (var i=0;i<this.valuesCount;i++)
                                                                            {
                                                                                pointPosition = this.getPointPosition(i, this.calculateCenterOffset(this.min + (index * this.stepValue)));
                                                                                if (i === 0){
                                                                                    ctx.moveTo(pointPosition.x, pointPosition.y);
                                            Severity: Major
                                            Found in assets/lib/Chart.js - About 45 mins to fix

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

                                                      animationLoop = helpers.animationLoop = function(callback,totalSteps,easingString,onProgress,onComplete,chartInstance){
                                              Severity: Minor
                                              Found in assets/lib/Chart.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                    if (pointPosition.x - textWidth < furthestLeft) {
                                                                        furthestLeft = pointPosition.x - textWidth;
                                                                        furthestLeftIndex = i;
                                                                    }
                                                Severity: Major
                                                Found in assets/lib/Chart.js - About 45 mins to fix

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

                                                          drawRoundedRectangle = helpers.drawRoundedRectangle = function(ctx,x,y,width,height,radius){
                                                  Severity: Minor
                                                  Found in assets/lib/Chart.js - About 45 mins to fix

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

                                                            calculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){
                                                    Severity: Minor
                                                    Found in assets/lib/Chart.js - About 35 mins to fix

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

                                                                  if (this.options.showTooltips){
                                                                      helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                                                          var activePoints = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];
                                                                          this.eachPoints(function(point){
                                                                              point.restore(['fillColor', 'strokeColor']);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 2 other locations - About 6 hrs to fix
                                                      assets/lib/Chart.js on lines 2016..2029
                                                      assets/lib/Chart.js on lines 3119..3133

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

                                                      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

                                                                  if (this.options.showTooltips){
                                                                      helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                                                          var activeBars = (evt.type !== 'mouseout') ? this.getBarsAtEvent(evt) : [];
                                                      
                                                                          this.eachBars(function(bar){
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 2 other locations - About 6 hrs to fix
                                                      assets/lib/Chart.js on lines 2493..2505
                                                      assets/lib/Chart.js on lines 3119..3133

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

                                                      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

                                                                  if (this.options.showTooltips){
                                                                      helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                                                          var activePointsCollection = (evt.type !== 'mouseout') ? this.getPointsAtEvent(evt) : [];
                                                      
                                                                          this.eachPoints(function(point){
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 2 other locations - About 6 hrs to fix
                                                      assets/lib/Chart.js on lines 2016..2029
                                                      assets/lib/Chart.js on lines 2493..2505

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

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  var scaleSizes = (this.options.scaleOverride) ?
                                                                      {
                                                                          steps: this.options.scaleSteps,
                                                                          stepValue: this.options.scaleStepWidth,
                                                                          min: this.options.scaleStartValue,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 6 hrs to fix
                                                      assets/lib/Chart.js on lines 3255..3268

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

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  var scaleSizes = (this.options.scaleOverride) ?
                                                                      {
                                                                          steps: this.options.scaleSteps,
                                                                          stepValue: this.options.scaleStepWidth,
                                                                          min: this.options.scaleStartValue,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 6 hrs to fix
                                                      assets/lib/Chart.js on lines 2954..2967

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

                                                      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.options.showTooltips){
                                                                      helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                                                          var activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];
                                                      
                                                                          helpers.each(this.segments,function(segment){
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 5 hrs to fix
                                                      assets/lib/Chart.js on lines 2893..2904

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

                                                      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.options.showTooltips){
                                                                      helpers.bindEvents(this, this.options.tooltipEvents, function(evt){
                                                                          var activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt) : [];
                                                                          helpers.each(this.segments,function(segment){
                                                                              segment.restore(["fillColor"]);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 5 hrs to fix
                                                      assets/lib/Chart.js on lines 2298..2310

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

                                                      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

                                                                      helpers.each(dataset.data,function(dataPoint,index){
                                                                          //Add a new point for each piece of data, passing any required data to draw.
                                                                          datasetObject.bars.push(new this.BarClass({
                                                                              value : dataPoint,
                                                                              label : data.labels[index],
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 4 hrs to fix
                                                      assets/lib/Chart.js on lines 2522..2533

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 129.

                                                      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

                                                                      helpers.each(dataset.data,function(dataPoint,index){
                                                                          //Add a new point for each piece of data, passing any required data to draw.
                                                                          datasetObject.points.push(new this.PointClass({
                                                                              value : dataPoint,
                                                                              label : data.labels[index],
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 4 hrs to fix
                                                      assets/lib/Chart.js on lines 2050..2061

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

                                                      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.options.scaleOverride){
                                                                      helpers.extend(scaleOptions, {
                                                                          calculateYRange: helpers.noop,
                                                                          steps: this.options.scaleSteps,
                                                                          stepValue: this.options.scaleStepWidth,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 3 hrs to fix
                                                      assets/lib/Chart.js on lines 2160..2168

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

                                                      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.options.scaleOverride){
                                                                      helpers.extend(scaleOptions, {
                                                                          calculateYRange: helpers.noop,
                                                                          steps: this.options.scaleSteps,
                                                                          stepValue: this.options.scaleStepWidth,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 3 hrs to fix
                                                      assets/lib/Chart.js on lines 2622..2630

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

                                                      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

                                                              update : function(){
                                                                  this.scale.update();
                                                                  // Reset any highlight colours before updating.
                                                                  helpers.each(this.activeElements, function(activeElement){
                                                                      activeElement.restore(['fillColor', 'strokeColor']);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 3 hrs to fix
                                                      assets/lib/Chart.js on lines 2551..2561

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

                                                      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

                                                              update : function(){
                                                                  this.scale.update();
                                                                  // Reset any highlight colours before updating.
                                                                  helpers.each(this.activeElements, function(activeElement){
                                                                      activeElement.restore(['fillColor', 'strokeColor']);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 3 hrs to fix
                                                      assets/lib/Chart.js on lines 2080..2091

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

                                                      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

                                                              getSegmentsAtEvent : function(e){
                                                                  var segmentsArray = [];
                                                      
                                                                  var location = helpers.getRelativePosition(e);
                                                      
                                                      
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 2319..2328

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

                                                      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

                                                              getSegmentsAtEvent : function(e){
                                                                  var segmentsArray = [];
                                                      
                                                                  var location = helpers.getRelativePosition(e);
                                                      
                                                      
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 2908..2917

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

                                                      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

                                                              cancelAnimFrame = helpers.cancelAnimFrame = (function(){
                                                                  return window.cancelAnimationFrame ||
                                                                      window.webkitCancelAnimationFrame ||
                                                                      window.mozCancelAnimationFrame ||
                                                                      window.oCancelAnimationFrame ||
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 643..652

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

                                                      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

                                                              requestAnimFrame = helpers.requestAnimFrame = (function(){
                                                                  return window.requestAnimationFrame ||
                                                                      window.webkitRequestAnimationFrame ||
                                                                      window.mozRequestAnimationFrame ||
                                                                      window.oRequestAnimationFrame ||
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 653..662

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

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  for (var i=0; i<=this.steps; i++){
                                                                      this.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));
                                                                  }
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 1671..1673

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 81.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  for (var i=0; i<=this.steps; i++){
                                                                      this.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));
                                                                  }
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 1411..1413

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 81.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                              removeData: function(atIndex){
                                                                  var indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;
                                                                  this.segments.splice(indexToDelete, 1);
                                                                  this.reflow();
                                                                  this.update();
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 2372..2377

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

                                                      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

                                                              removeData: function(atIndex){
                                                                  var indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;
                                                                  this.segments.splice(indexToDelete, 1);
                                                                  this.reflow();
                                                                  this.update();
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 2935..2940

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

                                                      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 (index > 0){
                                                                              // This is a grid line in the centre, so drop that
                                                                              ctx.lineWidth = this.gridLineWidth;
                                                                              ctx.strokeStyle = this.gridLineColor;
                                                                          } else {
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 1606..1614

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 79.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                          if (index > 0){
                                                                              // This is a grid line in the centre, so drop that
                                                                              ctx.lineWidth = this.gridLineWidth;
                                                                              ctx.strokeStyle = this.gridLineColor;
                                                                          } else {
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 1571..1579

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 79.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                              removeData : function(){
                                                                  this.scale.removeXLabel();
                                                                  //Then re-render the chart.
                                                                  helpers.each(this.datasets,function(dataset){
                                                                      dataset.bars.shift();
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 2654..2661

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

                                                      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

                                                              removeData : function(){
                                                                  this.scale.removeXLabel();
                                                                  //Then re-render the chart.
                                                                  helpers.each(this.datasets,function(dataset){
                                                                      dataset.points.shift();
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 2 hrs to fix
                                                      assets/lib/Chart.js on lines 2192..2199

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

                                                      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

                                                                      if (a < Math.abs(1)) {
                                                                          a = 1;
                                                                          s = p / 4;
                                                                      } else s = p / (2 * Math.PI) * Math.asin(1 / a);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 2 other locations - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 577..580
                                                      assets/lib/Chart.js on lines 603..606

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

                                                                      if (a < Math.abs(1)) {
                                                                          a = 1;
                                                                          s = p / 4;
                                                                      } else s = p / (2 * Math.PI) * Math.asin(1 / a);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 2 other locations - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 577..580
                                                      assets/lib/Chart.js on lines 590..593

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

                                                                      if (a < Math.abs(1)) {
                                                                          a = 1;
                                                                          s = p / 4;
                                                                      } else s = p / (2 * Math.PI) * Math.asin(1 / a);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 2 other locations - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 590..593
                                                      assets/lib/Chart.js on lines 603..606

                                                      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

                                                                      inner : {
                                                                          x : MiddlePoint.x-fa*(AfterPoint.x-FirstPoint.x),
                                                                          y : MiddlePoint.y-fa*(AfterPoint.y-FirstPoint.y)
                                                                      },
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 352..355

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 64.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      outer : {
                                                                          x: MiddlePoint.x+fb*(AfterPoint.x-FirstPoint.x),
                                                                          y : MiddlePoint.y+fb*(AfterPoint.y-FirstPoint.y)
                                                                      }
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 348..351

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 64.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      var datasetObject = {
                                                                          label: dataset.label || null,
                                                                          fillColor : dataset.fillColor,
                                                                          strokeColor : dataset.strokeColor,
                                                                          pointColor : dataset.pointColor,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2510..2517

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

                                                      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 datasetObject = {
                                                                          label : dataset.label || null,
                                                                          fillColor : dataset.fillColor,
                                                                          strokeColor : dataset.strokeColor,
                                                                          pointColor : dataset.pointColor,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 3138..3145

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

                                                      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 (point.controlPoints.inner.y > this.scale.endPoint){
                                                                                  point.controlPoints.inner.y = this.scale.endPoint;
                                                                              }
                                                                              else if (point.controlPoints.inner.y < this.scale.startPoint){
                                                                                  point.controlPoints.inner.y = this.scale.startPoint;
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2720..2725

                                                      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

                                                                  var d01=Math.sqrt(Math.pow(MiddlePoint.x-FirstPoint.x,2)+Math.pow(MiddlePoint.y-FirstPoint.y,2)),
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 344..344

                                                      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

                                                                      d12=Math.sqrt(Math.pow(AfterPoint.x-MiddlePoint.x,2)+Math.pow(AfterPoint.y-MiddlePoint.y,2)),
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 343..343

                                                      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

                                                                              if (point.controlPoints.outer.y > this.scale.endPoint){
                                                                                  point.controlPoints.outer.y = this.scale.endPoint;
                                                                              }
                                                                              else if (point.controlPoints.outer.y < this.scale.startPoint){
                                                                                  point.controlPoints.outer.y = this.scale.startPoint;
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2728..2733

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

                                                                      ctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 1395..1395

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 58.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      ctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 1392..1392

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 58.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  this.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -    this.options.segmentStrokeWidth/2)/2;
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2289..2289

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 58.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 607..607

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 58.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  this.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -    this.options.segmentStrokeWidth/2)/2;
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2384..2384

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 58.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      if (t < 1) return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 581..581

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 58.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      calculateYRange: function(currentHeight){
                                                                          var updatedRanges = helpers.calculateScaleRange(
                                                                              dataTotal(),
                                                                              currentHeight,
                                                                              this.fontSize,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2601..2610

                                                      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

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

                                                                      calculateYRange : function(currentHeight){
                                                                          var updatedRanges = helpers.calculateScaleRange(
                                                                              dataTotal(),
                                                                              currentHeight,
                                                                              this.fontSize,
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2139..2148

                                                      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

                                                                  this.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 1662..1662

                                                      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

                                                                      this.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 1650..1650

                                                      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

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

                                                                  helpers.extend(this.SegmentArc.prototype,{
                                                                      x : this.chart.width/2,
                                                                      y : this.chart.height/2
                                                                  });
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2380..2383

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

                                                      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

                                                                  helpers.extend(this.SegmentArc.prototype,{
                                                                      x : this.chart.width/2,
                                                                      y : this.chart.height/2
                                                                  });
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2989..2992

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

                                                      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 (index === 0){
                                                                              ctx.moveTo(point.x,point.y);
                                                                          }
                                                                          else{
                                                                              ctx.lineTo(point.x,point.y);
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 1831..1835

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

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  var dataTotal = function(){
                                                                      var values = [];
                                                                      self.eachPoints(function(point){
                                                                          values.push(point.value);
                                                                      });
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2119..2125

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

                                                      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 (i === 0){
                                                                                              ctx.moveTo(pointPosition.x, pointPosition.y);
                                                                                          } else {
                                                                                              ctx.lineTo(pointPosition.x, pointPosition.y);
                                                                                          }
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 3347..3352

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 55.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  var dataTotal = function(){
                                                                      var values = [];
                                                                      self.eachBars(function(bar){
                                                                          values.push(bar.value);
                                                                      });
                                                      Severity: Major
                                                      Found in assets/lib/Chart.js and 1 other location - About 1 hr to fix
                                                      assets/lib/Chart.js on lines 2580..2587

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

                                                      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 (index < this.segments.length-1){
                                                                          this.segments[index+1].startAngle = segment.endAngle;
                                                                      }
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 50 mins to fix
                                                      assets/lib/Chart.js on lines 3027..3029

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 52.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      if (index < this.segments.length - 1){
                                                                          this.segments[index+1].startAngle = segment.endAngle;
                                                                      }
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 50 mins to fix
                                                      assets/lib/Chart.js on lines 2409..2411

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 52.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                              eachPoints : function(callback){
                                                                  helpers.each(this.datasets,function(dataset){
                                                                      helpers.each(dataset.points,callback,this);
                                                                  },this);
                                                              },
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 50 mins to fix
                                                      assets/lib/Chart.js on lines 2562..2566

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 51.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                              eachPoints : function(callback){
                                                                  helpers.each(this.datasets,function(dataset){
                                                                      helpers.each(dataset.points,callback,this);
                                                                  },this);
                                                              },
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 50 mins to fix
                                                      assets/lib/Chart.js on lines 3172..3176

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 51.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      else if (i < this.valuesCount/2) {
                                                                          // Less than half the values means we'll left align the text
                                                                          if (pointPosition.x + textWidth > furthestRight) {
                                                                              furthestRight = pointPosition.x + textWidth;
                                                                              furthestRightIndex = i;
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 35 mins to fix
                                                      assets/lib/Chart.js on lines 1752..1758

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 47.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  if (node.addEventListener){
                                                                      node.addEventListener(eventType,method);
                                                                  } else if (node.attachEvent){
                                                                      node.attachEvent("on"+eventType, method);
                                                                  } else {
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 35 mins to fix
                                                      assets/lib/Chart.js on lines 716..722

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 47.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                  if (node.removeEventListener){
                                                                      node.removeEventListener(eventType, handler, false);
                                                                  } else if (node.detachEvent){
                                                                      node.detachEvent("on"+eventType,handler);
                                                                  } else{
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 35 mins to fix
                                                      assets/lib/Chart.js on lines 707..713

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 47.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

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

                                                                      else if (i > this.valuesCount/2){
                                                                          // More than half the values means we'll right align the text
                                                                          if (pointPosition.x - textWidth < furthestLeft) {
                                                                              furthestLeft = pointPosition.x - textWidth;
                                                                              furthestLeftIndex = i;
                                                      Severity: Minor
                                                      Found in assets/lib/Chart.js and 1 other location - About 35 mins to fix
                                                      assets/lib/Chart.js on lines 1745..1758

                                                      Duplicated Code

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

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

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

                                                      Tuning

                                                      This issue has a mass of 47.

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

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

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

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

                                                      Refactorings

                                                      Further Reading

                                                      There are no issues that match your filters.

                                                      Category
                                                      Status