Showing 6 of 66 total issues
Method perf_collect_metrics
has a Cognitive Complexity of 44 (exceeds 11 allowed). Consider refactoring. Open
def perf_collect_metrics(interval_name, start_time = nil, end_time = nil)
counters_by_mor = {}
counter_values_by_mor = {}
raise 'No EMS defined' unless ems
- 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 stacks_advanced_caching
has a Cognitive Complexity of 23 (exceeds 11 allowed). Consider refactoring. Open
def stacks_advanced_caching(stacks, refs = nil)
if enabled_deployments_caching
db_stacks_timestamps = {}
db_stacks_primary_keys = {}
db_stacks_primary_keys_to_ems_ref = {}
- 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 infer_related_stacks_ems_refs_api!
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def infer_related_stacks_ems_refs_api!
# Get resource groups out of Stack references, we need them to fetch stacks
references(:orchestration_stacks).each do |stack_ems_ref|
resource_group_ems_ref = stack_ems_ref.split("/")[0..4].join("/")
add_target!(:resource_groups, resource_group_ems_ref.downcase)
- 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 call_snapshot_delete
has a Cognitive Complexity of 17 (exceeds 11 allowed). Consider refactoring. Open
def call_snapshot_delete
_log.info("Enter")
# TODO: remove snapshot here if Vm was running
if context[:snapshot_mor]
- 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 hardware_networks
has a Cognitive Complexity of 13 (exceeds 11 allowed). Consider refactoring. Open
def hardware_networks(persister_hardware, instance)
collector.instance_network_ports(instance).each do |nic_profile|
nic_profile.properties.ip_configurations.each do |ipconfig|
hostname = ipconfig.name
private_ip_addr = ipconfig.properties.try(:private_ip_address)
- 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 add_instance_disk
has a Cognitive Complexity of 12 (exceeds 11 allowed). Consider refactoring. Open
def add_instance_disk(persister_hardware, instance, disk)
if instance.managed_disk?
disk_type = 'managed'
disk_location = disk.managed_disk.id
managed_disk = collector.instance_managed_disk(disk_location)
- 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"