backlogs/redmine_backlogs

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

Summary

Maintainability
F
2 wks
Test Coverage

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

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

    Function pack has 178 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.jqplot.CategoryAxisRenderer.prototype.pack = function(pos, offsets) {
            var ticks = this._ticks;
            var max = this.max;
            var min = this.min;
            var offmax = offsets.max;

      Function createTicks has 145 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.jqplot.CategoryAxisRenderer.prototype.createTicks = function() {
              // we're are operating on an axis here
              var ticks = this._ticks;
              var userTicks = this.ticks;
              var name = this.name;

        Function set has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            $.jqplot.CategoryAxisRenderer.prototype.set = function() { 
                var dim = 0;
                var temp;
                var w = 0;
                var h = 0;

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

              $.jqplot.CategoryAxisRenderer.prototype.draw = function(ctx, plot) {
                  if (this.show) {
                      // populate the axis label and value properties.
                      // createTicks is a method on the renderer, but
                      // call it within the scope of the axis.

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

                $.jqplot.CategoryAxisRenderer.prototype.init = function(options){
                    this.groups = 1;
                    this.groupLabels = [];
                    this._groupLabels = [];
                    this._grouped = false;

              Avoid deeply nested control flow statements.
              Open

                                      if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
                                          // will need to adjust auto positioning based on which axis this is.
                                          var temp = (this.name == 'yaxis') ? 1 : -1;
                                          switch (t.labelPosition) {
                                              case 'auto':

                Avoid deeply nested control flow statements.
                Open

                                        if (this._ticks[j]._elem && this._ticks[j].label != " ") {
                                            var t = this._ticks[j]._elem;
                                            var p = t.position();
                                            mid += p.left + t.outerWidth(true)/2;
                                            count++;

                  Avoid deeply nested control flow statements.
                  Open

                                          if (this._ticks[j]._elem && this._ticks[j].label != " ") {
                                              var t = this._ticks[j]._elem;
                                              var p = t.position();
                                              mid += p.top + t.outerHeight()/2;
                                              count++;

                    Avoid deeply nested control flow statements.
                    Open

                                            if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
                                                // will need to adjust auto positioning based on which axis this is.
                                                var temp = (this.name == 'xaxis') ? 1 : -1;
                                                switch (t.labelPosition) {
                                                    case 'auto':

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

                                      for (i=0; i<ticks.length; i++) {
                                          var t = ticks[i];
                                          if (t.show && t.showLabel) {                        
                                              var shim;
                                              if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
                      assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6873..6921

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

                      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.name == 'xaxis') {
                                      dim += dim2 + h;
                                      this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
                                  }
                                  else if (this.name == 'x2axis') {
                      assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6143..6164
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 190..211

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

                      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 (var j=0; j<d.length; j++) { 
                                      if (this.name == 'xaxis' || this.name == 'x2axis') {
                                          if (d[j][0] < db.min || db.min == null) {
                                              db.min = d[j][0];
                                          }
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.BezierCurveRenderer.js on lines 231..248

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

                      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 (lshow) {
                                          var w = this._label._elem.outerWidth(true);
                                          this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
                                          if (this.name == 'xaxis') {
                                              this._label._elem.css('bottom', '0px');
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.categoryAxisRenderer.js on lines 600..612

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

                      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 (lshow) {
                                          var h = this._label._elem.outerHeight(true);
                                          this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
                                          if (this.name == 'yaxis') {
                                              this._label._elem.css('left', '0px');
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.categoryAxisRenderer.js on lines 516..528

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

                      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.name == 'xaxis' || this.name == 'x2axis'){
                                  this.series_u2p = function(u){
                                      return (u - min) * pixellength / unitlength;
                                  };
                                  this.series_p2u = function(p){
                      assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6798..6814
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 466..482

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

                      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<t.length; i++) {
                                      var tick = t[i];
                                      if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
                                          if (this.name == 'xaxis' || this.name == 'x2axis') {
                                              temp = tick._elem.outerHeight(true);
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 171..184

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

                      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.name == 'xaxis' || this.name == 'x2axis') {
                                      this._elem.width(this._plotDimensions.width);
                                  }
                                  else {
                                      this._elem.height(this._plotDimensions.height);
                      assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6068..6073
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidAxisRenderer.js on lines 131..136

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

                                  if (name == 'xaxis' || name == 'x2axis') {
                                      dim = this._plotDimensions.width;
                                  }
                                  else {
                                      dim = this._plotDimensions.height;
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.dateAxisRenderer.js on lines 631..636
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.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 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 (this.min != null && this.max != null && this.numberTicks != null) {
                                      this.tickInterval = null;
                                  }
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.dateAxisRenderer.js on lines 639..641

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 54.

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

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

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

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

                      Refactorings

                      Further Reading

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

                                  if (lshow) {
                                      w = this._label._elem.outerWidth(true);
                                      h = this._label._elem.outerHeight(true); 
                                  }
                      assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6139..6142
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 186..189
                      assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidAxisRenderer.js on lines 485..488

                      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

                      There are no issues that match your filters.

                      Category
                      Status