fog/fog-azure-rm

View on GitHub

Showing 207 of 528 total issues

Method put_blob_block has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def put_blob_block(container_name, blob_name, block_id, data, options = {})
Severity: Minor
Found in lib/fog/azurerm/requests/storage/put_blob_block.rb - About 35 mins to fix

    Method define_vnet_object has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def define_vnet_object(location, address_prefixes, dns_servers, subnets, tags)
    Severity: Minor
    Found in lib/fog/azurerm/requests/network/create_or_update_virtual_network.rb - About 35 mins to fix

      Method detach_route_table_from_subnet has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

        Method get_storage_account_params has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def get_storage_account_params(sku_name, location, replication, encryption_enabled, tags)
        Severity: Minor
        Found in lib/fog/azurerm/requests/storage/create_storage_account.rb - About 35 mins to fix

          Method get_availability_set_properties has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def get_availability_set_properties(location, fault_domain_count, update_domain_count, use_managed_disk, tags)
          Severity: Minor
          Found in lib/fog/azurerm/requests/compute/create_availability_set.rb - About 35 mins to fix

            Method copy_vhd_to_storage_account has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def copy_vhd_to_storage_account(resource_group, storage_account_name, vhd_path, location, vm_name)
            Severity: Minor
            Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 35 mins to fix

              Method image_config_params has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def image_config_params(location, new_vhd_path, platform, resource_group, vm_name)
              Severity: Minor
              Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 35 mins to fix

                Method format_server_parameters has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def format_server_parameters(location, version, admin_login, admin_password, tags)
                Severity: Minor
                Found in lib/fog/azurerm/requests/sql/create_or_update_sql_server.rb - About 35 mins to fix

                  Method detach_network_security_group_from_subnet has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def detach_network_security_group_from_subnet(resource_group, subnet_name, virtual_network_name, address_prefix, route_table_id)

                    Method get_unmanaged_disk_object has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            def get_unmanaged_disk_object(disk_name, disk_size, lun, storage_account_name, access_key)
                    Severity: Minor
                    Found in lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb - About 35 mins to fix

                      Method initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def initialize(body)
                                  if body.respond_to?(:read)
                                    if body.respond_to?(:rewind)
                                      begin
                                        body.rewind
                      Severity: Minor
                      Found in lib/fog/azurerm/requests/storage/save_page_blob.rb - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def self.parse(frontend_ip_configuration)
                                hash = {}
                                hash['id'] = frontend_ip_configuration.id
                                hash['name'] = frontend_ip_configuration.name
                                hash['subnet_id'] = frontend_ip_configuration.subnet.id unless frontend_ip_configuration.subnet.nil?
                      Severity: Minor
                      Found in lib/fog/azurerm/models/network/frontend_ip_configuration.rb - About 35 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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                                def initialize(body)
                                  if body.respond_to?(:read)
                                    if body.respond_to?(:rewind)
                                      begin
                                        body.rewind
                      Severity: Minor
                      Found in lib/fog/azurerm/requests/storage/multipart_save_block_blob.rb - About 35 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_ip_configurations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def validate_ip_configurations(ip_configurations)
                                unless ip_configurations.is_a?(Array)
                                  raise(ArgumentError, ':ip_configurations must be an Array')
                                end
                                unless ip_configurations.any?
                      Severity: Minor
                      Found in lib/fog/azurerm/models/network/virtual_network_gateway.rb - About 35 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_network_interface_object has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def get_network_interface_object(name, location, subnet_id, public_ip_address_id, network_security_group_id, ip_config_name, private_ip_allocation_method, private_ip_address, load_balancer_backend_address_pools_ids, load_balancer_inbound_nat_rules_ids, tags, enable_accelerated_networking)
                                if public_ip_address_id
                                  public_ipaddress = Azure::ARM::Network::Models::PublicIPAddress.new
                                  public_ipaddress.id = public_ip_address_id
                                end
                      Severity: Minor
                      Found in lib/fog/azurerm/requests/network/create_or_update_network_interface.rb - About 35 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_blob has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def get_blob(container_name, blob_name, options = {}, &block)
                                if block_given?
                                  get_blob_with_block_given(container_name, blob_name, options, &block)
                                else
                                  options[:request_id] = SecureRandom.uuid
                      Severity: Minor
                      Found in lib/fog/azurerm/requests/storage/get_blob.rb - About 35 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 copy_vhd_to_storage_account has a Cognitive Complexity of 7 (exceeds 5 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 35 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 detach_data_disk_from_vm has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                              def detach_data_disk_from_vm(resource_group, vm_name, disk_name, async)
                                msg = "Detaching Data Disk #{disk_name} from Virtual Machine #{vm_name} in Resource Group #{resource_group}."
                                Fog::Logger.debug msg
                                vm = get_virtual_machine_instance(resource_group, vm_name)
                                vm.storage_profile.data_disks.each_with_index do |disk, index|
                      Severity: Minor
                      Found in lib/fog/azurerm/requests/compute/detach_data_disk_from_vm.rb - About 35 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(load_balancing_rule)
                                hash = {}
                                hash['id'] = load_balancing_rule.id
                                hash['name'] = load_balancing_rule.name
                                hash['frontend_ip_configuration_id'] = load_balancing_rule.frontend_ipconfiguration.id unless load_balancing_rule.frontend_ipconfiguration.nil?
                      Severity: Minor
                      Found in lib/fog/azurerm/models/network/load_balancing_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(vpn_client_config)
                                hash = {}
                                hash['address_pool'] = []
                                vpn_client_config.vpn_client_address_pool.each do |address_prefix|
                                  hash['address_pool'] << address_prefix
                      Severity: Minor
                      Found in lib/fog/azurerm/models/network/vpn_client_configuration.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