Showing 207 of 528 total issues
Method define_vnet_object
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def define_vnet_object(location, address_prefixes, dns_servers, subnets, tags)
virtual_network = Azure::ARM::Network::Models::VirtualNetwork.new
virtual_network.location = location
virtual_network.tags = tags
- 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_sku_name!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_sku_name!
case sku_name
when STANDARD_STORAGE
raise 'Standard Replications can only be LRS, ZRS, GRS or RAGRS.' unless ALLOWED_STANDARD_REPLICATION.include?(replication)
when PREMIUM_STORAGE
- 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 get_os_disk_parameters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_os_disk_parameters(resource_group, virtual_machine_name)
os_disk_parameters = {}
begin
vm = get_virtual_machine(resource_group, virtual_machine_name, false)
- 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 get_os_profile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_os_profile(vm_config)
# Arguments unpacking
platform = vm_config[:platform]
vm_name = vm_config[:name]
username = vm_config[:username]
- 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 get_security_rule_objects
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_security_rule_objects(security_rules)
rules = []
security_rules.each do |sr|
security_rule = Azure::ARM::Network::Models::SecurityRule.new
security_rule.description = sr[:description] unless sr[:description].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 delete_resource_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def delete_resource_tag(resource_id, tag_name, tag_value, api_version = API_VERSION)
split_resource = resource_id.split('/') unless resource_id.nil?
if split_resource.count != 9
raise 'Invalid Resource Id'
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 get_unmanaged_vm_storage_profile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_unmanaged_vm_storage_profile(vm_config)
# Arguments unpacking
vm_name = vm_config[:name]
storage_account_name = vm_config[:storage_account_name]
publisher = vm_config[:publisher]
- 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"