lib/tailor/rulers/indentation_spaces_ruler.rb
Class IndentationSpacesRuler
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class IndentationSpacesRuler < Tailor::Ruler
def initialize(config, options)
super(config, options)
add_lexer_observers(
:comment,
Method ignored_nl_update
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def ignored_nl_update(current_lexed_line, lineno, column)
log "indent reasons on entry: #{@manager.indent_reasons}"
if current_lexed_line.only_spaces?
log 'Line of only spaces. Moving on.'
- 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 comment_update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def comment_update(token, lexed_line, file_text, lineno, column)
Method tstring_end_update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def tstring_end_update(current_line)
unless @tstring_nesting.empty?
tstring_start_line = @tstring_nesting.pop
if tstring_start_line < current_line
- 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"