Showing 630 of 1,221 total issues
Method replace_route
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def replace_route(route_table_id, destination_cidr_block, options = {})
options['instanceOwnerId'] ||= nil
options['DestinationCidrBlock'] ||= destination_cidr_block
route_table = self.data[:route_tables].find { |routetable| routetable["routeTableId"].eql? route_table_id }
- 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_db_instance
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def modify_db_instance(db_name, apply_immediately, _options={})
options = _options.dup
response = Excon::Response.new
if server = self.data[:servers][db_name]
if server["DBInstanceStatus"] != "available"
- 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_attributes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def put_attributes(domain_name, item_name, attributes, options = {})
options[:expect] = {} unless options[:expect]
options[:replace] = [] unless options[:replace]
response = Excon::Response.new
if self.data[:domains][domain_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 create_service
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def create_service(params={})
response = Excon::Response.new
response.status = 200
e = Fog::AWS::ECS::Error
- 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_attributes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_attributes(domain_name, item_name, options = {})
if options.is_a?(Array)
Fog::Logger.deprecation("get_attributes with array attributes param is deprecated, use 'AttributeName' => attributes) instead [light_black](#{caller.first})[/]")
options['AttributeName'] ||= options if options.is_a?(Array)
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 end_element
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'AvailabilityZone', 'ClusterIdentifier', 'ClusterStatus', 'ClusterSubnetGroupName', 'DBName',
'MasterUsername', 'ModifyStatus', 'PreferredMaintenanceWindow', 'VpcId'
@cluster[name] = value
Method end_element
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_expiration
case name
when 'Days'
@expiration[name] = value.to_i
Method data
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, region|
owner_id = Fog::AWS::Mock.owner_id
hash[region] = Hash.new do |region_hash, key|
region_hash[key] = {
Method change_resource_record_sets_data
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.change_resource_record_sets_data(zone_id, change_batch, version, options = {})
# AWS methods return zone_ids that looks like '/hostedzone/id'. Let the caller either use
# that form or just the actual id (which is what this request needs)
zone_id = zone_id.sub('/hostedzone/', '')
Method end_element
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_entry_set
if @in_port_range
case name
when 'portRange'
Method run_instances
has 58 lines of code (exceeds 25 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 })
Method describe_volumes
has 58 lines of code (exceeds 25 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
Method acls
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.acls(type)
case type
when 'private'
{
"AccessControlList" => [
Method list_resource_record_sets
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_resource_record_sets(zone_id, options = {})
maxitems = [options[:max_items]||100,100].min
response = Excon::Response.new
Method end_element
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_outputs
case name
when 'OutputKey', 'OutputValue', 'Description'
@output[name] = value
Method end_element
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_block_device_mapping
case name
when 'blockDeviceMapping'
@in_block_device_mapping = false
Method update_stack
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update_stack(stack_name, options = {})
params = {
'StackName' => stack_name,
}
Method register_image
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def register_image(name, description, location, block_devices=[], options={})
unless name.empty?
image = {
'imageId' => Fog::AWS::Mock.image_id,
'imageLocation' => '',
Method []
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.[](service)
@@connections ||= Hash.new do |hash, key|
hash[key] = case key
when :auto_scaling
Fog::AWS::AutoScaling.new
Method request_params
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_params(params)
headers = params[:headers] || {}
if params[:scheme]
scheme = params[:scheme]