fog/fog-azure-rm

View on GitHub

Showing 528 of 528 total issues

Method define_http_listeners has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def define_http_listeners(http_listeners)
http_listener_arr = []
 
http_listeners.each do |listener|
http_listener = Azure::ARM::Network::Models::ApplicationGatewayHttpListener.new

Method define_subnet_objects has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def define_subnet_objects(subnets)
subnet_objects = []
subnets.each do |subnet|
network_security_group = Azure::ARM::Network::Models::NetworkSecurityGroup.new
network_security_group.id = subnet[:network_security_group_id]
Severity: Minor
Found in lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb - About 25 mins to fix

Method parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def self.parse(recordset)
hash = get_hash_from_object(recordset)
hash['resource_group'] = get_resource_group_from_id(recordset.id)
hash['zone_name'] = get_record_set_from_id(recordset.id)
type = get_type_from_recordset_type(recordset.type)
Severity: Minor
Found in lib/fog/azurerm/models/dns/record_set.rb - About 25 mins to fix

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?

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]
Severity: Minor
Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 25 mins to fix

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)
Severity: Minor
Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 25 mins to fix

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
Severity: Minor
Found in lib/fog/azurerm/requests/resources/delete_resource_tag.rb - About 25 mins to fix

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]
Severity: Minor
Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 25 mins to fix

%w-literals should be delimited by [ and ].
Open

identity :key, aliases: %w(Name name)

%w-literals should be delimited by [ and ].
Open

identity :key, aliases: %w(Name name Key)

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

if frontend_port.is_a?(Hash)

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

if missing.length == 1

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

if http_listeners.is_a?(Array)

%w-literals should be delimited by [ and ].
Open

attribute :blob_type, aliases: %w(Blob-Type BlobType)

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

if backend_address_pool.is_a?(Hash)

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

if missing.length == 1

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

if url_path_maps.is_a?(Array)

Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency azure_mgmt_key_vault should appear before azure_mgmt_sql.
Open

spec.add_dependency 'azure_mgmt_key_vault', '~> 0.9.0'
Severity: Minor
Found in fog-azure-rm.gemspec by rubocop

Dependencies should be sorted in an alphabetical order within their section of the gemspec. Dependency mime-types should appear before vhd.
Open

spec.add_dependency 'mime-types', '~> 3.0'
Severity: Minor
Found in fog-azure-rm.gemspec by rubocop

%w-literals should be delimited by [ and ].
Open

attribute :lease_status, aliases: %w(Lease-Status LeaseStatus)
Severity
Category
Status
Source
Language