Showing 14 of 89 total issues
File aws.rb
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'aws-sdk'
require 'base64'
require 'leeroy/helpers'
require 'leeroy/helpers/env'
Method _getPackerParams
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _getPackerParams(state = self.state, env = self.env, options = self.options)
begin
logger.debug "generating Packer params to create an AMI"
packer_params = Leeroy::Types::Mash.new
- 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 _getPackerParams
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _getPackerParams(state = self.state, env = self.env, options = self.options)
begin
logger.debug "generating Packer params to create an AMI"
packer_params = Leeroy::Types::Mash.new
Method _genInstanceParams
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _genInstanceParams(state = self.state, env = self.env, ec2 = self.ec2, options = self.options)
begin
logger.debug "generating params for creating an EC2 instance"
# gather the necessary parameters
Method dump
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def dump
begin
logger.debug "beginning dump"
dump_mash = Leeroy::Types::Mash.new
- 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 filterImages
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def filterImages(selector, collector = lambda { |x| x }, state = self.state, env = self.env, ec2 = self.ec2, options = self.options)
Method createTags
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def createTags(tags = {}, resourceids = [], state = self.state, env = self.env, options = self.options)
Method _genImageParams
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _genImageParams(phase, state = self.state, env = self.env, ec2 = self.ec2, options = self.options)
Method _resolveResources
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _resolveResources(state = self.state, env = self.env, ec2 = self.ec2, options = self.options)
begin
# resolve VPC ID
if state.vpcid?
vpcid = state.vpcid
- 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 resolve
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.resolve(candidate, alternate = nil)
resolved = candidate.kind_of?(Leeroy::Types::Enum) ? candidate : self.from_s(candidate)
if candidate.nil?
resolved = self.resolve(alternate, nil) unless alternate.nil?
- 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 perform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def perform(args = self.args, options = self.options, global_options = self.global_options)
begin
super(args, options, global_options)
# destroy instance
- 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 _genInstanceParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _genInstanceParams(state = self.state, env = self.env, ec2 = self.ec2, options = self.options)
begin
logger.debug "generating params for creating an EC2 instance"
# gather the necessary parameters
- 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 genImageName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def genImageName(phase = nil, state = self.state, options = self.options)
begin
# extract phase from state if not provided
phase = state.phase if phase.nil?
- 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 _prepImageCreationPolling
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _prepImageCreationPolling
# poll to make sure image is created
self.poll_callback = lambda do |imageid|
begin
run_params = { :image_ids => [imageid], :owners => ['self'] }
- 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"