lib/fog/aws/requests/dns/change_resource_record_sets.rb

Summary

Maintainability
D
1 day
Test Coverage
C
75%

Method change_resource_record_sets has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

        def change_resource_record_sets(zone_id, change_batch, options = {})
          response = Excon::Response.new
          errors   = []


Severity: Minor
Found in lib/fog/aws/requests/dns/change_resource_record_sets.rb - About 1 day 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 change_resource_record_sets has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def change_resource_record_sets(zone_id, change_batch, options = {})
          response = Excon::Response.new
          errors   = []


Severity: Major
Found in lib/fog/aws/requests/dns/change_resource_record_sets.rb - About 2 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                      action_performed = true unless zone[:records][change[:type]].delete(change_name).nil?
    Severity: Major
    Found in lib/fog/aws/requests/dns/change_resource_record_sets.rb - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          zone[:records][change[:type]][change_name] = {} if zone[:records][change[:type]][change_name].nil?
      Severity: Major
      Found in lib/fog/aws/requests/dns/change_resource_record_sets.rb - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status