sodabrew/puppet-dashboard

View on GitHub

Showing 290 of 682 total issues

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

    $.jqplot.CategoryAxisRenderer.prototype.createTicks = function() {
        // 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/jqplot.categoryAxisRenderer.js - About 5 hrs to fix

    Function initBands has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.jqplot.LineRenderer.prototype.initBands = function(options, plot) {
            // use bandData if no data specified in bands option
            //var bd = this.renderer.bandData;
            var bd = options.bandData || [];
            var bands = this.renderer.bands;
    Severity: Major
    Found in app/assets/javascripts/jquery.jqplot.js - About 5 hrs to fix

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

          $.jqplot.TableLegendRenderer.prototype.pack = function(offsets) {
              if (this.show) {       
                  if (this.placement == 'insideGrid') {
                      switch (this.location) {
                          case 'nw':
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js - About 5 hrs to fix

        Function parseOptions has 139 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                this.parseOptions = function(options){
                    for (var i=0; i<this.preParseOptionsHooks.hooks.length; i++) {
                        this.preParseOptionsHooks.hooks[i].call(this, options);
                    }
                    for (var i=0; i<$.jqplot.preParseOptionsHooks.length; i++) {
        Severity: Major
        Found in app/assets/javascripts/jquery.jqplot.js - About 5 hrs to fix

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

          /*
           * jQuery Form Plugin
           * version: 2.28 (10-MAY-2009)
           * @requires jQuery v1.2.2 or later
           *
          Severity: Minor
          Found in app/assets/javascripts/jquery.form.js - About 5 hrs to fix

            Function fileUpload has 136 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function fileUpload() {
                    var form = $form[0];
            
                    if ($(':input[name=submit]', form).length) {
                        alert('Error: Form elements must not be named "submit".');
            Severity: Major
            Found in app/assets/javascripts/jquery.form.js - About 5 hrs to fix

              Function reInitialize has 125 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      this.reInitialize = function (data, opts) {
                          // Plot should be visible and have a height and width.
                          // If plot doesn't have height and width for some
                          // reason, set it by other means.  Plot must not have
                          // a display:none attribute, however.
              Severity: Major
              Found in app/assets/javascripts/jquery.jqplot.js - About 5 hrs to fix

                Function prep has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    publicMethod.prep = function (object) {
                        if (!open) {
                            return;
                        }
                        
                Severity: Major
                Found in app/assets/javascripts/jquery.colorbox.js - About 4 hrs to fix

                  Function activate has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      $.jqplot.ThemeEngine.prototype.activate = function(plot, name) {
                          // sometimes need to redraw whole plot.
                          var redrawPlot = false;
                          if (!name && this.activeTheme && this.activeTheme._name) {
                              name = this.activeTheme._name;
                  Severity: Major
                  Found in app/assets/javascripts/jquery.jqplot.js - About 4 hrs to fix

                    File report_sanitizer.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module ReportSanitizer #:nodoc:
                      class << self
                        def sanitize(raw)
                          case
                            when raw.include?('report_format')
                    Severity: Minor
                    Found in lib/puppet/report_sanitizer.rb - About 4 hrs to fix

                      Method get_new_conflicts has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def get_new_conflicts(old_conflicts, initial_resource, related_resources = [])
                          current_conflicts = get_current_conflicts(initial_resource, related_resources)
                          new_conflicts = {}
                          current_conflicts.keys.each do |entity_desc|
                            if !old_conflicts.keys.include?(entity_desc)
                      Severity: Minor
                      Found in app/helpers/conflict_analyzer.rb - About 4 hrs to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Method compile_all_class_parameters has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def compile_all_class_parameters
                          unless @all_compiled_class_parameters
                            @all_compiled_class_parameters = {}
                      
                            compiled_parameters = self.walk_parent_groups do |group,parents|
                      Severity: Minor
                      Found in lib/node_group_graph.rb - About 4 hrs to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

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

                      /**
                       * jqPlot
                       * Pure JavaScript plotting plugin using jQuery
                       *
                       * Version: 1.0.8
                      Severity: Minor
                      Found in app/assets/javascripts/jqplot.canvasTextRenderer.js - About 3 hrs to fix

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

                            $.jqplot.ThemeEngine.prototype.init = function() {
                                // get the Default theme from the current plot settings.
                                var th = new $.jqplot.Theme({_name:'Default'});
                                var n, i, nn;
                                
                        Severity: Major
                        Found in app/assets/javascripts/jquery.jqplot.js - About 3 hrs to fix

                          Function LinePattern has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              $.jqplot.LinePattern = function (ctx, pattern) {
                          
                                  var defaultLinePatterns = {
                                      dotted: [ dotlen, $.jqplot.config.dotGapLength ],
                                      dashed: [ $.jqplot.config.dashLength, $.jqplot.config.gapLength ],
                          Severity: Major
                          Found in app/assets/javascripts/jquery.jqplot.js - About 3 hrs to fix

                            Function setOptions has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                Legend.prototype.setOptions = function(options) {
                                    $.extend(true, this, options);
                                    
                                    // Try to emulate deprecated behaviour
                                    // if user has specified xoffset or yoffset, copy these to
                            Severity: Major
                            Found in app/assets/javascripts/jquery.jqplot.js - About 3 hrs to fix

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

                                  $.jqplot.LineRenderer.prototype.init = function(options, plot) {
                                      // Group: Properties
                                      //
                                      options = options || {};
                                      this._type='line';
                              Severity: Major
                              Found in app/assets/javascripts/jquery.jqplot.js - About 3 hrs to fix

                                Function load has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function load () {
                                        var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
                                        
                                        active = true;
                                        
                                Severity: Major
                                Found in app/assets/javascripts/jquery.colorbox.js - About 3 hrs to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
                                          (t == 'checkbox' || t == 'radio') && !el.checked ||
                                          (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
                                          tag == 'select' && el.selectedIndex == -1))
                                              return null;
                                  Severity: Critical
                                  Found in app/assets/javascripts/jquery.form.js - About 3 hrs to fix

                                    Class Report has 28 methods (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class Report < ActiveRecord::Base
                                      def self.per_page; SETTINGS.reports_per_page end # Pagination
                                      belongs_to :node, optional: true
                                    
                                      # See the after_destroy delete_resources method for more delete_all action
                                    Severity: Minor
                                    Found in app/models/report.rb - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language