Showing 11 of 11 total issues
File cli.rb
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'thor'
require 'aws-sdk-cloudformation'
require 'cfncli/cloudformation'
require 'cfncli/config'
Method parse_cli_params
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def parse_cli_params(params)
validation_failures = []
parsed_params = params.map.with_index do |param, i|
key, value = param.split(',', 2)
if key.to_s.empty? || value.to_s.empty?
- Read upRead up
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 apply
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def apply
opts = process_params(options)
stack_name = opts['stack_name']
fail ArgumentError, 'stack_name is required' unless stack_name
- Read upRead up
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 process_params
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process_params(opts)
opts = opts.dup
check_exclusivity(opts.keys, ['template_body', 'template_url'])
check_exclusivity(opts.keys, ['disable_rollback', 'on_failure'])
check_exclusivity(opts.keys, ['stack_policy_body', 'stack_policy_url'])
- Read upRead up
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 list_events
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def list_events(&block)
events = []
stack.events.each { |event| events << event }
events.sort { |a, b| a.timestamp <=> b.timestamp }.each do |event|
yield event unless seen?(event) if block_given?
- Read upRead up
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 events
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def events(stack_or_name, config = nil, list_nested_events = true, reset_events = true, poller = nil, streamer = nil)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(interval = 10, retries = 30, fail_on_noop = false, aws_retry_limit = 5, aws_retry_backoff = nil)
Method list_events
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_events(poller, streamer = nil, config = nil, event_prefix = nil, list_nested_events = true)
Method delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def delete
opts = options.dup
stack_name = opts['stack_name']
fail ArgumentError, 'stack_name is required' unless stack_name
- Read upRead up
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 delete_and_list_events
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def delete_and_list_events(options, config = nil)
# Create/update the stack
logger.debug "Deleting stack #{options['stack_name']}"
list_nested_events = options['list_nested_events']
options.delete 'list_nested_events'
- Read upRead up
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 child_stack_create_event?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def child_stack_create_event?
return false unless in_progress?
return false unless event.resource_type == AWS_STACK_RESOURCE
return false unless event.resource_status_reason == RESOURCE_CREATE_INITIATED
true
- Read upRead up
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"