fog/fog-azure-rm

View on GitHub
lib/fog/azurerm/requests/network/create_or_update_virtual_network_gateway.rb

Summary

Maintainability
A
1 hr
Test Coverage
F
15%

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

    There are no issues that match your filters.

    Category
    Status