Showing 46 of 50 total issues
Method auto_complete_firewall_rules
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def auto_complete_firewall_rules
@domain_config.firewall_rules.each do |firewall_rule|
firewall_rule[:ipaddressid] = @domain_config.pf_ip_address_id if firewall_rule[:ipaddressid].nil?
firewall_rule[:ipaddress] = @domain_config.pf_ip_address if firewall_rule[:ipaddress].nil?
firewall_rule[:cidrlist] = @domain_config.pf_trusted_networks.join(',') if firewall_rule[:cidrlist].nil?
- 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 retrieve_public_ip_port
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_public_ip_port(cloudstack, domain_config, machine)
pf_ip_address_id = domain_config.pf_ip_address_id
pf_ip_address = domain_config.pf_ip_address
pf_public_port = domain_config.send(@public_port_fieldname)
- 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 action_up
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.action_up
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectCloudstack
b.use Call, IsCreated do |env1, b1|
- 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 read_ssh_info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read_ssh_info(cloudstack, machine)
return nil if (server = find_server(cloudstack, machine)).nil?
# Get the Port forwarding config
domain = machine.provider_config.domain_id
- 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 action_destroy
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.action_destroy
Vagrant::Action::Builder.new.tap do |b|
b.use Call, DestroyConfirm do |env, b2|
if env[:result]
b2.use ConfigValidate
- 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 apply_firewall_rule
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_firewall_rule(acl_name, options, response_string, type_string)
firewall_rule = nil
begin
resp = @env[:cloudstack_compute].request(options)
job_id = resp[response_string]['jobid']
Method read_winrm_info
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_winrm_info(cloudstack, machine)
return nil if (server = find_server(cloudstack, machine)).nil?
# Get the Port forwarding config
domain = machine.provider_config.domain_id
Method finalize!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def finalize!
INSTANCE_VAR_DEFAULT_NIL.each do |instance_variable|
# ... must be nil, since we can't default that
instance_variable_set("@#{instance_variable}", nil) if
instance_variable_get("@#{instance_variable}") == UNSET_VALUE
Method retrieve_public_ip_port
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def retrieve_public_ip_port(cloudstack, domain_config, machine)
pf_ip_address_id = domain_config.pf_ip_address_id
pf_ip_address = domain_config.pf_ip_address
pf_public_port = domain_config.send(@public_port_fieldname)
Method create_firewall_rule
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_firewall_rule(rule)
acl_name = ''
firewall_rule = nil
@env[:ui].info(I18n.t('vagrant_cloudstack.creating_firewall_rule'))
Method enable_static_nat
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def enable_static_nat(rule)
@env[:ui].info(I18n.t('vagrant_cloudstack.enabling_static_nat'))
begin
ip_address = sync_ip_address(rule[:ipaddressid], rule[:ipaddress])
Method apply_port_forwarding_rule
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def apply_port_forwarding_rule(rule)
port_forwarding_rule = nil
@env[:ui].info(I18n.t('vagrant_cloudstack.creating_port_forwarding_rule'))
return unless (options = compose_port_forwarding_rule_creation_options(rule))
- 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 remove_security_groups
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def remove_security_groups(env)
security_groups_file = env[:machine].data_dir.join('security_groups')
if security_groups_file.file?
File.read(security_groups_file).each_line do |line|
security_group_id = line.strip
- 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 wait_for_job_ready
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def wait_for_job_ready(env, job_id, message=nil)
while true
response = env[:cloudstack_compute].query_async_job_result({:jobid => job_id})
if response['queryasyncjobresultresponse']['jobstatus'] != 0
break
- 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 action_reload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.action_reload
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use ConnectCloudstack
b.use Call, IsCreated do |env, b2|
- 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 sync_resource
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sync_resource(resource, api_parameters = {})
@resource_details = nil
if resource.id.nil? and !(resource.name.nil? || resource.name.empty? )
resource.id = name_to_id(resource.name, resource.kind, api_parameters)
elsif resource.id
- 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 show_creation_summary
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def show_creation_summary
# Launch!
@env[:ui].info(I18n.t('vagrant_cloudstack.launching_instance'))
@env[:ui].info(" -- Display Name: #{@domain_config.display_name}")
@env[:ui].info(" -- Group: #{@domain_config.group}") if @domain_config.group
- 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 call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
env[:result] = true
if env[:machine].state.id == @state
@logger.info(I18n.t("vagrant_cloudstack.already_status", :status => @state))
else
- 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 which
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def which(cmd)
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
exts.each { |ext|
exe = File.join(path, "#{cmd}#{ext}")
- 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 sanitize_domain_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sanitize_domain_config
# Accept a single entry as input, convert it to array
@domain_config.pf_trusted_networks = [@domain_config.pf_trusted_networks] if @domain_config.pf_trusted_networks
if @domain_config.network_id.nil?
- 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"