fog/fog-azure-rm

View on GitHub

Showing 528 of 528 total issues

Method validate_probes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def validate_probes(probes)
if probes.is_a?(Array)
if probes.any?
probes.each do |probe|
if probe.is_a?(Hash)
Severity: Minor
Found in lib/fog/azurerm/models/application_gateway/gateway.rb - About 1 hr to fix

Method validate_inbound_nat_rules has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def validate_inbound_nat_rules(inbound_nat_rules)
if inbound_nat_rules.is_a?(Array)
if inbound_nat_rules.any?
inbound_nat_rules.each do |inr|
if inr.is_a?(Hash)
Severity: Minor
Found in lib/fog/azurerm/models/network/load_balancer.rb - About 1 hr to fix

Method parse_storage_object has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def parse_storage_object(object)
data = {}
if object.is_a? Hash
object.each do |k, v|
if k == 'properties'
Severity: Minor
Found in lib/fog/azurerm/utilities/general.rb - About 1 hr to fix

Method parse has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def self.parse(circuit_peering)
express_route_circuit_peering = {}
express_route_circuit_peering['id'] = circuit_peering.id
express_route_circuit_peering['name'] = circuit_peering.name
express_route_circuit_peering['resource_group'] = get_resource_group_from_id(circuit_peering.id)
Severity: Minor
Found in lib/fog/azurerm/models/network/express_route_circuit_peering.rb - About 1 hr to fix

    Method get_express_route_circuit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def get_express_route_circuit(*)
    {
    'name' => 'circuit_name',
    'id' => '/subscriptions/########-####-####-####-############/resourceGroup/resource_group_name/providers/Microsoft.Network/expressRouteCircuits/circuit_name',
    'etag' => 'W/\"00000000-0000-0000-0000-000000000000\"',
    Severity: Minor
    Found in lib/fog/azurerm/requests/network/get_express_route_circuit.rb - About 1 hr to fix

      Method get_blob_properties has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def get_blob_properties(*)
      blob = Azure::Storage::Blob::Blob.new
      blob.name = 'test_blob'
      blob.metadata = {}
      blob.properties = {
      Severity: Minor
      Found in lib/fog/azurerm/requests/storage/get_blob_properties.rb - About 1 hr to fix

        Method parse_storage_object has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def parse_storage_object(object)
        data = {}
        if object.is_a? Hash
        object.each do |k, v|
        if k == 'properties'
        Severity: Minor
        Found in lib/fog/azurerm/utilities/general.rb - About 1 hr to fix

          Method copy_vhd_to_storage_account has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def copy_vhd_to_storage_account(resource_group, storage_account_name, vhd_path, location, vm_name)
          # Copy if VHD does not exist belongs to same storage account.
          vhd_storage_account_name = (vhd_path.split('/')[2]).split('.')[0]
          if storage_account_name != vhd_storage_account_name
          if storage_account_name.nil?
          Severity: Minor
          Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 1 hr to fix

            Method get_network_gateway_object has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def get_network_gateway_object(virtual_network_params)
            network_gateway = Azure::ARM::Network::Models::VirtualNetworkGateway.new
             
            network_gateway.enable_bgp = virtual_network_params[:enable_bgp]
            network_gateway.gateway_type = virtual_network_params[:gateway_type]

              Method get_network_gateway_connection_object has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def get_network_gateway_connection_object(gateway_connection_params)
              gateway_connection = Azure::ARM::Network::Models::VirtualNetworkGatewayConnection.new
               
              gateway_connection.name = gateway_connection_params[:name]
              gateway_connection.location = gateway_connection_params[:location]

                Method create_or_update_network_interface has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def create_or_update_network_interface(resource_group_name, name, location, subnet_id, public_ip_address_id, ip_configs_name, private_ip_allocation_method, private_ip_address)

                  Method get_profile_object has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def get_profile_object(traffic_routing_method, relative_name, ttl, protocol, port, path, endpoints, tags)

                    Method save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def save(options = {})
                    update_body = options.delete(:update_body)
                    update_body = true if update_body.nil?
                    requires :directory, :key
                    raise ArgumentError.new('body is required when update_body is true') if update_body && attributes[:body].nil?
                    Severity: Minor
                    Found in lib/fog/azurerm/models/storage/file.rb - About 55 mins to fix

                    Method define_load_balancing_rule has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def define_load_balancing_rule(load_balancing_rules)
                    load_balancing_rule_arr = []
                    load_balancing_rules.each do |lbr|
                    load_balancing_rule = Azure::ARM::Network::Models::LoadBalancingRule.new
                     
                    Severity: Minor
                    Found in lib/fog/azurerm/requests/network/create_load_balancer.rb - About 55 mins to fix

                    Method list_tagged_resources has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def list_tagged_resources(tag_name, tag_value = nil)
                    msg = "Listing Resources with tagname: #{tag_name}"
                    Fog::Logger.debug msg
                    unless tag_name.nil?
                    query_filter = "tagname eq '#{tag_name}' "
                    Severity: Minor
                    Found in lib/fog/azurerm/requests/resources/list_tagged_resources.rb - About 55 mins to fix

                    Block has too many lines. [32/25]
                    Open

                    Gem::Specification.new do |spec|
                    spec.name = 'fog-azure-rm'
                    spec.version = Fog::AzureRM::VERSION
                    spec.authors = ['Shaffan Chaudhry', 'Samawia Moin', 'Adnan Khalil', 'Zeeshan Arshad', 'Haider Ali', 'Waqar Haider', 'Bilal Naeem', 'Muhammad Asad', 'Azeem Sajid', 'Maham Nazir', 'Abbas Sheikh']
                    spec.summary = "Module for the 'fog' gem to support Azure Resource Manager cloud services."
                    Severity: Minor
                    Found in fog-azure-rm.gemspec by rubocop

                    Method create_or_update_public_ip has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def create_or_update_public_ip(resource_group, name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label, tags)
                    Severity: Major
                    Found in lib/fog/azurerm/requests/network/create_or_update_public_ip.rb - About 50 mins to fix

                      Method create_or_update_virtual_network has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def create_or_update_virtual_network(resource_group_name, virtual_network_name, location, dns_servers, subnets, address_prefixes, tags)
                      Severity: Major
                      Found in lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb - About 50 mins to fix

                        Method attach_route_table_to_subnet has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def attach_route_table_to_subnet(resource_group, subnet_name, virtual_network_name, address_prefix, network_security_group_id, route_table_id)
                        Severity: Minor
                        Found in lib/fog/azurerm/requests/network/attach_route_table_to_subnet.rb - About 45 mins to fix

                          Method get_public_ip_object has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def get_public_ip_object(name, location, public_ip_allocation_method, idle_timeout_in_minutes, domain_name_label, tags)
                          Severity: Minor
                          Found in lib/fog/azurerm/requests/network/create_or_update_public_ip.rb - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language