backlogs/redmine_backlogs

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

Summary

Maintainability
F
1 wk
Test Coverage

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

    $.jqplot.MeterGaugeRenderer.prototype.draw = function (ctx, gd, options) {
        var i;
        var opts = (options != undefined) ? options : {};
        // offset and direction of offset due to legend placement
        var offx = 0;

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

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

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

          $.jqplot.MeterGaugeRenderer.prototype.init = function(options) {
              // Group: Properties
              //
              // prop: diameter
              // Outer diameter of the meterGauge, auto computed by default

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

            $.jqplot.MeterGaugeLegendRenderer.prototype.draw = function() {
                if (this.show) {
                    var series = this._series;
                    var ss = 'position:absolute;';
                    ss += (this.background) ? 'background:'+this.background+';' : '';

          Avoid deeply nested control flow statements.
          Open

                                  if (temp == parseInt(temp, 10)) {
                                      this.numberMinorTicks = nums[i]-1;
                                      break;
                                  }

            Avoid deeply nested control flow statements.
            Open

                                    if (parseInt(tmin, 10) != tmin && parseInt(tmin-t[tpindex], 10) == tmin-t[tpindex]) {
                                        tmin = tmin - t[tpindex];
                                    }

              Avoid deeply nested control flow statements.
              Open

                                      for (var j=1; j<=nmt; j++) {
                                          ctx.beginPath();
                                          ctx.moveTo(-orad * Math.cos(ts*i+mts*j+sa), orad * Math.sin(ts*i+mts*j+sa));
                                          ctx.lineTo(-(orad-mtl) * Math.cos(ts*i+mts*j+sa), (orad-mtl) * Math.sin(ts*i+mts*j+sa));
                                          ctx.stroke();

                Avoid deeply nested control flow statements.
                Open

                                        if (idx < pd.length){
                                            // debugger
                                            lt = this.labels[idx] || pd[idx][0].toString();
                                            color = s.color;
                                            if (!reverse){

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

                      $.jqplot.MeterGaugeAxisRenderer.prototype.init = function(options){
                          //
                          this.tickRenderer = $.jqplot.MeterGaugeTickRenderer;
                          $.extend(true, this, options);
                          // I don't think I'm going to need _dataBounds here.
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.donutRenderer.js on lines 467..483
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pieRenderer.js on lines 515..531

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

                  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.data[0][1] < this.min - dataspan*3/this.span) {
                                      datapoint = this.min - dataspan*3/this.span;
                                  }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 789..791

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

                  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.data[0][1] > this.max + dataspan*3/this.span) {
                                      datapoint = this.max + dataspan*3/this.span;
                                  }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 792..794

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                              this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.donutRenderer.js on lines 400..400

                  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

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

                                      this._tickPoints.push([(orad-tl) * Math.cos(ts*i+sa) + this._center[0] + this.canvas._offsets.left, (orad - tl) * Math.sin(ts*i+sa) + this._center[1] + this.canvas._offsets.top, ts*i+sa]);
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 695..695

                  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 (var i=0; i<stack.length; i++) {
                              td[i][1] = stack[i] * fact;
                          }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 297..299

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

                  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<stack.length; i++) {
                              td[i][1] = stack[i] * fact;
                          }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 278..280

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

                  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

                                      t = this._tickPoints[i][1] - eh/2 + eh/2 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) + tp/3 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) ;
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 720..720

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 47.

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

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

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

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

                  Refactorings

                  Further Reading

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

                                  if (!this.numberMinorTicks) {
                                      this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
                                  }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 228..230
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 547..549
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 583..585

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

                  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 (!this.numberMinorTicks) {
                                      this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
                                  }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 228..230
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 519..521
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 547..549

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

                  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 (!this.numberMinorTicks) {
                                  this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
                              }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 519..521
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 547..549
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 583..585

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

                  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 (!this.numberMinorTicks) {
                                      this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
                                  }
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 228..230
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 519..521
                  assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.meterGaugeRenderer.js on lines 583..585

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

                  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