Method capture_request_response_cycle_end_info
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def capture_request_response_cycle_end_info(capture_error: false)
return gather_stats unless gather_stats
# get system info
current_time = get_system_current_time
Method capture_request_response_cycle_start_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def capture_request_response_cycle_start_info
return gather_stats unless gather_stats
# get system info
current_time = get_system_current_time
- 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 get_system_memory_info_mb
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_system_memory_info_mb
key_name = redis_record.support_key(get_server_hostname, [get_server_hostname, "memory"].join("_"))
value = ActiveSupport::HashWithIndifferentAccess.new(redis_record.parsed_get key_name)
return_value = if value == {}
mem_info = (`free -ml`).split(" ") rescue []
- 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 move_data_from_redis_to_mongo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def move_data_from_redis_to_mongo(at_once=true)
if at_once
# multiple records will be inserted to mongodb at once
# this is to minimize the index creation time
values = []
- 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_request_response_cycle_end_info
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def capture_request_response_cycle_end_info(capture_error: false)
return gather_stats unless gather_stats
# get system info
current_time = get_system_current_time
- 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"