Showing 28 of 49 total issues
Method vhost_alive?
has 28 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 acquire_rabbitmq_info
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def acquire_rabbitmq_info(property = nil)
begin
if config[:ini]
ini = IniFile.load(config[:ini])
section = ini['auth']
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run #rubocop:disable all
timestamp = Time.now.to_i
rabbitmq = acquire_rabbitmq_info
overview = rabbitmq.overview
Method run
has 26 lines of code (exceeds 25 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]
Method return_condition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def return_condition(missing, critical, warning)
if critical.count > 0 || missing.count > 0
message = []
message << "Queues in critical state: #{critical.join(', ')}. " if critical.count > 0
message << "Queues missing: #{missing.join(', ')}" if missing.count > 0
- 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 return_condition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def return_condition(missing, critical, warning)
if critical.count > 0 || missing.count > 0
message = []
message << "Queues in critical state: #{critical.join(', ')}. " if critical.count > 0
message << "Queues missing: #{missing.join(', ')}" if missing.count > 0
- 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 acquire_rabbitmq_info
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def acquire_rabbitmq_info(property = nil)
begin
if config[:ini]
ini = IniFile.load(config[:ini])
section = ini['auth']
- 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 a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def vhost_alive?
host = config[:host]
port = config[:port]
vhost = config[:vhost]
ssl = config[:ssl]
- 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"