Showing 79 of 89 total issues
Method shutdown!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def shutdown!(goodbye_message)
return if shutting_down?
@shutting_down = true
remove_droplets
- 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 promise_start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def promise_start
Promise.new do |p|
env = Env.new(StartMessage.new(@raw_attributes), self)
if staged_info
- 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 initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(message_bus, locator_responders, instance_registry, staging_registry, droplet_registry, directory_server, logger)
Method initialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(bootstrap, message_bus, locator_responders, instance_registry, staging_task_registry, logger, config)
Method StreamHandler.ServeHTTP
has 8 return statements (exceeds 4 allowed). Open
func (handler *StreamHandler) ServeHTTP(writer http.ResponseWriter, r *http.Request) {
var err error
watcher, err := fsnotify.NewWatcher()
if err != nil {
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(destination, key_file, cert_file, ca_file, timeout, custom_logger=nil)
Method clone
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.clone(repository, destination)
git_url, branch = parse(repository)
target_dir = File.join(destination, File.basename(git_url.path, File.extname(git_url.path)))
git_branch_option = branch.to_s.empty? ? "" : "-b #{branch}"
- 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 promise_health_check
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def promise_health_check
Promise.new do |p|
begin
logger.debug('droplet.health-check.get-container-info')
container.update_path_and_ip
- 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 clean_uri
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.clean_uri(u)
uri = u.is_a?(URI) ? u.dup : URI.parse(u)
uri.password = nil if uri.password
uri.user = nil if uri.user
uri.to_s
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle(request)
message = StagingMessage.new(request.data)
message.set_responder do |params, &blk|
request.respond(params) { blk.call if blk }
end
- 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start(&callback)
p = Promise.new do
logger.info('droplet.starting')
promise_state(State::BORN, State::STARTING).resolve
- 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 link
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def link(&callback)
Promise.resolve(promise_link) do |error, link_response|
if error
logger.warn('droplet.warden.link.failed', error: error, backtrace: error.backtrace)
- 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 notify_completion
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def notify_completion(staging_message, task)
task.after_complete_callback do |error|
data = {
task_id: task.task_id,
detected_buildpack: task.detected_buildpack,
- 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
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handle(request)
message = StagingMessage.new(request)
message.set_responder do |params, &blk|
@cc_client.send_staging_response(params) { blk.call if blk }
end
- 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 transition_instances_to_evacuating
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def transition_instances_to_evacuating(first_time)
@instance_registry.each do |instance|
if instance.born? || instance.starting? || instance.resuming? || instance.running?
@logger.error("Found an unexpected #{instance.state} instance while evacuating") unless first_time
instance.state = Dea::Instance::State::EVACUATING
- 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_stopping
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reap_stopping
logger.debug2("Reaping stopping")
stopping_by_app = Hash.new { |h, k| h[k] = [] }
select(&:stopping?).each { |i| stopping_by_app[i.application_id] << i }
- 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 initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(bootstrap, dir_server, staging_message, buildpacks_in_use, custom_logger=nil)
Method emit_container_metric
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.emit_container_metric(app_id, instanceIndex, cpuPercentage, memoryBytes, diskBytes)