Method aggregate_cell_values
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def aggregate_cell_values(row_or_column, meth, aggregate)
values = {}
#calculate values for all cells that do not span accross multiple cells
#this ensures that we don't have a problem if the first line includes
- 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 natural_widths
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def natural_widths
#calculate natural column width for all rows that do not include a span dummy
@cells.each do |cell|
unless has_a_span_dummy?(cell.row)
@widths_by_column[cell.column] =
- 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 aggregate_cell_values
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def aggregate_cell_values(row_or_column, meth, aggregate)
values = {}
#calculate values for all cells that do not span accross multiple cells
#this ensures that we don't have a problem if the first line includes
Method fill_values_if_needed
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fill_values_if_needed(values, cell, index, meth)
#have all spanned indices been filled with a value?
#e.g. values[0], values[1] and values[2] don't return nil given a index of 0 and a colspan of 3
number_of_nil_values = 0
cell.colspan.times do |i|
- 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 natural_widths
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def natural_widths
#calculate natural column width for all rows that do not include a span dummy
@cells.each do |cell|
unless has_a_span_dummy?(cell.row)
@widths_by_column[cell.column] =