sodabrew/puppet-dashboard

View on GitHub

Showing 682 of 682 total issues

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

/**
 * Title: jqPlot Charts
 * 
 * Pure JavaScript plotting plugin for jQuery.
 * 
Severity: Major
Found in app/assets/javascripts/jquery.jqplot.js - About 3 wks to fix

    Function jqPlot has 1533 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function jqPlot() {
            // Group: Properties
            // These properties are specified at the top of the options object
            // like so:
            // > {
    Severity: Major
    Found in app/assets/javascripts/jquery.jqplot.js - About 1 wk to fix

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

               if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) {
                   tx = 0;
                   ty = -Math.sin(this.angle) * this.width;
               }
               // 4th quadrant
      Severity: Major
      Found in app/assets/javascripts/jqplot.canvasTextRenderer.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jqplot.canvasTextRenderer.js on lines 417..435

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

      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 ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) {
                   tx = 0;
                   ty = -Math.sin(this.angle) * this.width;
               }
               // 4th quadrant
      Severity: Major
      Found in app/assets/javascripts/jqplot.canvasTextRenderer.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jqplot.canvasTextRenderer.js on lines 227..245

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

      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.series.length; i++) {
                      // set default stacking order for series canvases
                      this.seriesStack.push(i);
                      this.previousSeriesStack.push(i);
                      this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jquery.jqplot.js on lines 2292..2315

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

      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, l=this.series.length; i<l; i++) {
                      // set default stacking order for series canvases
                      this.seriesStack.push(i);
                      this.previousSeriesStack.push(i);
                      this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jquery.jqplot.js on lines 2103..2126

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

      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<ticks.length; i++) {
                          var t = ticks[i];
                          if (t.show && t.showLabel) {
                              var shim;
                              
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jqplot.categoryAxisRenderer.js on lines 513..553

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

      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 (i=0; i<ticks.length; i++) {
                          var t = ticks[i];
                          if (t.show && t.showLabel) {
                              var shim;
                              
      Severity: Major
      Found in app/assets/javascripts/jqplot.categoryAxisRenderer.js and 1 other location - About 3 days to fix
      app/assets/javascripts/jquery.jqplot.js on lines 6917..6957

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

      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<ticks.length; i++) {
                          var t = ticks[i];
                          if (t.show && t.showLabel) {                        
                              var shim;
                              if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 2 days to fix
      app/assets/javascripts/jqplot.categoryAxisRenderer.js on lines 590..638

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

      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 (i=0; i<ticks.length; i++) {
                          var t = ticks[i];
                          if (t.show && t.showLabel) {                        
                              var shim;
                              if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
      Severity: Major
      Found in app/assets/javascripts/jqplot.categoryAxisRenderer.js and 1 other location - About 2 days to fix
      app/assets/javascripts/jquery.jqplot.js on lines 6971..7019

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

      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 (r.constructor == $.jqplot.OHLCRenderer) {
                                          if (r.candleStick) {
                                              var yp = s._yaxis.series_u2p;
                                              if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
                                                  return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 2 days to fix
      app/assets/javascripts/jquery.jqplot.js on lines 3445..3474

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

      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 (r.constructor == $.jqplot.OHLCRenderer) {
                                              if (r.candleStick) {
                                                  var yp = s._yaxis.series_u2p;
                                                  if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
                                                      return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 2 days to fix
      app/assets/javascripts/jquery.jqplot.js on lines 3490..3519

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

      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

      Function TokenList has 388 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      $.TokenList = function (input, settings) {
          //
          // Variables
          //
      
      
      Severity: Major
      Found in app/assets/javascripts/jquery.tokeninput.js - About 1 day to fix

        Similar blocks of code found in 2 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') {
        Severity: Major
        Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 1 day to fix
        app/assets/javascripts/jqplot.categoryAxisRenderer.js on lines 405..426

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

                    if (this.name == 'xaxis') {
                        dim += dim2 + h;
                        this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
                    }
                    else if (this.name == 'x2axis') {
        Severity: Major
        Found in app/assets/javascripts/jqplot.categoryAxisRenderer.js and 1 other location - About 1 day to fix
        app/assets/javascripts/jquery.jqplot.js on lines 6241..6262

        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

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

            $.jqplot.LinearAxisRenderer.prototype.createTicks = function(plot) {
                // we're are operating on an axis here
                var ticks = this._ticks;
                var userTicks = this.ticks;
                var name = this.name;
        Severity: Major
        Found in app/assets/javascripts/jquery.jqplot.js - About 1 day to fix

          File jquery.colorbox.js has 763 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*!
              jQuery Colorbox v1.4.10 - 2013-04-02
              (c) 2013 Jack Moore - jacklmoore.com/colorbox
              license: http://www.opensource.org/licenses/mit-license.php
          */
          Severity: Major
          Found in app/assets/javascripts/jquery.colorbox.js - About 1 day to fix

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

                    if (this.yoffset >0) {
                        if (this.placement == 'outside') {
                            switch (this.location) {
                                case 'sw':
                                case 's':
            Severity: Major
            Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 1 day to fix
            app/assets/javascripts/jquery.jqplot.js on lines 962..1006

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

            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.xoffset >0) {
                        if (this.placement == 'insideGrid') {
                            switch (this.location) {
                                case 'nw':
                                case 'w':
            Severity: Major
            Found in app/assets/javascripts/jquery.jqplot.js and 1 other location - About 1 day to fix
            app/assets/javascripts/jquery.jqplot.js on lines 1008..1052

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

            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

            Function checkIntersection has 264 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function checkIntersection(gridpos, plot) {
                        var series = plot.series;
                        var i, j, k, s, r, x, y, theta, sm, sa, minang, maxang;
                        var d0, d, p, pp, points, bw, hp;
                        var threshold, t;
            Severity: Major
            Found in app/assets/javascripts/jquery.jqplot.js - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language