backlogs/redmine_backlogs

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

Summary

Maintainability
F
1 wk
Test Coverage

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

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

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

        $.jqplot.PyramidAxisRenderer.prototype.createTicks = function(plot) {
            // we're are operating on an axis here
            var userTicks = this.ticks;
            // databounds were set on axis initialization.
            var db = this._dataBounds;

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

          $.jqplot.PyramidAxisRenderer.prototype.pack = function(pos, offsets) { 
              // Add defaults for repacking from resetTickValues function.
              pos = pos || {};
              offsets = offsets || this._offsets;
              

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

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

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

              $.jqplot.PyramidAxisRenderer.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 resetDataBounds has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.jqplot.PyramidAxisRenderer.prototype.resetDataBounds = function() {
                    // Go through all the series attached to this axis and find
                    // the min/max bounds for this axis.
                    var db = this._dataBounds;
                    db.min = null;

              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

                                        if (range/(i - 1) === Math.round(range/(i - 1))) {
                                            this.numberTicks = i;
                                            this.tickInterval = range/(i - 1);
                                            break;
                                        }

                  Avoid deeply nested control flow statements.
                  Open

                                          for (i=1, l=this._ticks.length; i<l; i++) {
                                              if (count <= skip) {
                                                  this._ticks[i].show = false;
                                                  count += 1;
                                              }

                    Avoid deeply nested control flow statements.
                    Open

                                            if (temp % i === 0 && temp/i < maxVisibleTicks) {
                                                skip = i-1;
                                                break;
                                            }

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

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

                                    if (this.name.charAt(0) === 'x') {
                                        for (var i=0; i<ticks.length; i++) {
                                            var t = ticks[i];
                                            if (t.show && t.showLabel) {
                                                var shim;
                        assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6818..6933

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

                        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 {
                                            temp = d[j][0];
                                            if ((temp !== null && temp < db.min) || db.min === null) {
                                                db.min = temp;
                                            }
                        assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidAxisRenderer.js on lines 84..92

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

                        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.charAt(0) === 'x') {
                                            temp = d[j][1];
                                            if ((temp !== null && temp < db.min) || db.min === null) {
                                                db.min = temp;
                                            }
                        assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.pyramidAxisRenderer.js on lines 93..101

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

                        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.categoryAxisRenderer.js on lines 321..326

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

                                    if (this._overrideFormatString && this._autoFormatString != '') {
                                        this.tickOptions = this.tickOptions || {};
                                        this.tickOptions.formatString = this._autoFormatString;
                                    }
                        assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6650..6653

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                    if (this._label.show) {
                                        var elem = this._label.draw(ctx, plot);
                                        elem.appendTo(this._elem);
                                        elem = null;
                                    }
                        assets/javascripts/jquery/jquery.jqplot/jquery.jqplot.js on lines 6078..6082

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

                        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.mekkoAxisRenderer.js on lines 186..189

                        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 3 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/jquery.jqplot.js on lines 6223..6245
                        assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.logAxisRenderer.js on lines 126..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 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

                        There are no issues that match your filters.

                        Category
                        Status