sodabrew/puppet-dashboard

View on GitHub

Showing 290 of 682 total issues

Avoid too many return statements within this function.
Open

                                           return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
Severity: Major
Found in app/assets/javascripts/jquery.jqplot.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return '';
    Severity: Major
    Found in app/assets/javascripts/jquery.jqplot.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                            return justified;
      Severity: Major
      Found in app/assets/javascripts/jquery.jqplot.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                                        return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
        Severity: Major
        Found in app/assets/javascripts/jquery.jqplot.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                          return {seriesIndex:s.index, pointIndex:j, gridData:null, data:s.data[j]};
          Severity: Major
          Found in app/assets/javascripts/jquery.jqplot.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                                            return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
            Severity: Major
            Found in app/assets/javascripts/jquery.jqplot.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                                          return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
              Severity: Major
              Found in app/assets/javascripts/jquery.jqplot.js - About 30 mins to fix

                Function toggle_expandable_link has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function toggle_expandable_link() {
                  expansionTime = 30; // ms
                  jQuery(this).toggleClass('collapsed-link');
                  jQuery(this.id.replace('expand', '#expandable'))
                    .toggle('blind', {}, expansionTime);
                Severity: Minor
                Found in app/assets/javascripts/dashboard.js - About 25 mins 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 disallow_uninstalled_plugins has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def disallow_uninstalled_plugins
                    caller.each do |call_source|
                      if call_source =~ %r{/vendor/plugins/([^/]+)/}
                        plugin_name = $1
                        return unless installed_plugins.include? plugin_name
                Severity: Minor
                Found in lib/registry.rb - About 25 mins 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 read has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.read
                    normal_file = "config/settings.yml"
                    sample_file = "config/settings.yml.example"
                    rails_root = Rails.root rescue File.dirname(File.dirname(__FILE__))
                
                
                Severity: Minor
                Found in lib/settings_reader.rb - About 25 mins 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

                Severity
                Category
                Status
                Source
                Language