Showing 110 of 152 total issues
Method run
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
Aws.config.update(aws_config)
client = Aws::EC2::Client.new
if config[:eni].empty?
Method run
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
instances = []
if config[:db_cluster_id]
db_cluster_writer_id = find_db_cluster_writer(config[:db_cluster_id])
instances << find_db_instance(db_cluster_writer_id)
Method run
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
begin
aws_region = config[:aws_region].nil? || config[:aws_region].empty? ? query_instance_region : config[:aws_region]
elb = RightAws::ElbInterface.new(config[:aws_access_key], config[:aws_secret_access_key],
logger: Logger.new('/dev/null'),
Method run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run
errors = []
ec2 = Aws::EC2::Client.new
dhcp_option_id = ec2.describe_vpcs(vpc_ids: [config[:vpc_id]]).vpcs[0].dhcp_options_id
- 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 run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run
Aws.config.update(aws_config)
client = Aws::EC2::Client.new
if config[:eni].empty?
- 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 run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run
# TODO: come back and refactor
elasticaches.describe_cache_clusters.cache_clusters.each do |elasticache| # rubocop:disable Metrics/BlockLength)
if elasticache.engine.include? 'redis'
if config[:statistic] == ''
- 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 run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
begin
aws_config
client = Aws::EC2::Client.new
Method run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
begin
aws_config
client = Aws::EC2::Client.new
Method run
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
filters = Filter.parse(config[:filter])
filters.push(
name: 'instance-state-name',
values: ['running']
Method run
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
if config[:statistic] == ''
default_statistic_per_metric = {
'Latency' => 'Average',
'RequestCount' => 'Sum',
Method composite_check
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def composite_check
numerator_metric_resp = get_metric(config[:numerator_metric_name])
denominator_metric_resp = get_metric(config[:denominator_metric_name])
## If the numerator is empty, then we see if there is a default. If there is a default
Method check_health
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_health(elb)
unhealthy_instances = {}
instance_health = if config[:instances]
@elb.describe_instance_health(
load_balancer_name: elb.load_balancer_name,
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
ses = Aws::SES::Client.new(aws_config)
begin
response = ses.get_send_statistics
Method run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run
tags = config[:tag_keys].split(',')
cloudfront = Aws::CloudFront::Client.new
missing_tags = []
cloudfront.list_distributions.distribution_list.items.each do |distribution|
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run
instances = []
if config[:db_cluster_id]
db_cluster_writer_id = find_db_cluster_writer(config[:db_cluster_id])
instances << find_db_instance(db_cluster_writer_id)
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def run
tags = config[:tag_keys].split(',')
s3 = Aws::S3::Client.new
missing_tags = []
s3.list_buckets.buckets.each do |bucket|
- 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 collect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def collect(instance)
message = "\n#{instance[:db_instance_identifier]}: "
@severities = {
critical: false,
warning: false
- 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 run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
service_healths = services_by_health(config[:cluster_name], config[:services], config[:primary_status])
unhealthy = []
unhealthy.concat(service_healths[:critical]) if service_healths.key? :critical
Method run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run
begin
client = Aws::EC2::Client.new(aws_config)
params = {
- 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 run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run
client = Aws::CloudWatch::Client.new
options = { state_value: config[:state] }
- 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"