Method converge!
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def converge!(stack_name, options = {})
config(options)
options[:on_failure].upcase! if options[:on_failure]
tmpl = options[:template] || "#{stack_name}.rb"
cfn = options[:aws_options] || {}
- Read upRead up
- Create a ticketCreate a ticket
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
File cfer.rb
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/all'
require 'aws-sdk-cloudformation'
require 'aws-sdk-s3'
require 'logger'
require 'json'
- Create a ticketCreate a ticket
Method describe!
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def describe!(stack_name, options = {})
config(options)
cfn = options[:aws_options] || {}
cfn_stack = options[:cfer_client] || Cfer::Cfn::Client.new(cfn.merge(stack_name: stack_name))
cfn_metadata = cfn_stack.fetch_metadata
- Read upRead up
- Create a ticketCreate a ticket
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 converge!
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def converge!(stack_name, options = {})
config(options)
options[:on_failure].upcase! if options[:on_failure]
tmpl = options[:template] || "#{stack_name}.rb"
cfn = options[:aws_options] || {}
- Create a ticketCreate a ticket
Method describe!
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe!(stack_name, options = {})
config(options)
cfn = options[:aws_options] || {}
cfn_stack = options[:cfer_client] || Cfer::Cfn::Client.new(cfn.merge(stack_name: stack_name))
cfn_metadata = cfn_stack.fetch_metadata
- Create a ticketCreate a ticket
Method delete!
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def delete!(stack_name, options = {})
config(options)
cfn = options[:aws_options] || {}
cfn_stack = options[:cfer_client] || cfn_stack = Cfer::Cfn::Client.new(cfn.merge(stack_name: stack_name))
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid deeply nested control flow statements. Open
rollback_opts[:role_arn] = options[:role_arn] if options[:role_arn]
- Create a ticketCreate a ticket
Method generate_final_parameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_final_parameters(options)
raise Cfer::Util::CferError, "parameter-environment set but parameter_file not set" \
if options[:parameter_environment] && options[:parameter_file].nil?
final_params = HashWithIndifferentAccess.new
- Read upRead up
- Create a ticketCreate a ticket
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"