Showing 630 of 1,221 total issues
Method create_mount_target
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_mount_target(file_system_id, subnet_id, options={})
response = Excon::Response.new
default_security_group = mock_compute.data[:security_groups].find do |_, sg|
sg['groupDescription'] == 'default_elb security group'
end
Method get_user
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_user(username = nil, options = {})
response = Excon::Response.new
user_body = nil
if username.nil? # show current user
Method bootstrap
has 32 lines of code (exceeds 25 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
Method end_element
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'Name', 'Value'
@dimension[name] = value
when 'Period', 'EvaluationPeriods'
Method end_element
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@vpc['tagSet'][@tag['key']] = @tag['value']
Method describe_orderable_db_instance_options
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_orderable_db_instance_options(engine=nil, opts={})
instance_options = []
response = Excon::Response.new
if engine
(opts[:db_instance_class] || %w(db.m2.xlarge db.m1.large)).each do |size|
Method put_bucket_versioning
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def put_bucket_versioning(bucket_name, status)
response = Excon::Response.new
bucket = self.data[:buckets][bucket_name]
if bucket
Method parse_security_group_options
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.parse_security_group_options(group_name, options)
options ||= Hash.new
if group_name.is_a?(Hash)
options = group_name
elsif group_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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'AvailabilityZone', 'ClusterIdentifier', 'ClusterStatus', 'ClusterSubnetGroupName', 'DBName',
'MasterUsername', 'ModifyStatus', 'PreferredMaintenanceWindow', 'VpcId'
@cluster[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 _setup_bootstrap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _setup_bootstrap(server)
unless server.key_name
# first or create fog_#{credential} keypair
name = Fog.respond_to?(:credential) && Fog.credential || :default
unless server.key_pair = service.key_pairs.get("fog_#{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 delete_multiple_objects
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def delete_multiple_objects(bucket_name, object_names, options = {})
headers = options.dup
data = "<Delete>"
data << "<Quiet>true</Quiet>" if headers.delete(:quiet)
version_ids = headers.delete('versionId')
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
super
case name
when 'clusterName', 'clusterArn', 'status'
@cluster[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 list_keys
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def list_keys(options={})
limit = options[:limit]
marker = options[:marker]
if limit
- 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_policy
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_load_balancer_policy(lb_name, name, type_name, attributes = {})
if load_balancer = self.data[:load_balancers][lb_name]
raise Fog::AWS::ELB::DuplicatePolicyName, name if policy = load_balancer['Policies']['Proper'].find { |p| p['PolicyName'] == name }
raise Fog::AWS::ELB::PolicyTypeNotFound, type_name unless policy_type = self.data[:policy_types].find { |pt| pt['PolicyTypeName'] == type_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 start_task
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def start_task(params={})
response = Excon::Response.new
response.status = 200
unless task_def_id = params.delete('taskDefinition')
- 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_account_password_policy
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_account_password_policy(minimum_password_length, max_password_age, password_reuse_prevention,require_symbols,require_numbers,require_uppercase_characters, require_lowercase_characters,allow_users_to_change_password, hard_expiry, expire_passwords)
Method request_spot_instances
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def request_spot_instances(image_id, instance_type, spot_price, options = {})
if block_device_mapping = options.delete('LaunchSpecification.BlockDeviceMapping')
block_device_mapping.each_with_index do |mapping, index|
for key, value in mapping
options.merge!({ format("LaunchSpecification.BlockDeviceMapping.%d.#{key}", index) => 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 update_account_password_policy
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_account_password_policy(minimum_password_length, max_password_age, password_reuse_prevention,require_symbols,require_numbers,require_uppercase_characters, require_lowercase_characters,allow_users_to_change_password, hard_expiry, expire_passwords)
Method list_policies
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def list_policies(options={})
limit = options['MaxItems']
marker = options['Marker']
if limit
- 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 domain_metadata
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def domain_metadata(domain_name)
response = Excon::Response.new
if domain = self.data[:domains][domain_name]
response.status = 200
- 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"