manheim/cf_deployer

View on GitHub
lib/cf_deployer/stack.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Method deploy has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def deploy
      config_dir = @context[:config_dir]
      template = CfDeployer::ConfigLoader.erb_to_json(@component, @context)
      capabilities = @context[:capabilities] || []
      notify = @context[:notify] || []
Severity: Minor
Found in lib/cf_deployer/stack.rb - About 1 hr 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 wait_for_stack_to_delete has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    def wait_for_stack_to_delete
      Timeout::timeout(900){
        while exists?
          begin
            Log.info "current status: #{stack_status}"
Severity: Minor
Found in lib/cf_deployer/stack.rb - About 1 hr 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_stack has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def create_stack(template, params, capabilities, tags, notify, create_policy_json)
Severity: Minor
Found in lib/cf_deployer/stack.rb - About 45 mins to fix

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

        def update_stack(template, params, capabilities, tags, override_policy_json)
    Severity: Minor
    Found in lib/cf_deployer/stack.rb - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status