Method update_card_array_attribute
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def update_card_array_attribute(current_board, card, opt)
values = opt.eql?(:+) ? options.add : options.remove
key = values.shift
if key.eql? 'participants'
- 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 operate_on_card
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def operate_on_card(current_board, card_id_or_title, card_id = card_id_or_title)
card = Kood::Card.find_by_partial_id_or_title!(card_id_or_title)
copy_card(card) if options.copy.present?
delete_card(card_id) if options.key? 'delete'
- 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 card
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def card(card_id_or_title = nil)
Kood::Board.current!.with_context do |current_board|
card_title = card_id = card_id_or_title
# If no arguments and options are specified, display all existing cards
- 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 print_card
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def print_card(board, card)
# The board's table may not use all terminal's horizontal space. In order to keep
# things visually similar / aligned, the card table should have the same width.
width = Kood::Table.new(board.list_ids.size).width
- 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"