Showing 3 of 21 total issues
Method symbolize_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def symbolize_names(object)
case object
when Hash
{}.tap do |new_hash|
object.each do |key, value|
- Read upRead up
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 to_s
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_s
out_message = message
out_message += "\n(Status: #{http_status})" unless http_status.nil?
out_message += "\nRaw request body: #{http_body}" unless http_body.nil?
out_message += "\nResponse Headers: #{http_headers}\n" unless http_headers.nil?
- Read upRead up
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 capture_response!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def capture_response!(retry_count = TheCaptain.retry_attempts)
@response = yield
rescue StandardError
retry_count ||= 0
(retry_count -= 1).positive? ? retry : raise
- Read upRead up
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"