Method mark_best_candidate
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def mark_best_candidate(cursor, end_pos, state)
# if there was more than one, see which one can take us forward the most words
found_best = false
# if we're already at the end of the range, we're done
- 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 divide_up_dictionary_range
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def divide_up_dictionary_range(cursor, end_pos)
return to_enum(__method__, cursor, end_pos) unless block_given?
return if (end_pos - cursor.position) < min_word_span
state = EngineState.new(
- 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 divide_up_dictionary_range
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def divide_up_dictionary_range(cursor, end_pos)
return to_enum(__method__, cursor, end_pos) unless block_given?
return if (end_pos - cursor.position) < min_word_span
state = EngineState.new(
Method advance_to_plausible_word_boundary
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def advance_to_plausible_word_boundary(cursor, end_pos, state)
remaining = end_pos - (state.current + state.word_length)
pc = cursor.codepoint
chars = 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"