Showing 9 of 9 total issues
Method _handle_result
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _handle_result(result)
@result = result
retry_text = " (#{_retries_left_s})" if retry? && (result.error? || result.failure?)
logger.info "#{' ' * (redirects.count - 1)}#{result}#{retry_text}"
result! result
- 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 execute!
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def execute!
if retry?
@retries_left -= 1
retry! @result
_queue_task(uri, method, original_uri || uri, options)
- 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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(uri, method, original_uri, request, response, options)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(uri, method, original_uri, request, response, options)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(checker, task_klass, uri, methods, options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(uri, method, original_uri, error, options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(checker, uri, method, original_uri, options = {})
Method to_s
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_s
status_s = if success?
'OK'
elsif failure?
'FAIL'
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options = {})
LinkChecker::Config::ATTRIBUTES.each do |key|
send("#{key}=", options[key] || LinkChecker.config.send(key))
end
raise ArgumentError, "Missing methods." if methods&.none?
- 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"