|
|
|
2 CUSTOM_ITEMS = %w(hostname url client_ip localtime utctime)
|
|
3 BOOLEAN_ITEMS = %w(database_connection database_persistence database_integrity)
|
|
|
|
5 TEST_SETTINGS_KEY = 'healthcheck_test_key'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- DuplicateMethodCall - calls 'self.send(symptom)' 2 times » reek
- TooManyStatements - has approx 6 statements » reek
- Complexity 3 » saikuro
|
|
|
|
|
17 CUSTOM_ITEMS.each do |symptom|
|
|
18 diagnosis[symptom] = self.send(symptom)
|
|
|
|
20 BOOLEAN_ITEMS.each do |symptom|
|
|
21 diagnosis[symptom] = stringify(self.send(symptom))
|
|
|
|
|
|
|
|
|
|
|
|
|
- UtilityFunction - doesn't depend on instance state (maybe move it to another class?) » reek
- Complexity 1 » saikuro
|
|
|
|
|
|
|
|
|
|
|
33 @env.fetch('REQUEST_URI', 'FAILED: no REQUEST_URI present in env')
|
|
|
|
|
|
|
|
37 @env.fetch('REMOTE_ADDR', 'FAILED: no REMOTE_ADDR present in env')
|
|
|
|
|
- UtilityFunction - doesn't depend on instance state (maybe move it to another class?) » reek
- Complexity 1 » saikuro
|
|
|
|
|
|
|
|
- UtilityFunction - doesn't depend on instance state (maybe move it to another class?) » reek
- Complexity 1 » saikuro
|
|
|
45 Time.current.getutc.rfc2822
|
|
|
|
|
- ControlParameter - is controlled by argument 'b' » reek
- UncommunicativeParameterName - has the parameter name 'b' » reek
- Complexity 2 » saikuro
|
|
|
|
|
|
|
|
- UtilityFunction - doesn't depend on instance state (maybe move it to another class?) » reek
- Complexity 2 » saikuro
|
52 def database_connection
|
|
53 ActiveRecord::Base.establish_connection
|
|
54 ActiveRecord::Base.connection
|
|
|
|
|
|
|
|
|
|
|
|
60 def database_persistence
|
|
61 return false unless database_connection
|
|
62 return false unless Site.first_or_create
|
|
63 return false unless Site.last_checked_at!
|
|
|
|
|
|
|
|
|
|
|
|
69 def database_integrity
|
|
70 return false unless database_connection
|
|
71 !ActiveRecord::Migrator.needs_migration?
|
|
|
|
|