Method fancy_multiselect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def fancy_multiselect object, association, options = {}
if options[:project_possibilities] && options[:other_projects_checkbox]
type = object.class.name.underscore
default_checked = Seek::Config.is_virtualliver ? true : false
check_box_and_alternative_list = "".html_safe
- 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 fancy_multiselect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fancy_multiselect object, association, options = {}
#skip if preview is disabled
return super if options.delete :preview_disabled
#skip if controller class does not define a preview method
- 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 fancy_multiselect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fancy_multiselect object, association, options = {}
if reflection = options[:object_class].reflect_on_association(association)
required_access = reflection.options[:required_access] || :can_view?
#get 'view' from :can_view?
- 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 fancy_multiselect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fancy_multiselect object, association, options = {}
options[:object_type_text] = options[:object_class].name.underscore.humanize unless options[:object_type_text]
with_new_link = options[:with_new_link] || false
object_type_text = options[:object_type_text]
object_type_text = (I18n.t 'biosamples.sample_parent_term').capitalize if object_type_text == 'Specimen'
- 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"