Showing 630 of 1,218 total issues
Method get_bucket_object_versions
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_bucket_object_versions(bucket_name, options = {})
delimiter, key_marker, max_keys, prefix, version_id_marker = \
options['delimiter'], options['key-marker'], options['max-keys'],options['prefix'],options['version-id-marker']
unless bucket_name
Method request_spot_instances
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_spot_instances(image_id, instance_type, spot_price, options = {})
response = Excon::Response.new
id = Fog::AWS::Mock.spot_instance_request_id
if (image_id && instance_type && spot_price)
Method change_resource_record_sets
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def change_resource_record_sets(zone_id, change_batch, options = {})
response = Excon::Response.new
errors = []
Method end_element
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_default_actions
case name
when 'member'
if @in_target_groups
- 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 create_cluster
has a Cognitive Complexity of 21 (exceeds 5 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]
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @instance_profile
case name
when 'Arn', 'Path'
if @role
- 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 run_instances
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def run_instances(image_id, min_count, max_count, options = {})
if block_device_mapping = options.delete('BlockDeviceMapping')
block_device_mapping.each_with_index do |mapping, index|
for key, value in mapping
options.merge!({ format("BlockDeviceMapping.%d.#{key}", index) => 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 signature_v2
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def signature_v2(params, expires)
headers = params[:headers] || {}
string_to_sign =
<<-DATA
- 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 start_task
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_task(params={})
response = Excon::Response.new
response.status = 200
unless task_def_id = params.delete('taskDefinition')
Method create_service
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_service(params={})
response = Excon::Response.new
response.status = 200
e = Fog::AWS::ECS::Error
Method end_element
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'DeleteMarker'
@response['Versions'] << {'DeleteMarker' => @delete_marker }
@delete_marker = { 'Owner' => {} }
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@subnet['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 20 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@subnet['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 _request
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def _request(scheme, host, port, params, original_params, &block)
connection(scheme, host, port).request(params, &block)
rescue Excon::Errors::MovedPermanently, Excon::Errors::TemporaryRedirect => error
headers = (error.response.is_a?(Hash) ? error.response[:headers] : error.response.headers)
new_params = {}
- 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 fetch_credentials
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch_credentials(options)
if options[:use_iam_profile] && Fog.mocking?
return Fog::AWS::Compute::Mock.data[:iam_role_based_creds]
end
if options[:use_iam_profile]
Method associate_address
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def associate_address(*args)
if args.first.kind_of? Hash
params = args.first
else
params = {
Method end_element
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'AutoMinorVersionUpgrade', 'CacheClusterId',
'CacheClusterStatus', 'CacheNodeType', 'Engine',
'PreferredAvailabilityZone', 'PreferredMaintenanceWindow'
Method create_volume
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_volume(availability_zone, size, options = {})
unless options.is_a?(Hash)
Fog::Logger.deprecation("create_volume with a bare snapshot_id is deprecated, use create_volume(availability_zone, size, 'SnapshotId' => snapshot_id) instead [light_black](#{caller.first})[/]")
options = { 'SnapshotId' => options }
end
Method end_element
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'ChangeSetId', 'ChangeSetName', 'Description', 'ExecutionStatus', 'StackId', 'StackName', 'StatusReason', 'Status'
@response[name] = value
when 'CreationTime'
Method data
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, key|
owner_id = Fog::AWS::Mock.owner_id
hash[key] = {