Method verify_one_responder
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def verify_one_responder(uri)
original_uri = uri
redirect_count = 0
http_response = nil
loop do
- 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 verify_one_responder
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def verify_one_responder(uri)
original_uri = uri
redirect_count = 0
http_response = nil
loop do
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(host_name, cert, ca_cert, cert_store, **opts)
Method return_ocsp_response
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def return_ocsp_response(resp, errors = nil)
if resp
if resp.cert_status == OpenSSL::OCSP::V_CERTSTATUS_REVOKED
raise_revoked_error(resp)
end
- 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
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return false
Method verify_with_cache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def verify_with_cache
handle_exceptions do
return false if ocsp_uris.empty?
resp = OcspCache.get(cert_id)
- 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"