backlogs/redmine_backlogs

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

Summary

Maintainability
F
6 days
Test Coverage

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

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

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

        $.jqplot.LogAxisRenderer.prototype.pack = function(pos, offsets) {
            var lb = parseInt(this.base, 10);
            var ticks = this._ticks;
            var trans = function (v) { return Math.log(v)/Math.log(lb); };
            var invtrans = function (v) { return Math.pow(Math.E, (Math.log(lb)*v)); };

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

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

        Avoid deeply nested control flow statements.
        Open

                            if (minorTicks === 0) {
                                minorTicks = 1;
                            }

          Avoid deeply nested control flow statements.
          Open

                          for (var i=0; i<nt; i++) {
                              opts.value = this.min + i * ti;
                              t = new this.tickRenderer(opts);
                              
                              if (this._overrideFormatString && this._autoFormatString != '') {

            Avoid deeply nested control flow statements.
            Open

                                if (numberTicks < 2) {
                                    numberTicks = 2;
                                }

              Avoid deeply nested control flow statements.
              Open

                                  for (var j=minorTicks-1; j>=0; j--) {
                                      val = tt1-interval*(j+1);
                                      t = new this.tickRenderer(this.tickOptions);
                          
                                      if (this._overrideFormatString && this._autoFormatString != '') {

                Avoid deeply nested control flow statements.
                Open

                            else if (this.numberTicks != null && this.tickInterval != null) {
                                nt = this.numberTicks;
                                for (var i=0; i<nt; i++) {
                                    opts.value = this.min + i * this.tickInterval;
                                    t = new this.tickRenderer(opts);

                  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) {
                                                switch (t.labelPosition) {
                                                    case 'auto':
                                                        // position at end
                                                        if (t.angle < 0) {

                      Avoid deeply nested control flow statements.
                      Open

                                          if (minorTicks === 0) {
                                              var temp = dim/(numberTicks - 1);
                                              if (temp < 100) {
                                                  minorTicks = 0;
                                              }

                        Avoid deeply nested control flow statements.
                        Open

                                                if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
                                                    switch (t.labelPosition) {
                                                        case 'auto':
                                                            // position at end
                                                        case 'end':

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

                                          for (var i=0; i<nt; i++) {
                                              opts.value = this.min + i * ti;
                                              t = new this.tickRenderer(opts);
                                              
                                              if (this._overrideFormatString && this._autoFormatString != '') {
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.dateAxisRenderer.js on lines 499..514

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

                          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.mekkoAxisRenderer.js on lines 236..261

                          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

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

                                          else if ($.isPlainObject(ut)) {
                                              $.extend(true, t, ut);
                                              t.axis = this.name;
                                              this._ticks.push(t);
                                          }
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.mekkoAxisRenderer.js on lines 236..261

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

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

                          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

                                  else {
                                      this.series_u2p = function(u){
                                          return (trans(u) - max) * pixellength / unitlength;
                                      };
                                      this.series_p2u = function(p){
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.logAxisRenderer.js on lines 395..402

                          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

                                      function findFloor(val) {
                                          var order = Math.pow(10, Math.floor(Math.log(val)/Math.LN10));
                                          return Math.floor(val/order) * order;
                                      }
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.logAxisRenderer.js on lines 170..173

                          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

                                      function findCeil (val) {
                                          var order = Math.pow(10, Math.floor(Math.log(val)/Math.LN10));
                                          return Math.ceil(val/order) * order;
                                      }
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.logAxisRenderer.js on lines 175..178

                          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

                                      rmax = Math.pow(this.base, Math.ceil(Math.log(max)/Math.log(this.base)));
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.logAxisRenderer.js on lines 185..185

                          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

                                      rmin = Math.pow(this.base, Math.floor(Math.log(min)/Math.log(this.base)));
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.logAxisRenderer.js on lines 186..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 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 3 locations. Consider refactoring.
                          Open

                                  var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
                          assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6176..6176
                          assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.dateAxisRenderer.js on lines 330..330

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 45.

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

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

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

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

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status