Showing 630 of 1,221 total issues
Method _request
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def _request(body, headers, idempotent, parser, method, path, expects)
response = @connection.request({
:body => body,
:expects => expects,
:idempotent => idempotent,
Method end_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'DistributionSummary'
@response['DistributionSummary'] << @distribution_summary
@distribution_summary = { 'CNAME' => [], 'TrustedSigners' => [] }
Method tagged_resources
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method end_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@internet_gateway['tagSet'][@tag['key']] = @tag['value']
Method end_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'Port', 'Engine', 'Status', 'BackupRetentionPeriod', 'DBSubnetGroup', 'EngineVersion', 'Endpoint', 'DBClusterParameterGroup', 'DBClusterIdentifier', 'PreferredBackupWindow', 'PreferredMaintenanceWindow', 'AllocatedStorage', 'MasterUsername'
@db_cluster[name] = value
when 'VpcSecurityGroups'
Method start_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def start_element(name, attrs = [])
super
case name
when 'description'
@in_description = true
Method end_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @section == :hosted_zone
case name
when 'Id'
@hosted_zone[name]= value.sub('/hostedzone/', '')
Method modify_cache_cluster
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def modify_cache_cluster(id, options = {})
response = Excon::Response.new
cluster = self.data[:clusters][id]
pending_values = Hash.new
# For any given option, update the cluster's corresponding value
Method end_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@instance['tagSet'][@tag['key']] = @tag['value']
Method end_element
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
if @section == :hosted_zone
case name
when 'Id'
@hosted_zone[name] = value.sub('/hostedzone/', '')
Method put_streaming_distribution_config
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def put_streaming_distribution_config(distribution_id, etag, options = {})
data = '<?xml version="1.0" encoding="UTF-8"?>'
data << "<StreamingDistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"
for key, value in options
case value
Method put_distribution_config
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def put_distribution_config(distribution_id, etag, options = {})
data = '<?xml version="1.0" encoding="UTF-8"?>'
data << "<DistributionConfig xmlns=\"http://cloudfront.amazonaws.com/doc/#{@version}/\">"
for key, value in options
case value
Method create_stream
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_stream(options={})
stream_name = options.delete("StreamName")
shard_count = options.delete("ShardCount") || 1
stream_arn = "arn:aws:kinesis:#{@region}:#{@account_id}:stream/#{stream_name}"
Method create_image
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_image(instance_id, name, description, no_reboot = false, options = {})
params = {}
block_device_mappings = options[:block_device_mappings] || []
params.merge!Fog::AWS.indexed_param('BlockDeviceMapping.%d.DeviceName', block_device_mappings.map{|mapping| mapping['DeviceName']})
params.merge!Fog::AWS.indexed_param('BlockDeviceMapping.%d.NoDevice', block_device_mappings.map{|mapping| mapping['NoDevice']})
Method authorize_db_security_group_ingress
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def authorize_db_security_group_ingress(name, opts = {})
unless opts.key?('CIDRIP') || ((opts.key?('EC2SecurityGroupName') || opts.key?('EC2SecurityGroupId')) && opts.key?('EC2SecurityGroupOwnerId'))
raise ArgumentError, 'Must specify CIDRIP, or one of EC2SecurityGroupName or EC2SecurityGroupId, and EC2SecurityGroupOwnerId'
end
Method create_cluster
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create_cluster(params={})
response = Excon::Response.new
response.status = 200
params.has_key?('clusterName') || params['clusterName'] = 'default'
Method attributes_to_params
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def attributes_to_params
options = {
'AllocatedStorage' => allocated_storage,
'AutoMinorVersionUpgrade' => auto_minor_version_upgrade,
'AvailabilityZone' => availability_zone,
Method end_element
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'AwsAccountNumber'
@response['StreamingDistributionConfig']['TrustedSigners'] << @value
when 'Bucket', 'Prefix'
Method request
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def request(params)
refresh_credentials_if_expired
idempotent = params.delete(:idempotent)
parser = params.delete(:parser)
expects = params.delete(:expects) || 200
Method end_element
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def end_element(name)
case name
when 'AwsAccountNumber'
@response['DistributionConfig']['TrustedSigners'] << value
when 'Bucket', 'Prefix'