Showing 6 of 10 total issues
Method parse_cfstats
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def parse_cfstats
def get_metric(string) # rubocop:disable Lint/NestedMethodDefinition
string.strip!
(metric, value) = string.split(': ')
if metric.nil? || value.nil? # rubocop:disable Style/GuardClause
- 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 parse_info
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def parse_info
info = nodetool_cmd('info')
# #YELLOW
# TODO: come back and refactor me to be better
info.each_line do |line| # rubocop:disable Metrics/BlockLength
- 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 parse_info
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_info
info = nodetool_cmd('info')
# #YELLOW
# TODO: come back and refactor me to be better
info.each_line do |line| # rubocop:disable Metrics/BlockLength
Method parse_cfstats
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_cfstats
def get_metric(string) # rubocop:disable Lint/NestedMethodDefinition
string.strip!
(metric, value) = string.split(': ')
if metric.nil? || value.nil? # rubocop:disable Style/GuardClause
Method run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run
out, rc = nodetool_cmd('describecluster')
if rc != 0
critical(out)
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 parse_tpstats
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def parse_tpstats# rubocop:disable all
tpstats = nodetool_cmd('tpstats')
tpstats.each_line do |line|
next if line =~ /^Pool Name/
next if line =~ /^Message type/
- 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"