sodabrew/puppet-dashboard

View on GitHub

Showing 682 of 682 total issues

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

/**
 * jqPlot
 * Pure JavaScript plotting plugin using jQuery
 *
 * Version: 1.0.8
Severity: Major
Found in app/assets/javascripts/jqplot.barRenderer.js - About 1 day to fix

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

                            if (x > 0 && -y >= 0) {
                                theta = 2*Math.PI - Math.atan(-y/x);
                            }
                            else if (x > 0 && -y < 0) {
                                theta = -Math.atan(-y/x);
    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 3268..3285

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

    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 (x > 0 && -y >= 0) {
                                theta = 2*Math.PI - Math.atan(-y/x);
                            }
                            else if (x > 0 && -y < 0) {
                                theta = -Math.atan(-y/x);
    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 3313..3330

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

    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 draw has 262 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.jqplot.CanvasGridRenderer.prototype.draw = function() {
            this._ctx = this._elem.get(0).getContext("2d");
            var ctx = this._ctx;
            var axes = this._axes;
            // Add the grid onto the grid canvas.  This is the bottom most layer.
    Severity: Major
    Found in app/assets/javascripts/jquery.jqplot.js - About 1 day to fix

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

      function form_submit_success(jsonResponse, error_messages_element_id) {
      
        if(jsonResponse.status == "error") {
          errorMessagesElement = document.getElementById(error_messages_element_id);
          errorMessagesElement.style.display = "block";
      Severity: Major
      Found in app/assets/javascripts/ajax_helper.js and 1 other location - About 1 day to fix
      app/assets/javascripts/validation_response.js on lines 1..22

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

      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

      function form_submit_success(jsonResponse, error_messages_element_id) {
        if(jsonResponse.status == "error") {
          errorMessagesElement = document.getElementById(error_messages_element_id);
          errorMessagesElement.style.display = "block";
          errorMessagesElement.innerHTML = jsonResponse.error_html;
      Severity: Major
      Found in app/assets/javascripts/validation_response.js and 1 other location - About 1 day to fix
      app/assets/javascripts/ajax_helper.js on lines 1..23

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

      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._type === 'line' && bands.show) {
                  for (var i=0, l=bands.hiData.length; i<l; i++) {
                      this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
                  }
                  for (var i=0, l=bands.lowData.length; i<l; i++) {
      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 5648..5655

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

      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._type === 'line' && bands.show) {
                  for (var i=0, l=bands.hiData.length; i<l; i++) {
                      this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
                  }
                  for (var i=0, l=bands.lowData.length; i<l; i++) {
      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 5561..5568

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

      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 draw has 223 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.jqplot.BarRenderer.prototype.draw = function(ctx, gridData, options, plot) {
              var i;
              // Ughhh, have to make a copy of options b/c it may be modified later.
              var opts = $.extend({}, options);
              var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
      Severity: Major
      Found in app/assets/javascripts/jqplot.barRenderer.js - About 1 day to fix

        Function ajaxSubmit has 222 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        $.fn.ajaxSubmit = function(options) {
            // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
            if (!this.length) {
                log('ajaxSubmit: skipping submit process - no element selected');
                return this;
        Severity: Major
        Found in app/assets/javascripts/jquery.form.js - About 1 day to fix

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

                              if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) {
                                  if (this.varyBarColor && !this._stack) {
                                      if (this.useNegativeColors) {
                                          opts.fillStyle = negativeColors.next();
                                      }
          Severity: Major
          Found in app/assets/javascripts/jqplot.barRenderer.js and 1 other location - About 1 day to fix
          app/assets/javascripts/jqplot.barRenderer.js on lines 516..536

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

          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.fillToZero && this._plotData[i][0] < 0) || (this.waterfall && this._data[i][0] < 0)) {
                                  if (this.varyBarColor && !this._stack) {
                                      if (this.useNegativeColors) {
                                          opts.fillStyle = negativeColors.next();
                                      }
          Severity: Major
          Found in app/assets/javascripts/jqplot.barRenderer.js and 1 other location - About 1 day to fix
          app/assets/javascripts/jqplot.barRenderer.js on lines 420..440

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

          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 pack has 206 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.jqplot.CategoryAxisRenderer.prototype.pack = function(pos, offsets) {
                  var ticks = this._ticks;
                  var max = this.max;
                  var min = this.min;
                  var offmax = offsets.max;
          Severity: Major
          Found in app/assets/javascripts/jqplot.categoryAxisRenderer.js - About 1 day to fix

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

            /**
             * jqPlot
             * Pure JavaScript plotting plugin using jQuery
             *
             * Version: 1.0.8
            Severity: Major
            Found in app/assets/javascripts/jqplot.categoryAxisRenderer.js - About 1 day to fix

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

                              if (lshow) {
                                  var h = this._label._elem.outerHeight(true);
                                  this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
                                  if (this.name == 'yaxis') {
                                      this._label._elem.css('left', '0px');
              Severity: Major
              Found in app/assets/javascripts/jqplot.categoryAxisRenderer.js and 1 other location - About 1 day to fix
              app/assets/javascripts/jqplot.categoryAxisRenderer.js on lines 556..568

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

              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

                       '{': { width: 14, points: [[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]] },
              Severity: Major
              Found in app/assets/javascripts/jqplot.canvasTextRenderer.js and 1 other location - About 1 day to fix
              app/assets/javascripts/jqplot.canvasTextRenderer.js on lines 380..380

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

              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

                       '}': { width: 14, points: [[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]] },
              Severity: Major
              Found in app/assets/javascripts/jqplot.canvasTextRenderer.js and 1 other location - About 1 day to fix
              app/assets/javascripts/jqplot.canvasTextRenderer.js on lines 378..378

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

              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 (lshow) {
                                  var w = this._label._elem.outerWidth(true);
                                  this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
                                  if (this.name == 'xaxis') {
                                      this._label._elem.css('bottom', '0px');
              Severity: Major
              Found in app/assets/javascripts/jqplot.categoryAxisRenderer.js and 1 other location - About 1 day to fix
              app/assets/javascripts/jqplot.categoryAxisRenderer.js on lines 641..653

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

              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 pack has 193 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.jqplot.LinearAxisRenderer.prototype.pack = function(pos, offsets) {
                      // Add defaults for repacking from resetTickValues function.
                      pos = pos || {};
                      offsets = offsets || this._offsets;
                      
              Severity: Major
              Found in app/assets/javascripts/jquery.jqplot.js - About 7 hrs to fix

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

                        this.draw = function(){
                            if (this.drawIfHidden || this.target.is(':visible')) {
                                this.target.trigger('jqplotPreDraw');
                                var i,
                                    j,
                Severity: Major
                Found in app/assets/javascripts/jquery.jqplot.js - About 7 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language