fog/fog-azure-rm

View on GitHub

Showing 207 of 528 total issues

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

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

              def create_express_route_circuit_peering(peering_type, peer_asn, primary_peer_address_prefix, secondary_peer_address_prefix, vlan_id, name)

        Method parse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def self.parse(gateway_ip_configuration)
                  hash = {}
                  if gateway_ip_configuration.is_a? Hash
                    hash['id'] = gateway_ip_configuration['id']
                    hash['name'] = gateway_ip_configuration['name']
        Severity: Minor
        Found in lib/fog/azurerm/models/application_gateway/ip_configuration.rb - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def self.parse(vault)
                  vault_hash = get_hash_from_object(vault)
                  vault_properties = vault.properties
        
                  unless vault_properties.nil?
        Severity: Minor
        Found in lib/fog/azurerm/models/key_vault/vault.rb - About 45 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_frontend_ip_configuration_params has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def validate_frontend_ip_configuration_params(frontend_ip_configuration)
                  required_params = [
                    :name,
                    :private_ipallocation_method
                  ]
        Severity: Minor
        Found in lib/fog/azurerm/models/network/load_balancer.rb - About 45 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 create_disk has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def create_disk(disk_name, disk_size_in_gb, options = {})
                  msg = "Creating disk(#{disk_name}, #{disk_size_in_gb}). options: #{options}"
                  Fog::Logger.debug msg
        
                  raise ArgumentError, "disk_size_in_gb #{disk_size_in_gb} must be an integer" unless disk_size_in_gb.is_a?(Integer)
        Severity: Minor
        Found in lib/fog/azurerm/requests/storage/create_disk.rb - About 45 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 8 (exceeds 5 allowed). Consider refactoring.
        Open

                def self.parse(network_gateway)
                  hash = {}
                  hash['id'] = network_gateway.id
                  hash['name'] = network_gateway.name
                  hash['location'] = network_gateway.location
        Severity: Minor
        Found in lib/fog/azurerm/models/network/virtual_network_gateway.rb - About 45 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 attach_network_security_group_to_subnet has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def attach_network_security_group_to_subnet(resource_group, subnet_name, virtual_network_name, address_prefix, route_table_id, network_security_group_id)

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

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

            Method check_vm_exists has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    def check_vm_exists(resource_group, name, async)
                      msg = "Checking Virtual Machine #{name}"
                      Fog::Logger.debug msg
                      begin
                        if async
            Severity: Minor
            Found in lib/fog/azurerm/requests/compute/check_vm_exists.rb - About 45 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 configure_os_disk_object has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def configure_os_disk_object(os_disk, os_disk_name, os_disk_caching, os_disk_size, platform, vm_name)
            Severity: Minor
            Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 45 mins to fix

              Method check_azure_resource_exists has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      def check_azure_resource_exists(resource_id, api_version = API_VERSION)
                        split_resource = resource_id.split('/') unless resource_id.nil?
                        raise 'Invalid Resource Id' if split_resource.count != 9
              
                        resource_group_name = get_resource_from_resource_id(resource_id, RESOURCE_GROUP_NAME)
              Severity: Minor
              Found in lib/fog/azurerm/requests/resources/check_azure_resource_exists.rb - About 45 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 configure_os_disk_object has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      def configure_os_disk_object(os_disk, os_disk_name, os_disk_caching, os_disk_size, platform, vm_name)
                        # It will use the os_disk_name provided or it will generate a name for itself if it is nil
                        os_disk.name = os_disk_name.nil? ? "#{vm_name}_os_disk" : os_disk_name
                        os_disk.os_type = platform
                        os_disk.disk_size_gb = os_disk_size unless os_disk_size.nil?
              Severity: Minor
              Found in lib/fog/azurerm/requests/compute/create_virtual_machine.rb - About 45 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_endpoint_object has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def get_endpoint_object(target_resource_id, target, weight, priority, endpoint_location, min_child_endpoints)

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

                        def create_express_route_circuit_peering(peering_type, peer_asn, primary_peer_address_prefix, secondary_peer_address_prefix, vlan_id, name)

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

                          def data_disk_params(disk_name, disk_size = nil, storage_account = nil, disk_resource_group = nil, caching = nil)
                  Severity: Minor
                  Found in lib/fog/azurerm/models/compute/server.rb - About 35 mins to fix

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

                            def wait_blob_copy_operation_to_finish(container_name, blob_name, copy_id, copy_status, timeout = nil)
                    Severity: Minor
                    Found in lib/fog/azurerm/requests/storage/wait_blob_copy_operation_to_finish.rb - About 35 mins to fix

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

                              def copy_blob(destination_container, destination_blob, source_container, source_blob, options = {})
                      Severity: Minor
                      Found in lib/fog/azurerm/requests/storage/copy_blob.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
                          Severity
                          Category
                          Status
                          Source
                          Language