Method process_checks
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
def self.process_checks(checks, called_from_middleware = false)
errors = ''
checks.each do |check|
case check
when 'and', 'site'
- 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 process_checks
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.process_checks(checks, called_from_middleware = false)
errors = ''
checks.each do |check|
case check
when 'and', 'site'
Method check_cache
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.check_cache
t = Time.now.to_i
value = "ok #{t}"
ret = ::Rails.cache.read('__health_check_cache_test__')
if ret.to_s =~ /^ok (\d+)$/
- 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 check_smtp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.check_smtp(settings, timeout)
status = ''
begin
if @skip_external_checks
status = '250'
- 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"