Method log_request_to_cloud_watch
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def log_request_to_cloud_watch(validation_response, request)
logger.debug 'Logging request to CloudWatch'
log_query = request.query_parameters.except(:loggedUser)
Method validate_request
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate_request(request)
logger.debug 'Validating request'
if request.headers['Authorization'].nil?
logger.debug 'No authorization header found'
Method validate_request
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_request(request)
logger.debug 'Validating request'
if request.headers['Authorization'].nil?
logger.debug 'No authorization header found'
- 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 validate_user_and_application
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate_user_and_application
validation_response = validate_request(request)
logger.debug 'validation response: ' + validation_response.to_json
return false unless validation_response
- 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 log_request_to_cloud_watch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def log_request_to_cloud_watch(validation_response, request)
logger.debug 'Logging request to CloudWatch'
log_query = request.query_parameters.except(:loggedUser)
- 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"