Showing 630 of 1,221 total issues
Method add_permission
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_permission(params={})
function_id = params.delete('FunctionName')
function = self.get_function_configuration(
'FunctionName' => function_id
).body
Method create_hosted_zone
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_hosted_zone(name, options = {})
# Append a trailing period to the name if absent.
name = name + "." unless name.end_with?(".")
response = Excon::Response.new
Method end_element
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@dhcp_options['tagSet'][@tag['key']] = @tag['value']
Method start_element
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_element(name, attrs = [])
super
case name
when 'instanceType'
@in_instanceType = true
Method describe_db_security_groups
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_db_security_groups(opts={})
response = Excon::Response.new
sec_group_set = []
if opts.is_a?(String)
sec_group_name = opts
Method create_route
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_route(route_table_id, destination_cidr_block, internet_gateway_id=nil, instance_id=nil, network_interface_id=nil)
instance_owner_id = nil
route_table = self.data[:route_tables].find { |routetable| routetable["routeTableId"].eql? route_table_id }
if !route_table.nil? && destination_cidr_block
if !internet_gateway_id.nil? || !instance_id.nil? || !network_interface_id.nil?
Method list_keys
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_keys(options={})
limit = options[:limit]
marker = options[:marker]
if limit
Method bootstrap
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def bootstrap(new_attributes = {})
spot_request = service.spot_requests.new(new_attributes)
unless new_attributes[:key_name]
# first or create fog_#{credential} keypair
- 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 encode_attributes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def encode_attributes(attributes, replace_attributes = [], expected_attributes = {})
encoded_attributes = {}
if attributes
expected_attributes.keys.each_with_index do |exkey, index|
- 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_element
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def start_element(name, attrs = [])
super
case name
when 'description'
@in_description = true
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
super
case name
when 'taskDefinitionArn'
@response[@result][@definition][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 13 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
super
case name
when 'stringSetValue'
@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 describe_load_balancer_policies
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def describe_load_balancer_policies(lb_name = nil, names = [])
if lb_name
raise Fog::AWS::ELB::NotFound unless load_balancer = self.data[:load_balancers][lb_name]
names = [*names]
policies = if names.any?
- 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 update_stack
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update_stack(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 restore_db_instance_from_db_snapshot
has a Cognitive Complexity of 13 (exceeds 5 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
- 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_load_balancer_listeners
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create_load_balancer_listeners(lb_name, listeners)
load_balancer = data[:load_balancers][lb_name]
raise Fog::AWS::ELB::NotFound unless load_balancer
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 run_instances
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run_instances(image_id, min_count, max_count, options = {})
response = Excon::Response.new
response.status = 200
group_set = [ (options['SecurityGroup'] || 'default') ].flatten
- 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_network_acl_entry
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create_network_acl_entry(network_acl_id, rule_number, protocol, rule_action, cidr_block, egress, options = {})
response = Excon::Response.new
if self.data[:network_acls][network_acl_id]
if self.data[:network_acls][network_acl_id]['entrySet'].find { |r| r['ruleNumber'] == rule_number && r['egress'] == egress }
- 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_images
has a Cognitive Complexity of 13 (exceeds 5 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
- 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_spot_price_history
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def describe_spot_price_history(filters = {})
params = {}
spot_price_history_set = []
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"