Showing 34 of 127 total issues
Method vim_connect
has a Cognitive Complexity of 15 (exceeds 11 allowed). Consider refactoring. Open
def vim_connect(options = {})
raise _("no console credentials defined") if options[:auth_type] == :console && !authentication_type(options[:auth_type])
raise _("no credentials defined") if missing_credentials?(options[:auth_type])
options[:ip] ||= hostname
- Read upRead up
- Create a ticketCreate a ticket
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 vms_and_templates_reconnect_block
has a Cognitive Complexity of 15 (exceeds 11 allowed). Consider refactoring. Open
def vms_and_templates_reconnect_block
lambda do |inventory_collection, inventory_objects_index, attributes_index|
relation = inventory_collection.model_class.where(:ems_id => nil)
return if relation.count <= 0
- Read upRead up
- Create a ticketCreate a ticket
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 customization_nicSettingMap
has a Cognitive Complexity of 15 (exceeds 11 allowed). Consider refactoring. Open
def customization_nicSettingMap(source_platform, spec)
nic_settings = collect_nic_settings
spec.nicSettingMap ||= VimArray.new("ArrayOfCustomizationAdapterMapping")
- Read upRead up
- Create a ticketCreate a ticket
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 parse_host_system_lans
has a Cognitive Complexity of 14 (exceeds 11 allowed). Consider refactoring. Open
def parse_host_system_lans(object, host, switches, props)
network = props.fetch_path(:config, :network)
return if network.blank?
switch_uids = switches.index_by(&:name)
- Read upRead up
- Create a ticketCreate a ticket
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 parse_virtual_machine_networks
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def parse_virtual_machine_networks(_vm, props, hardware, guest_devices)
summary_guest = props.fetch_path(:summary, :guest)
return if summary_guest.nil?
hostname = summary_guest[:hostName]
- Read upRead up
- Create a ticketCreate a ticket
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 vapp_networks
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def vapp_networks
return @vapp_networks if @vapp_networks.any?
@vapp_networks = vapps.each_with_object([]) do |vapp, res|
fetch_network_configurations_for_vapp(vapp.id).map do |net_conf|
- Read upRead up
- Create a ticketCreate a ticket
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 get_network_device
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def get_network_device(vimVm, _vmcs, _vim = nil, vlan = nil)
svm = source
nic = svm.hardware.nil? ? nil : svm.hardware.nics.first
unless nic.nil?
# if passed a vlan, validate that the target host supports it.
- Read upRead up
- Create a ticketCreate a ticket
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 build_config_spec_advanced_lan
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def build_config_spec_advanced_lan(network, vnicDev, vmcs)
# A DistributedVirtualPortgroup name is unique in a datacenter so look for a Lan with this name
# on all switches in the cluster
hosts = dest_cluster.try(:hosts) || dest_host
lan = Lan.find_by(:name => network[:network], :switch_id => HostSwitch.where(:host_id => hosts).pluck(:switch_id))
- Read upRead up
- Create a ticketCreate a ticket
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 get_array_entry
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def get_array_entry(array, key)
return nil, nil unless array.kind_of?(Array)
array.each_index do |n|
array_entry = array[n]
- Read upRead up
- Create a ticketCreate a ticket
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 parse_host_system_host_networks
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def parse_host_system_host_networks(_host, hardware, props)
network = props.fetch_path(:config, :network)
return if network.nil?
vnics = Array(network[:consoleVnic]) + Array(network[:vnic])
- Read upRead up
- Create a ticketCreate a ticket
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 convert_vlan_options_to_network_hash
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
private def convert_vlan_options_to_network_hash
vlan = get_option(:vlan)
_log.info("vlan: #{vlan.inspect}")
return unless vlan
- Read upRead up
- Create a ticketCreate a ticket
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 counter_info_by_counter_id
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def self.counter_info_by_counter_id(ems, vim_hist)
phr = perf_history_results
results = phr.fetch_path(:counter_info_by_id, ems.id)
return results unless results.nil?
- Read upRead up
- Create a ticketCreate a ticket
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 process_prop_change
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def process_prop_change(prop_hash, prop_change)
h, prop_str = hash_target(prop_hash, prop_change.name)
tag, key = tag_and_key(prop_str)
case prop_change.op
- Read upRead up
- Create a ticketCreate a ticket
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 build_customization_spec
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def build_customization_spec
sysprep_option = get_option(:sysprep_enabled)
if sysprep_option.blank? || sysprep_option == 'disabled'
_log.warn "VM Customization will be skipped. Sysprep customization option set to [#{sysprep_option}]"
return nil
- Read upRead up
- Create a ticketCreate a ticket
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"