kkirsche/arbor_peakflow_ruby

View on GitHub

Showing 3 of 3 total issues

Method traffic has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def traffic(query, graph = nil)
        query = remove_returns_and_spaces(query) unless query.nil?
        graph = remove_returns_and_spaces(graph) unless graph.nil?

        response = @client.get('arborws/traffic',
Severity: Minor
Found in lib/arbor_peakflow_ruby/actions/traffic.rb - About 1 hr 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 url_filter_limit_format_request has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

      def url_filter_limit_format_request(url, filter, limit, format)
        response = @client.get(url,
                               {}.tap do |hash|
                                 hash[:api_key] = @api_key
                                 hash[:format] = format unless format.nil?
Severity: Minor
Found in lib/arbor_peakflow_ruby/client.rb - About 1 hr 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 url_action_filter_request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def url_action_filter_request(url, action, filter)
        response = @client.get(url,
                               {}.tap do |hash|
                                 hash[:api_key] = @api_key
                                 hash[:action] = action unless action.nil?
Severity: Minor
Found in lib/arbor_peakflow_ruby/client.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