Showing 630 of 1,221 total issues
Method subscribe
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def subscribe(arn, endpoint, protocol)
response = Excon::Response.new
unless topic = self.data[:topics][arn]
response.status = 400
Method list_attached_user_policies
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def list_attached_user_policies(user_name, options={})
unless self.data[:users].key?(user_name)
raise Fog::AWS::IAM::NotFound.new("The user with name #{user_name} cannot be found.")
end
Method list_roles
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def list_roles(options={})
limit = options['MaxItems']
marker = options['Marker']
if limit
Method signature_v2
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def signature_v2(params, expires)
headers = params[:headers] || {}
string_to_sign =
<<-DATA
Method request
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def request(params, &block)
refresh_credentials_if_expired
date = Fog::Time.now
Method data
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.data
@data ||= Hash.new do |hash, region|
hash[region] = Hash.new do |region_hash, key|
tac_id = Fog::Mock.random_hex(5)
region_hash[key] = {
Method put_bucket_website
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def put_bucket_website(bucket_name, options, options_to_be_deprecated = {})
options ||= {}
# Method used to be called with the suffix as the second parameter. Warn user that this is not the case any more and move on
if options.is_a?(String)
Method end_element
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@subnet['tagSet'][@tag['key']] = @tag['value']
Method end_element
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'attachTime'
@block_device_mapping[name] = Time.parse(value)
when *@contexts
Method end_element
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'Name', 'Value'
@dimension[name] = value
when 'AlarmConfigurationUpdatedTimestamp', 'StateUpdatedTimestamp'
Method modify_db_instance
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
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"
Method create_db_instance_read_replica
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_db_instance_read_replica(instance_identifier, source_identifier, options={})
# TODO: throw error when instance_identifier already exists,
# or source_identifier doesn't exist
source = self.data[:servers][source_identifier]
Method list_attached_role_policies
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def list_attached_role_policies(role_name, options={})
unless self.data[:roles].key?(role_name)
raise Fog::AWS::IAM::NotFound.new("The role with name #{role_name} cannot be found.")
end
Method list_attached_group_policies
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Consider simplifying this complex logical expression. Open
Open
if bucket = self.data[:buckets][bucket_name]
contents = bucket[:objects].values.map(&:first).sort {|x,y| x['Key'] <=> y['Key']}.reject do |object|
(prefix && object['Key'][0...prefix.length] != prefix) ||
(marker && object['Key'] <= marker) ||
(delimiter && object['Key'][(prefix ? prefix.length : 0)..-1].include?(delimiter) \
Method end_element
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'member'
if @in_availability_zones && @in_load_balancer_addresses
@availability_zone['LoadBalancerAddresses'] << @load_balancer_addresses
Method end_element
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'member'
if @in_availability_zones && @in_load_balancer_addresses
@availability_zone['LoadBalancerAddresses'] << @load_balancer_addresses
Method end_element
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@subnet['tagSet'][@tag['key']] = @tag['value']
Method end_element
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @in_attachment_set
case name
when 'attachmentSet'
@in_attachment_set = false
Method end_element
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@dhcp_options['tagSet'][@tag['key']] = @tag['value']