Showing 630 of 1,221 total issues
Method end_element
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@dhcp_options['tagSet'][@tag['key']] = @tag['value']
- 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 end_element
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@dhcp_options['tagSet'][@tag['key']] = @tag['value']
- 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 register_image
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def register_image(name, description, location, block_devices=[], options={})
unless name.empty?
image = {
'imageId' => Fog::AWS::Mock.image_id,
'imageLocation' => '',
- 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 describe_volumes
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def describe_volumes(filters = {})
unless filters.is_a?(Hash)
Fog::Logger.deprecation("describe_volumes with #{filters.class} param is deprecated, use describe_volumes('volume-id' => []) instead [light_black](#{caller.first})[/]")
filters = {'volume-id' => [*filters]}
end
- 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 authorize_db_security_group_ingress
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def authorize_db_security_group_ingress(name, opts = {})
unless opts.key?('CIDRIP') || ((opts.key?('EC2SecurityGroupName') || opts.key?('EC2SecurityGroupId')) && opts.key?('EC2SecurityGroupOwnerId'))
raise ArgumentError, 'Must specify CIDRIP, or one of EC2SecurityGroupName or EC2SecurityGroupId, and EC2SecurityGroupOwnerId'
end
- 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 normalize_permissions
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def normalize_permissions(options)
normalized_permissions = []
if options['SourceSecurityGroupName']
group_name = if options['SourceSecurityGroupName'] =~ /default_elb/
"default"
- 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 request
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def request(params, &block)
refresh_credentials_if_expired
date = Fog::Time.now
- 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 end_element
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
super
case name
when 'containerOverrides'
@task['overrides'] ||= {}
Method restore_db_instance_from_db_snapshot
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def restore_db_instance_from_db_snapshot(snapshot_id, db_name, options={})
if self.data[:servers] and self.data[:servers][db_name]
raise Fog::AWS::RDS::IdentifierTaken.new("DBInstanceAlreadyExists #{response.body.to_s}")
end
Method setup_default_vpc!
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_default_vpc!
return if default_vpc.present?
disable_ec2_classic
Method describe_load_balancers
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_load_balancers(options = {})
unless options.is_a?(Hash)
Fog::Logger.deprecation("describe_load_balancers with #{options.class} is deprecated, use all('LoadBalancerNames' => []) instead [light_black](#{caller.first})[/]")
options = { 'LoadBalancerNames' => [options].flatten }
end
Method create_stack
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_stack(stack_name, options = {})
params = {
'StackName' => stack_name,
}
Method describe_images
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_images(filters = {})
unless filters.is_a?(Hash)
Fog::Logger.deprecation("describe_images with #{filters.class} param is deprecated, use describe_images('image-id' => []) instead [light_black](#{caller.first})[/]")
filters = {'image-id' => [*filters]}
end
Method describe_availability_zones
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_availability_zones(filters = {})
unless filters.is_a?(Hash)
Fog::Logger.deprecation("describe_availability_zones with #{filters.class} param is deprecated, use describe_availability_zones('zone-name' => []) instead [light_black](#{caller.first})[/]")
filters = {'zone-name' => [*filters]}
end
Method end_element
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
super
case name
when 'stringSetValue'
@context.pop
Method delete_security_group
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_security_group(name, id = nil)
if name == 'default'
raise Fog::AWS::Compute::Error.new("InvalidGroup.Reserved => The security group 'default' is reserved")
end
Method create_cluster
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_cluster(options = {})
db_name = options[:db_name]
cluster_identifier = options[:cluster_identifier]
cluster_type = options[:cluster_type]
node_type = options[:node_type]
Method end_element
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'member'
if @in_block_device_mappings
@launch_configuration['BlockDeviceMappings'] << @block_device_mapping
Method describe_snapshots
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_snapshots(filters = {}, options = {})
unless filters.is_a?(Hash)
Fog::Logger.deprecation("describe_snapshots with #{filters.class} param is deprecated, use describe_snapshots('snapshot-id' => []) instead [light_black](#{caller.first})[/]")
filters = {'snapshot-id' => [*filters]}
end
Method end_element
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_association_set
case name
when 'associationSet'
@in_association_set = false
- 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"