Showing 630 of 1,221 total issues
Method invoke
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def invoke(params={})
response = Excon::Response.new
response.status = 200
response.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
Avoid deeply nested control flow statements. Open
Open
zone[:records][change[:type]][change_name] = {} if zone[:records][change[:type]][change_name].nil?
Avoid deeply nested control flow statements. Open
Open
action_performed = true unless zone[:records][change[:type]].delete(change_name).nil?
Method _request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _request(scheme, host, port, params, original_params, &block)
Consider simplifying this complex logical expression. Open
Open
if change_item[:alias_target]
# Accept either underscore or camel case for hash keys.
dns_name = change_item[:alias_target][:dns_name] || change_item[:alias_target][:DNSName]
hosted_zone_id = change_item[:alias_target][:hosted_zone_id] || change_item[:alias_target][:HostedZoneId] || AWS.hosted_zone_for_alias_target(dns_name)
evaluate_target_health = change_item[:alias_target][:evaluate_target_health] || change_item[:alias_target][:EvaluateTargetHealth] || false
Consider simplifying this complex logical expression. Open
Open
if (full_msg_error.has_key?('Message') || full_msg_error.has_key?('message')) &&
(error.response.headers.has_key?('x-amzn-ErrorType') || full_msg_error.has_key?('__type'))
matched_error = {
:code => full_msg_error['__type'] || error.response.headers['x-amzn-ErrorType'].split(':').first,
:message => full_msg_error['Message'] || full_msg_error['message']
Consider simplifying this complex logical expression. Open
Open
if availability_zone && (size || options['SnapshotId'])
snapshot = self.data[:snapshots][options['SnapshotId']]
if options['SnapshotId'] && !snapshot
raise Fog::AWS::Compute::NotFound.new("The snapshot '#{options['SnapshotId']}' does not exist.")
end
Consider simplifying this complex logical expression. Open
Open
if ((instance && address) || (instance && !params[:allocation_id].nil?) || (!params[:allocation_id].nil? && !network_interface_id.nil?))
if !params[:allocation_id].nil?
allocation_ip = describe_addresses( 'allocation-id' => "#{params[:allocation_id]}").body['addressesSet'].first
if !allocation_ip.nil?
public_ip = allocation_ip['publicIp']
Method update_inbound_rule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def update_inbound_rule(rule_number, protocol, rule_action, cidr_block, options = {})
Method update_outbound_rule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def update_outbound_rule(rule_number, protocol, rule_action, cidr_block, options = {})
Method add_inbound_rule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_inbound_rule(rule_number, protocol, rule_action, cidr_block, options = {})
Method add_outbound_rule
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def add_outbound_rule(rule_number, protocol, rule_action, cidr_block, options = {})
Method _request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _request(body, headers, idempotent, parser, retries = 0)
Method _request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _request(body, headers, idempotent, parser, path)
Method upload_part_copy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def upload_part_copy(target_bucket_name, target_object_name, upload_id, part_number, options = {})
Method upload_part_copy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def upload_part_copy(target_bucket_name, target_object_name, upload_id, part_number, options = {})
Method copy_object
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {})
Method copy_object
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def copy_object(source_bucket_name, source_object_name, target_bucket_name, target_object_name, options = {})
Method assume_role
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def assume_role(role_session_name, role_arn, external_id=nil, policy=nil, duration=3600)
Method create_route
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_route(route_table_id, destination_cidr_block, internet_gateway_id=nil, instance_id=nil, network_interface_id=nil)