backlogs/redmine_backlogs

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

Summary

Maintainability
F
1 wk
Test Coverage

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

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

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

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

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

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

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

            $.jqplot.MekkoAxisRenderer.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 set has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

                $.jqplot.MekkoAxisRenderer.prototype.init = function(options){
                    // prop: tickMode
                    // How to space the ticks on the axis.
                    // 'bar' will place a tick at the width of each bar.  
                    // This is the default for the x axis.

              Avoid deeply nested control flow statements.
              Open

                                  if (!this.showTicks) {
                                      t.showLabel = false;
                                      t.showMark = false;
                                  }
                                  else if (!this.showTickMarks) {

                Avoid deeply nested control flow statements.
                Open

                                    if (!this.showTicks) {
                                        t.showLabel = false;
                                        t.showMark = false;
                                    }
                                    else if (!this.showTickMarks) {

                  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

                                    for (i=0; i<this.numberTicks; i++){
                                        tt = this.min + i * this.tickInterval;
                                        t = new this.tickRenderer(this.tickOptions);
                                        // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
                                        if (!this.showTicks) {

                      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':

                        Avoid deeply nested control flow statements.
                        Open

                                                for (i=0; i<ynumticks.length; i++) {
                                                    curr = temp/ynumticks[i];
                                                    if (curr == 1) {
                                                        this.numberTicks = ynumticks[i];
                                                        break;

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

                                      if (this.name == 'xaxis') {
                                          dim = dim + 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.categoryAxisRenderer.js on lines 400..421

                          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

                          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.categoryAxisRenderer.js on lines 453..469

                          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.categoryAxisRenderer.js on lines 367..380

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

                                          for (i=0; i<this.numberTicks; i++){
                                              tt = this.min + i * this.tickInterval;
                                              t = new this.tickRenderer(this.tickOptions);
                                              // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
                                              if (!this.showTicks) {
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 346..359

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

                          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 i=0; i<this.numberTicks; i++){
                                              tt = this.min + i * this.tickInterval;
                                              t = new this.tickRenderer(this.tickOptions);
                                              // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
                                              if (!this.showTicks) {
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 420..433

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

                          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 (ut.constructor == Array) {
                                              t.value = ut[0];
                                              t.label = ut[1];
                                              if (!this.showTicks) {
                                                  t.showLabel = false;
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.logAxisRenderer.js on lines 112..143

                          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

                                  else if (this.name == 'xaxis'){
                                      this.tickMode = (this.tickMode == null) ? 'bar' : this.tickMode;
                                      for (var i=0; i<this._series.length; i++) {
                                          db.max += this._series[i]._sumy;
                                      }
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 78..83

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

                          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 (this.name == 'x2axis'){
                                      this.tickMode = (this.tickMode == null) ? 'even' : this.tickMode;
                                      for (var i=0; i<this._series.length; i++) {
                                          db.max += this._series[i]._sumy;
                                      }
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 72..83

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

                          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 (min == max) {
                                          var adj = 0.05;
                                          if (min > 0) {
                                              adj = Math.max(Math.log(min)/Math.LN10, 0.05);
                                          }
                          assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6350..6357

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

                          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.categoryAxisRenderer.js on lines 170..175
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.dateAxisRenderer.js on lines 631..636

                          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 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.categoryAxisRenderer.js on lines 396..399
                          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