backlogs/redmine_backlogs

View on GitHub
assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidRenderer.js

Summary

Maintainability
F
1 wk
Test Coverage

File jqplot.pyramidRenderer.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * jqPlot
 * Pure JavaScript plotting plugin using jQuery
 *
 * Version: 1.0.0

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

        $.jqplot.PyramidRenderer.prototype.draw = function(ctx, gridData, options) {
            var i;
            // Ughhh, have to make a copy of options b/c it may be modified later.
            var opts = $.extend({}, options);
            var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;

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

          $.jqplot.PyramidRenderer.prototype.init = function(options, plot) {
              options = options || {};
              this._type = 'pyramid';
              // Group: Properties
              //

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

            $.jqplot.PyramidRenderer.prototype.setGridData = function(plot) {
                // recalculate the grid data
                var xp = this._xaxis.series_u2p;
                var yp = this._yaxis.series_u2p;
                var data = this._plotData;

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

              $.jqplot.PyramidRenderer.prototype.makeGridData = function(data, plot) {
                  // recalculate the grid data
                  var xp = this._xaxis.series_u2p;
                  var yp = this._yaxis.series_u2p;
                  var gd = [];

            Avoid deeply nested control flow statements.
            Open

                                    if (this.useNegativeColors) {
                                        opts.fillStyle = negativeColors.next();
                                    }
                                    else {
                                        opts.fillStyle = positiveColors.next();

              Avoid deeply nested control flow statements.
              Open

                                      if (shadow) {
                                          this.renderer.shadowRenderer.draw(ctx, points);
                                      }

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

                    function handleMove(ev, gridpos, datapos, neighbor, plot) {

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

                      function handleMove(ev, gridpos, datapos, neighbor, plot) {
                          if (neighbor) {
                              var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
                              var evt1 = jQuery.Event('jqplotDataMouseOver');
                              evt1.pageX = ev.pageX;
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.barRenderer.js on lines 684..703

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

                  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

                      function postPlotDraw() {
                          // Memory Leaks patch    
                          if (this.plugins.pyramidRenderer && this.plugins.pyramidRenderer.highlightCanvas) {
                  
                              this.plugins.pyramidRenderer.highlightCanvas.resetCanvas();
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.barRenderer.js on lines 645..659

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

                  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

                      function unhighlight (plot) {
                          var canvas = plot.plugins.pyramidRenderer.highlightCanvas;
                          canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
                          for (var i=0; i<plot.series.length; i++) {
                              plot.series[i]._highlightedPoint = null;
                  assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 5880..5889
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.barRenderer.js on lines 672..681

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

                  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 (shadow_offset == null) {
                              // scale the shadowOffset to the width of the line.
                              if (this.lineWidth > 2.5) {
                                  shadow_offset = 1.25 * (1 + (Math.atan((this.lineWidth/2.5))/0.785398163 - 1)*0.6);
                                  // var shadow_offset = this.shadowOffset;
                  assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 4907..4917

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

                  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 (this._yaxis.name === 'yMidAxis' && this.side === 'right') {
                              this._xnudge = this._xaxis.max/2000.0;
                              adjust = true;
                          }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidRenderer.js on lines 229..232

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

                  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 (this._yaxis.name === 'yMidAxis' && this.side === 'right') {
                              this._xnudge = this._xaxis.max/2000.0;
                              adjust = true;
                          }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidRenderer.js on lines 183..186

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                                  if (this._plotData[i][1] < 0) {
                                      if (this.varyBarColor && !this._stack) {
                                          if (this.useNegativeColors) {
                                              opts.fillStyle = negativeColors.next();
                                          }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.barRenderer.js on lines 384..404
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.barRenderer.js on lines 480..497

                  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

                          for (i = 0; i < l; i++) {
                              if (data[i][1] < 0) {
                                  this.side = 'left';
                              }
                          }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidRenderer.js on lines 223..227

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 53.

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

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

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

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

                  Refactorings

                  Further Reading

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

                          for (i = 0; i < l; i++) {
                              if (data[i][1] < 0) {
                                  this.side = 'left';
                              }
                          }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidRenderer.js on lines 177..181

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 53.

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

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

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

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

                  Refactorings

                  Further Reading

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

                              if (this.fill) {
                                  this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding + temp;
                              }
                              else {
                                  this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals;
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidRenderer.js on lines 267..277

                  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

                          if (paxis.name == 'xaxis' || paxis.name == 'x2axis') {
                              this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding + temp;
                          }
                          else {
                              if (this.fill) {
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidRenderer.js on lines 271..276

                  Duplicated Code

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

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

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

                  Tuning

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

                  There are no issues that match your filters.

                  Category
                  Status