fog/fog-azure-rm

View on GitHub

Showing 207 of 528 total issues

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

        def define_url_path_maps(url_path_maps)
          url_path_map_arr = []

          url_path_maps.each do |map|
            url_path_map = Azure::ARM::Network::Models::ApplicationGatewayUrlPathMap.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(request_routing_rule)
          hash = {}
          hash['id'] = request_routing_rule.id
          hash['name'] = request_routing_rule.name
          hash['type'] = request_routing_rule.rule_type
Severity: Minor
Found in lib/fog/azurerm/models/application_gateway/request_routing_rule.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_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_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

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

Severity
Category
Status
Source
Language