fog/fog-azure-rm

View on GitHub

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

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 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(path_rule)
          paths = path_rule['paths']

          hash = {}
          hash['paths'] = []
Severity: Minor
Found in lib/fog/azurerm/models/network/path_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 validate_subnets! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def validate_subnets!(subnets)
          raise ':subnets must be an Array' unless subnets.is_a?(Array)
          raise ':subnets must not be an empty Array' if subnets.empty?

          subnets.each do |subnet|
Severity: Minor
Found in lib/fog/azurerm/models/network/virtual_network.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def self.parse(http_listener)
          hash = {}
          hash['id'] = http_listener.id
          hash['name'] = http_listener.name
          hash['frontend_ip_config_id'] = http_listener.frontend_ipconfiguration.id unless http_listener.frontend_ipconfiguration.nil?
Severity: Minor
Found in lib/fog/azurerm/models/application_gateway/http_listener.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_public_ip_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_public_ip_object(name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label, tags)
          public_ip = Azure::ARM::Network::Models::PublicIPAddress.new
          public_ip.name = name
          public_ip.location = location
          public_ip.public_ipallocation_method = public_ip_allocation_method unless public_ip_allocation_method.nil?
Severity: Minor
Found in lib/fog/azurerm/requests/network/create_or_update_public_ip.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 define_lb_frontend_ip_configurations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def define_lb_frontend_ip_configurations(frontend_ip_configurations)
          frontend_ip_configuration_arr = []
          frontend_ip_configurations.each do |fic|
            frontend_ip_configuration = Azure::ARM::Network::Models::FrontendIPConfiguration.new
            frontend_ip_configuration.private_ipaddress = fic[:private_ipaddress]
Severity: Minor
Found in lib/fog/azurerm/requests/network/create_load_balancer.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 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

Severity: Minor
Found in lib/fog/azurerm/requests/network/create_or_update_virtual_network.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_ip_configurations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def get_ip_configurations(ip_configurations)
          ip_configs = []
          ip_configurations.each do |ip_config|
            ip_configuration = Azure::ARM::Network::Models::VirtualNetworkGatewayIPConfiguration.new
            ip_configuration.private_ipallocation_method = ip_config[:private_ipallocation_method]

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(subnet)
          subnet_hash = {}
          subnet_hash['id'] = subnet.id
          subnet_hash['name'] = subnet.name
          subnet_hash['resource_group'] = get_resource_group_from_id(subnet.id)
Severity: Minor
Found in lib/fog/azurerm/models/network/subnet.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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def self.parse(nsg)
          hash = {}
          hash['id'] = nsg.id
          hash['name'] = nsg.name
          hash['resource_group'] = get_resource_from_resource_id(nsg.id, RESOURCE_GROUP_NAME)
Severity: Minor
Found in lib/fog/azurerm/models/network/network_security_group.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 check_storage_account_exists has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def check_storage_account_exists(resource_group_name, storage_account_name)
          msg = "Checking Storage Account: #{storage_account_name}."
          Fog::Logger.debug msg
          begin
            storage_account = @storage_mgmt_client.storage_accounts.get_properties(resource_group_name, storage_account_name)
Severity: Minor
Found in lib/fog/azurerm/requests/storage/check_storage_account_exists.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 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

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(url_path_map)
          hash = {}
          hash['id'] = url_path_map.id
          hash['name'] = url_path_map.name
          hash['default_backend_address_pool_id'] = url_path_map.default_backend_address_pool.id unless url_path_map.default_backend_address_pool.nil?
Severity: Minor
Found in lib/fog/azurerm/models/application_gateway/url_path_map.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 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 parse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def self.parse(circuit)
          express_route_circuit = {}
          express_route_circuit['id'] = circuit.id
          express_route_circuit['name'] = circuit.name
          express_route_circuit['location'] = circuit.location
Severity: Minor
Found in lib/fog/azurerm/models/network/express_route_circuit.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 define_load_balancer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def define_load_balancer(name, location, frontend_ip_configurations, backend_address_pool_names, load_balancing_rules, probes, inbound_nat_rules, inbound_nat_pools, tags)
          load_balancer = Azure::ARM::Network::Models::LoadBalancer.new
          load_balancer.name = name
          load_balancer.location = location
          load_balancer.tags = tags
Severity: Minor
Found in lib/fog/azurerm/requests/network/create_load_balancer.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 validate_security_rules has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def validate_security_rules(security_rules)
          if security_rules.is_a?(Array)
            security_rules.each do |sr|
              if sr.is_a?(Hash)
                validate_security_rule_params(sr)
Severity: Minor
Found in lib/fog/azurerm/models/network/network_security_group.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 save_blob has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def save_blob(options)
          if options[:blob_type].nil? || options[:blob_type] == 'BlockBlob'
            if Fog::Storage.get_body_size(body) <= SINGLE_BLOB_PUT_THRESHOLD
              service.create_block_blob(directory.key, key, body, options)
            else
Severity: Minor
Found in lib/fog/azurerm/models/storage/file.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 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
Severity: Minor
Found in lib/fog/azurerm/models/storage/storage_account.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