lib/trellohub/form/card.rb
Class Form
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Form
module Card
class << self
def valid_attributes
%i(
Method build_issue_attributes_by_card
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def build_issue_attributes_by_card
@issue_title = card_name_without_prefix
@issue_state = @state = @origin_card.closed ? 'closed' : 'open'
if @origin_card.desc =~ key_matcher
- 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 build_card_attributes_by_card
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def build_card_attributes_by_card
list = Trellohub::List.find_by(id: @origin_card.idList)
@card_list_name = list.name if list
@card_members = @origin_card.idMembers.map { |member_id|
- 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"