app/helpers/type_materials/catalog_helper.rb
Method has too many lines. [31/25] Open
Open
def type_material_catalog_label(type_material, verbose = false) # Possibly parameterize biocurations: true, repository: true, identifiers: true
t = type_material
if t.nil? && verbose # Anticipate rendering in paper
return '[TODO: Add type material]'
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method type_material_catalog_label
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def type_material_catalog_label(type_material, verbose = false) # Possibly parameterize biocurations: true, repository: true, identifiers: true
t = type_material
if t.nil? && verbose # Anticipate rendering in paper
return '[TODO: Add type material]'
- 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 type_material_catalog_label
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def type_material_catalog_label(type_material, verbose = false) # Possibly parameterize biocurations: true, repository: true, identifiers: true
t = type_material
if t.nil? && verbose # Anticipate rendering in paper
return '[TODO: Add type material]'
Method type_material_collecting_event_label
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def type_material_collecting_event_label(collecting_event, verbose = false)
missing = '[TODO: A document (preferred) or verbatim label in a collecting event must be provided]'
if ce = collecting_event
if ce.document_label
return ::Utilities::Strings.linearize(ce.document_label)
- 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
TODO found Open
Open
# TODO: add verbose warning when missing any identifier
- Exclude checks
TODO found Open
Open
# TODO: move to collection object catalog helper when that is developed
- Exclude checks
TODO found Open
Open
# TODO: we should, perhaps, drive this off dwc_occurrence
- Exclude checks
TODO found Open
Open
v.push '[TODO: Repository NOT PROVIDED]'
- Exclude checks
TODO found Open
Open
return '[TODO: Add type material]'
- Exclude checks
TODO found Open
Open
# TODO: add option(?) to render all identifiers
- Exclude checks
TODO found Open
Open
missing = '[TODO: A document (preferred) or verbatim label in a collecting event must be provided]'
- Exclude checks