Showing 28 of 49 total issues
Method run
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def run
# create arrays to hold failures
queue_list = queue_list_builder(config[:queue])
exclude_list = queue_list_builder(config[:exclude])
missing = if config[:regex]
- 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 35 (exceeds 5 allowed). Consider refactoring. Open
def run
queue_list = queue_list_builder(config[:queue])
exclude_list = queue_list_builder(config[:exclude])
# create arrays to hold failures
missing = if config[:regex]
- 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 28 (exceeds 5 allowed). Consider refactoring. Open
def run
rabbitmq = acquire_rabbitmq_info
# monitor counts in each queue or monitor the total number of messages in the system
if config[:queuelevel]
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
def run
timestamp = Time.now.to_i
acquire_rabbitmq_info(:queues).each do |queue|
# The queue might be reported by the API but its metrics somehow
# "corrupted". In this case, it doesn't have the ``backing_queue_status``
- 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 generate_output
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def generate_output
if @crit.empty? && @warn.empty?
ok
elsif !@crit.empty?
@message_output = "\n" + 'critical:' + "\n" + @crit.join("\n") if config[:pretty]
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
def run
@crit = []
@warn = []
rabbitmq = acquire_rabbitmq_info
queues = rabbitmq.method_missing('queues/' + config[:vhost])
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
def run
timestamp = Time.now.to_i
acquire_rabbitmq_info(:exchanges).each do |exchange|
if config[:filter]
next unless exchange['name'].match(config[:filter])
- 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 node_healthy?
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def node_healthy?
host = config[:host]
port = config[:port]
username = config[:username]
password = config[:password]
Method node_healthy?
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def node_healthy?
host = config[:host]
port = config[:port]
username = config[:username]
password = config[:password]
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
def run
@crits = []
queues = get_queues config
- 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 cluster_healthy?
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def cluster_healthy?
host = config[:host]
port = config[:port]
ssl = config[:ssl]
verify_ssl = config[:verify_ssl_off]
- 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 #rubocop:disable all
timestamp = Time.now.to_i
rabbitmq = acquire_rabbitmq_info
overview = rabbitmq.overview
- 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 cluster_healthy?
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cluster_healthy?
host = config[:host]
port = config[:port]
ssl = config[:ssl]
verify_ssl = config[:verify_ssl_off]
Method run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def run
warn_queues = {}
crit_queues = {}
acquire_rabbitmq_queues.each do |queue|
- 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 vhost_alive?
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def vhost_alive?
host = config[:host]
port = config[:port]
vhost = config[:vhost]
ssl = config[:ssl]
Method vhost_alive?
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def vhost_alive?
if config[:ini]
ini = IniFile.load(config[:ini])
section = ini['auth']
username = section['username']
Method run
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
queue_list = queue_list_builder(config[:queue])
exclude_list = queue_list_builder(config[:exclude])
# create arrays to hold failures
missing = if config[:regex]
Method run
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run
# create arrays to hold failures
queue_list = queue_list_builder(config[:queue])
exclude_list = queue_list_builder(config[:exclude])
missing = if config[:regex]
Method assign_alerts
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def assign_alerts(queue_name, total)
if config[:below]
@crit << "#{queue_name}:#{total}" if total <= config[:critical].to_i
@warn << "#{queue_name}:#{total}" if total <= config[:warn].to_i && total > config[:critical].to_i
else
- 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 add_common_options
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_common_options
option :host,
description: 'RabbitMQ management API host',
long: '--host HOST',
default: 'localhost'