Method setSSHProvision
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def setSSHProvision
logger.info "SSH connection established to #{provision_host} - executing template"
if client.deploy!
# since we are in a after_commit callback, we need to fetch our host again, and clean up puppet ca on our own
Host.find(id).built
- 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 setSSHWaitForResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def setSSHWaitForResponse
logger.info "Starting SSH provisioning script - waiting for #{provision_host} to respond"
if compute_resource.respond_to?(:key_pair) && compute_resource.key_pair.try(:secret)
credentials = { :key_data => [compute_resource.key_pair.secret] }
elsif vm.respond_to?(:password) && vm.password.present?
- 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 validate_ssh_provisioning
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def validate_ssh_provisioning
return unless ssh_provision?
return if Rails.env.test?
status = true
begin
- 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"