Showing 630 of 1,218 total issues
Method put_bucket_lifecycle
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def put_bucket_lifecycle(bucket_name, lifecycle)
builder = Nokogiri::XML::Builder.new do
LifecycleConfiguration {
lifecycle['Rules'].each do |rule|
Rule {
Method end_element
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_default_actions
case name
when 'member'
if @in_target_groups
Method end_element
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_description
case name
when 'value'
@response['description'] = value
Method end_element
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'member'
if @in_policy_names && @in_listeners
@listener_description['PolicyNames'] << 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 a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'amiLaunchIndex'
@instance[name] = value.to_i
when 'arn'
- 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_load_balancers
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def describe_load_balancers(options = {})
unless options.is_a?(Hash)
Fog::Logger.deprecation("describe_load_balancers with #{options.class} is deprecated, use all('LoadBalancerNames' => []) instead [light_black](#{caller.first})[/]")
options = { 'LoadBalancerNames' => [options].flatten }
end
- 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 revoke_db_security_group_ingress
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def revoke_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
- 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 get_bucket
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def get_bucket(bucket_name, options = {})
prefix, marker, delimiter, max_keys = \
options['prefix'], options['marker'], options['delimiter'], options['max-keys']
common_prefixes = []
- 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 request_spot_instances
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def request_spot_instances(image_id, instance_type, spot_price, options = {})
response = Excon::Response.new
id = Fog::AWS::Mock.spot_instance_request_id
if (image_id && instance_type && spot_price)
- 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_security_groups
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def describe_security_groups(filters = {})
unless filters.is_a?(Hash)
Fog::Logger.deprecation("describe_security_groups with #{filters.class} param is deprecated, use describe_security_groups('group-name' => []) instead [light_black](#{caller.first})[/]")
filters = {'group-name' => [*filters]}
end
Class Group
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Group < Fog::Model
identity :id, :aliases => 'AutoScalingGroupName'
attribute :arn, :aliases => 'AutoScalingGroupARN'
attribute :availability_zones, :aliases => 'AvailabilityZones'
attribute :created_at, :aliases => 'CreatedTime'
Method end_element
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
case name
when 'amiLaunchIndex'
@instance[name] = value.to_i
when 'architecture', 'clientToken', 'dnsName', 'hypervisor', 'imageId',
Method create_vpc
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_vpc(cidrBlock, options = {})
Excon::Response.new.tap do |response|
if cidrBlock
response.status = 200
vpc_id = Fog::AWS::Mock.vpc_id
Method create_function
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_function(params={})
response = Excon::Response.new
runtime = params.delete('Runtime') || 'nodejs'
if !%w(nodejs java8).include?(runtime)
Method end_element
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
if @in_tag_set
case name
when 'item'
@nic['tagSet'][@tag['key']] = @tag['value']
Method end_element
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def end_element(name)
super
case name
when *@contexts
@context.pop
Method create_network_interface
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_network_interface(subnetId, options = {})
response = Excon::Response.new
if subnetId
subnet = self.data[:subnets].find{ |s| s['subnetId'] == subnetId }
if subnet.nil?
Method run_task
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_task(params={})
response = Excon::Response.new
response.status = 200
unless task_def_id = params.delete('taskDefinition')
Method save
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def save(options = {})
requires :body, :directory, :key
if options != {}
Fog::Logger.deprecation("options param is deprecated, use acl= instead [light_black](#{caller.first})[/]")
end
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def end_element(name)
if @in_outputs
case name
when 'OutputKey', 'OutputValue', 'Description'
@output[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"