backlogs/redmine_backlogs

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

Summary

Maintainability
F
6 days
Test Coverage

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

    $.jqplot.OHLCRenderer.prototype.draw = function(ctx, gd, options) {
        var d = this.data;
        var xmin = this._xaxis.min;
        var xmax = this._xaxis.max;
        // index of last value below range of plot.

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

        $.jqplot.OHLCRenderer.prototype.init = function(options) {
            options = options || {};
            // lineWidth has to be set on the series, changes in renderer
            // constructor have no effect.  set the default here
            // if no renderer option for lineWidth is specified.

      Avoid deeply nested control flow statements.
      Open

                              if (r.wickColor) {
                                  o.color = r.wickColor;
                              }
                              else if (r.downBodyColor) {
                                  o.color = r.upBodyColor;
      Severity: Major
      Found in assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            else if (close >  open) {
                                // draw wick
                                if (r.wickColor) {
                                    o.color = r.wickColor;
                                }
        Severity: Major
        Found in assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if (r.upBodyColor) {
                                      o.color = r.upBodyColor;
                                      o.fillStyle = r.upBodyColor;
                                  }
          Severity: Major
          Found in assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (r.fillUpBody) {
                                        o.fillRect = true;
                                    }
                                    else {
                                        o.strokeRect = true;
            Severity: Major
            Found in assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.js - About 45 mins to fix

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

                                  if (close < open) {
                                      // draw wick
                                      if (r.wickColor) {
                                          o.color = r.wickColor;
                                      }
              assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.js on lines 273..320

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

              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 (close >  open) {
                                      // draw wick
                                      if (r.wickColor) {
                                          o.color = r.wickColor;
                                      }
              assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.js on lines 243..320

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

              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 (r.hlc) {
                                  open = null;
                                  hi = yp(d[i][1]);
                                  low = yp(d[i][2]);
                                  close = yp(d[i][3]);
              assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.min.js on lines 57..57

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

              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 (d[0].length < 5) {
                          this.renderer.hlc = true;
              
                          for (var j=0; j<d.length; j++) { 
                              if (d[j][2] < db.min || db.min == null) {
              assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.min.js on lines 57..57

              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

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

                          if (r.candleStick) {
                              if (typeof(r.bodyWidth) == 'number') {
                                  r._bodyWidth = r.bodyWidth;
                              }
                              else {
              assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.min.js on lines 57..57

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

              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

                          try {
                              var dinterval = Math.abs(this._xaxis.series_u2p(parseInt(this._xaxis._intervalStats[0].sortedIntervals[0].interval, 10)) - this._xaxis.series_u2p(0)); 
                          }
              
                          catch (e) {
              assets/javascripts/jquery/jquery.jqplot/plugins/jqplot.ohlcRenderer.min.js on lines 57..57

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

              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