Method indented_child_options
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def indented_child_options type, parent, depth=0, selected_id
result = []
unless parent.children.empty?
parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
- 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 ontology_select_tag_old
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def ontology_select_tag_old form, type, root_id, element_id, selected_id=nil, html_options={}
Method ontology_editor_display
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ontology_editor_display type, root_id=nil, selected_id=nil
# login users can edit new defined assay/technology types
# only admin can edit/delete new defined assay/technology types
show_edit = false
- 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 child_select_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def child_select_options parent, depth=0
result = []
unless parent.children.empty?
parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
result << ["---"*depth + child.title, child.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"