fog/fog-azure-rm

View on GitHub

Showing 207 of 528 total issues

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

        def define_request_routing_rules(request_routing_rules)
          request_routing_rule_arr = []

          request_routing_rules.each do |rule|
            request_routing_rule = Azure::ARM::Network::Models::ApplicationGatewayRequestRoutingRule.new

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 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

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

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?

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

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

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

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

Severity
Category
Status
Source
Language