Showing 630 of 1,221 total issues
Method byte_ranges
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def byte_ranges(http_range, size)
# See <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35>
return nil unless http_range
ranges = []
http_range.split(/,\s*/).each do |range_spec|
- 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 delete_object_helper
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def delete_object_helper(bucket, object_name, version_id)
response = { 'Deleted' => {} }
if bucket[:versioning]
bucket[:objects][object_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 end_element
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'member'
if @in_policy_names && @in_listeners
@listener_description['PolicyNames'] << value
Method end_element
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_description
case name
when 'value'
@response['description'] = 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 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@security_group['tagSet'][@tag['key']] = @tag['value']
Class File
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class File < Fog::Model
# @deprecated use {Fog::AWS::Storage::MIN_MULTIPART_CHUNK_SIZE} instead
MIN_MULTIPART_CHUNK_SIZE = Fog::AWS::Storage::MIN_MULTIPART_CHUNK_SIZE
# @deprecated use {Fog::AWS::Storage::MAX_SINGLE_PUT_SIZE} instead
MAX_SINGLE_PUT_SIZE = Fog::AWS::Storage::MAX_SINGLE_PUT_SIZE
Method normalize_permissions
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def normalize_permissions(options)
normalized_permissions = []
if options['SourceSecurityGroupName']
group_name = if options['SourceSecurityGroupName'] =~ /default_elb/
"default"
Method tagged_resources
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def tagged_resources(resources)
Array(resources).map do |resource_id|
if match = resource_id.match(/^(\w+)-[a-z0-9]{8,17}/i)
id = match.captures.first
else
- 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 23 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_entry_set
if @in_port_range
case name
when 'portRange'
- 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_cache_security_groups
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def describe_cache_security_groups(name = nil, opts={})
if name
sec_group_set = [self.data[:security_groups][name]].compact
raise Fog::AWS::Elasticache::NotFound.new("Security Group #{name} not found") if sec_group_set.empty?
else
- 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 23 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_block_device_mapping
case name
when 'blockDeviceMapping'
@in_block_device_mapping = 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 create_subnet
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def create_subnet(vpcId, cidrBlock, options = {})
av_zone = options['AvailabilityZone'].nil? ? 'us-east-1c' : options['AvailabilityZone']
Excon::Response.new.tap do |response|
if cidrBlock && vpcId
vpc = self.data[:vpcs].find{ |v| v['vpcId'] == vpcId }
- 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 receive_message
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def receive_message(queue_url, options = {})
Excon::Response.new.tap do |response|
if (queue = data[:queues][queue_url])
max_number_of_messages = options['MaxNumberOfMessages'] || 1
now = Time.now
- 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 80 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]
File file.rb
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fog/aws/models/storage/versions'
module Fog
module AWS
class Storage
Method get_object
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_object(bucket_name, object_name, options = {}, &block)
version_id = options.delete('versionId')
unless bucket_name
raise ArgumentError.new('bucket_name is required')
File iam.rb
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Fog
module AWS
class IAM < Fog::Service
extend Fog::AWS::CredentialFetcher::ServiceMethods
Method end_element
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@nic['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_load_balancer
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def create_load_balancer(availability_zones, lb_name, listeners = [], options = {})
response = Excon::Response.new
response.status = 200
raise Fog::AWS::ELB::IdentifierTaken if self.data[:load_balancers].key? lb_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 end_element
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'member'
if @in_availability_zones
@auto_scaling_group['AvailabilityZones'] << value