Showing 630 of 1,221 total issues
Method list_policies
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_policies(options={})
limit = options['MaxItems']
marker = options['Marker']
if limit
Method _request
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _request(body, headers, idempotent, parser)
@connection.request({
:body => body,
:expects => 200,
:headers => headers,
Method end_element
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case @context[1 .. -1].join('.')
# tagSet
when 'vpcSet.item.tagSet.item'
Method end_element
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @instance_profile
case name
when 'Arn', 'Path'
if @role
Method create_change_set
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_change_set(stack_name, options = {})
params = {
'StackName' => stack_name,
}
Method describe_load_balancers
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_load_balancers(options = {})
unless options.is_a?(Hash)
Fog::Logger.deprecation("describe_load_balancers with #{options.class} is deprecated, use all('LoadBalancerNames' => []) instead [light_black](#{caller.first})[/]")
options = { 'LoadBalancerNames' => [options].flatten }
end
Method replace_route
has 36 lines of code (exceeds 25 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 }
Method get_function
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_function(params={})
response = Excon::Response.new
response.status = 200
response.body = ''
Method run_instance_options
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def run_instance_options
raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
requires :image_id
options = {
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'member'
if @in_capabilities
@response['Capabilities'] << 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 12 (exceeds 5 allowed). Consider refactoring. Open
def _request(body, headers, idempotent, parser, method, path, expects)
response = @connection.request({
:body => body,
:expects => expects,
:idempotent => idempotent,
- 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 multipart_save
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def multipart_save(options)
# Initiate the upload
res = service.initiate_multipart_upload(directory.key, key, options)
upload_id = res.body["UploadId"]
- 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 save_many
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def save_many(template, min_servers = 1, max_servers = nil)
max_servers ||= min_servers
data = service.run_instances(template.image_id, min_servers, max_servers, template.run_instance_options)
# For some reason, AWS sometimes returns empty results alongside the real ones. Thus the select
data.body['instancesSet'].select { |instance_set| instance_set['instanceId'] }.map do |instance_set|
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def _request(body, headers, idempotent, parser, retries = 0)
max_retries = 10
begin
- 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 store_mock_object
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def store_mock_object(bucket, object_name, body, options)
object = {
:body => body,
'Content-Type' => options['Content-Type'],
'ETag' => OpenSSL::Digest::MD5.hexdigest(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 end_element
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@route_table['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 create_stack
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create_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 describe_load_balancers
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def describe_load_balancers(options = {})
unless options.is_a?(Hash)
Fog::Logger.deprecation("describe_load_balancers with #{options.class} is deprecated, use all('LoadBalancerNames' => []) instead [light_black](#{caller.first})[/]")
options = { 'LoadBalancerNames' => [options].flatten }
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 list_attached_group_policies
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def list_attached_group_policies(group_name, options={})
unless self.data[:groups].key?(group_name)
raise Fog::AWS::IAM::NotFound.new("The group with name #{group_name} cannot be found.")
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 modify_network_interface_attribute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def modify_network_interface_attribute(network_interface_id, attribute, value)
response = Excon::Response.new
if self.data[:network_interfaces][network_interface_id]
nic = self.data[:network_interfaces][network_interface_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"