Showing 630 of 1,221 total issues
Method describe_snapshots
has a Cognitive Complexity of 15 (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"
Further reading
Method create_function
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def create_function(params={})
response = Excon::Response.new
runtime = params.delete('Runtime') || 'nodejs'
if !%w(nodejs java8).include?(runtime)
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_association_set
case name
when 'associationSet'
@in_association_set = false
Method delete_object
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_object(bucket_name, object_name, options = {})
response = Excon::Response.new
if bucket = self.data[:buckets][bucket_name]
response.status = 204
Method put_bucket_logging
has 47 lines of code (exceeds 25 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" />
Method describe_network_acls
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_network_acls(filters = {})
response = Excon::Response.new
network_acls = self.data[:network_acls].values
network_acls = apply_tag_filters(network_acls, filters, 'networkAclId')
Method describe_spot_price_history
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_spot_price_history(filters = {})
params = {}
spot_price_history_set = []
response = Excon::Response.new
Method create_network_acl
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_network_acl(vpcId, options = {})
response = Excon::Response.new
if vpcId
id = Fog::AWS::Mock.network_acl_id
Method get_bucket
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_bucket(bucket_name, options = {})
prefix, marker, delimiter, max_keys = \
options['prefix'], options['marker'], options['delimiter'], options['max-keys']
common_prefixes = []
Method describe_clusters
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_clusters(params={})
response = Excon::Response.new
response.status = 200
members = params.delete('clusters')
Method match_error
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.match_error(error)
if !Fog::AWS.json_response?(error.response)
matchers = [
lambda {|s| s.match(/(?:.*<Code>(.*)<\/Code>)(?:.*<Message>(.*)<\/Message>)/m)},
lambda {|s| s.match(/.*<(.+Exception)>(?:.*<Message>(.*)<\/Message>)/m)}
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'Enabled'
if @cross_zone_load_balancing
@cross_zone_load_balancing['Enabled'] = value == 'true' ? true : 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"
Further reading
Method end_element
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'member'
if @in_availability_zones
@auto_scaling_group['AvailabilityZones'] << 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 14 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
super
case name
when *@contexts
@context.pop
- 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 modify_cluster
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def modify_cluster(options = {})
cluster_identifier = options[:cluster_identifier]
cluster_type = options[:cluster_type]
node_type = options[:node_type]
master_user_password = options[:master_user_password]
- 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 get_records
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get_records(options={})
shard_iterator = Fog::JSON.decode(options.delete("ShardIterator"))
limit = options.delete("Limit") || -1
stream_name = shard_iterator["StreamName"]
shard_id = shard_iterator["ShardId"]
- 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 terminate_instances
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def terminate_instances(instance_id)
response = Excon::Response.new
instance_id = [*instance_id]
if (self.data[:instances].keys & instance_id).length == instance_id.length
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 upload_server_certificate
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def upload_server_certificate(certificate, private_key, name, options = {})
if certificate.nil? || certificate.empty? || private_key.nil? || private_key.empty?
raise Fog::AWS::IAM::ValidationError.new
end
response = Excon::Response.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 authorize_security_group_ingress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def authorize_security_group_ingress(group_name, options = {})
options = Fog::AWS.parse_security_group_options(group_name, options)
group = if options.key?('GroupName')
self.data[:security_groups].values.find { |v| v['groupName'] == options['GroupName'] }
- 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_security_group_egress
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def authorize_security_group_egress(group_name, options = {})
options = Fog::AWS.parse_security_group_options(group_name, options)
group = if options.key?('GroupName')
self.data[:security_groups].values.find { |v| v['groupName'] == options['GroupName'] }
- 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"