Class Bootstrap
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class Bootstrap
DEFAULT_HEARTBEAT_INTERVAL = 10 # In secs
DEFAULT_METRICS_INTERVAL = 30
DROPLET_REAPER_INTERVAL_SECS = 60
CONTAINER_REAPER_INTERVAL_SECS = 600
File bootstrap.rb
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "set"
require "steno"
require "steno/config"
require "steno/core_ext"
Method handle_dea_stop
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def handle_dea_stop(message)
if message.data.size == 1 && message.data['droplet']
staging_stop_msg = Dea::Nats::Message.new(
message.nats,
'staging.stop',
- 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 handle_dea_update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def handle_dea_update(message)
app_id = message.data["droplet"].to_s
uris = message.data["uris"]
app_version = message.data["version"]
- 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 download_buildpacks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def download_buildpacks
return unless config['staging'] && config['staging']['enabled']
buildpacks_url = URI::join(config['cc_url'], '/internal/buildpacks')
http = EM::HttpRequest.new(buildpacks_url, :connect_timeout => 5).get
- 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 reap_orphaned_containers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reap_orphaned_containers
logger.debug("Reaping orphaned containers")
promise_handles = Dea::Promise.new do |p|
p.deliver warden_container_lister.list.handles
- 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"