Method generate_output
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def generate_output(count)
output = {}
if @aggregate == :all
c = count['all']
if c[:num] then output['num'] = c[:num] 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 emit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def emit(tag, es, chain)
min = nil
max = nil
sum = 0
num = 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 countups
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def countups(tag, min, max, sum, num, sample)
if @aggregate == :all
tag = 'all'
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 generate_output
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_output(count)
output = {}
if @aggregate == :all
c = count['all']
if c[:num] then output['num'] = c[:num] end
Method emit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def emit(tag, es, chain)
min = nil
max = nil
sum = 0
num = 0
Method count_initialized
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def count_initialized(keys=nil)
# counts['tag'] = {:min => num, :max => num, :sum => num, :num => num [, :sample => [....]]}
if @aggregate == :all
if @percentiles
{'all' => {:min => nil, :max => nil, :sum => nil, :num => 0, :sample => []}}
- 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 countups
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def countups(tag, min, max, sum, num, sample)
Method configure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def configure(conf)
super
if @unit
@count_interval = case @unit
- 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"