Showing 630 of 1,221 total issues
Avoid deeply nested control flow statements. Open
case key
when 'Cache-Control', 'Content-Disposition', 'Content-Encoding', 'Content-Length', 'Content-MD5', 'Content-Type', 'ETag', 'Expires', 'Last-Modified', /^x-amz-meta-/
response.headers[key] = value
end
Avoid deeply nested control flow statements. Open
response.headers['x-amz-delete-marker'] = 'true' if version[:delete_marker]
Avoid deeply nested control flow statements. Open
case name
when 'group', 'userId'
@response['launchPermission'] << value
when 'launchPermission'
@in_launchPermission = false
Avoid deeply nested control flow statements. Open
case name
when 'code', 'message'
@state_reason[name] = value
when 'stateReason'
@image['stateReason'] = @state_reason
Method end_element
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
#Simple closers
when 'instanceId', 'availabilityZone'
@instance[name] = 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 8 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'Name', 'Value'
@dimension[name] = value
when 'Period', 'EvaluationPeriods'
- 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
Avoid deeply nested control flow statements. Open
case name
when 'volumeStatus'
@volume['volumeStatus'] = @volume_status
@volume_status = { 'details' => [] }
@in_volume_status = false
Method create_change_set
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_change_set(stack_name, options = {})
params = {
'StackName' => 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 describe_orderable_db_instance_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def describe_orderable_db_instance_options(engine=nil, opts={})
instance_options = []
response = Excon::Response.new
if engine
(opts[:db_instance_class] || %w(db.m2.xlarge db.m1.large)).each do |size|
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def register_image(name, description, location, block_devices=[], options={})
common_options = {
'Action' => 'RegisterImage',
'Name' => name,
'Description' => description,
- 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 put_bucket_logging
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def put_bucket_logging(bucket_name, logging_status)
if logging_status['LoggingEnabled'].empty?
data =
<<-DATA
<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01" />
- 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 upload_part
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def upload_part(vault_name, upload_id, body, offset, hash, options={})
Method describe_image_attribute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def describe_image_attribute(image_id, attribute)
response = Excon::Response.new
if image = self.data[:images].values.find{ |i| i['imageId'] == image_id }
response.status = 200
response.body = {
- 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 copy_object
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {})
response = Excon::Response.new
source_bucket = self.data[:buckets][source_bucket_name]
source_object = source_bucket && source_bucket[:objects][source_object_name] && source_bucket[:objects][source_object_name].first
target_bucket = self.data[:buckets][target_bucket_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_db_instance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete_db_instance(identifier, snapshot_identifier, skip_snapshot = false)
response = Excon::Response.new
server_set = self.data[:servers][identifier] ||
- 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
Avoid deeply nested control flow statements. Open
if self.data[:domains][domain_name][item_name][key]
if value.nil? || value.empty?
self.data[:domains][domain_name][item_name].delete(key)
else
for v in value
Method create_auto_scaling_group
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {})
Avoid deeply nested control flow statements. Open
if vpc['enableDnsHostnames']
instance['dnsName'] = Fog::AWS::Mock.dns_name_for(public_ip)
end
Method create_auto_scaling_group
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_auto_scaling_group(auto_scaling_group_name, availability_zones, launch_configuration_name, max_size, min_size, options = {})
Method describe_snapshots
has a Cognitive Complexity of 8 (exceeds 5 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
- 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"