Showing 110 of 152 total issues
Method run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def run
filter_list = config[:exclude_tags].split(/}\s?{/).map do |x|
x.gsub(/[{}]/, '')
end
filter_list = filter_list.map do |y|
- 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 54 lines of code (exceeds 25 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] == ''
Method run
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
warning = 3
critical = 4
result_launched = ''
result_terminated = ''
Method run
has a Cognitive Complexity of 16 (exceeds 5 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'),
- 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 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
event_instances = []
aws_config = {}
aws_regions = ec2_regions
Method run
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
begin
s3 = Aws::S3::Client.new(aws_config)
list_buckets = s3.list_buckets
Method run
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
aws_config = {}
if (config[:key_name].nil? && config[:key_prefix].nil?) || (!config[:key_name].nil? && !config[:key_prefix].nil?)
critical 'Need one option between "key_name" and "key_prefix"'
Consider simplifying this complex logical expression. Open
if config[:complaint_crit] > 0 && config[:complaint_crit] <= complaints || \
config[:reject_crit] > 0 && config[:reject_crit] <= rejects || \
config[:bounce_crit] > 0 && config[:bounce_crit] <= bounces || \
config[:low_delivery_crit] > 0 && config[:low_delivery_crit] > bounces || \
config[:delivery_crit] > 0 && config[:delivery_crit] <= bounces
Consider simplifying this complex logical expression. Open
elsif config[:complaint_warn] > 0 && config[:complaint_warn] <= complaints || \
config[:reject_warn] > 0 && config[:reject_warn] <= rejects || \
config[:bounce_warn] > 0 && config[:bounce_warn] <= bounces || \
config[:low_delivery_warn] > 0 && config[:low_delivery_warn] > bounces || \
config[:delivery_warn] > 0 && config[:delivery_warn] <= bounces
Method run
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
errors = []
volume_filters = Filter.parse(config[:filter])
Method run
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
warning = 0
critical = 0
instance_in_service = 0
result = ''
Method run
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def run
service_limit_msg = []
begin
# Get all check IDs with category "service_limits"
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
ok_message = []
warning_message = []
critical_message = []
Method run
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def run
begin
aws_config
client = Aws::EC2::Client.new
- 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 check_health
has a Cognitive Complexity of 14 (exceeds 5 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,
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def run
# Converting the string into a hash.
filter_list = config[:exclude_tags].split(/}\s?{/).map do |x|
x.gsub(/[{}]/, '')
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 run
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def run
aws_config = {}
if config[:use_iam_role].nil?
aws_config[:access_key_id] = config[:aws_access_key]
aws_config[:secret_access_key] = config[:aws_secret_access_key]
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def run
elb = Aws::ElasticLoadBalancing::Client.new(aws_config)
begin
instance_health = elb.describe_instance_health(load_balancer_name: config[:load_balancer])
- 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 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
filter = Filter.parse(config[:filter])
options = if filter.empty?
{}
else
Method run
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
warning = 0
critical = 0
result = ''
if config[:load_balancer].nil?