lib/export/coldp/files/vernacular_name.rb
Method has too many lines. [30/25] Open
Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
# TODO: Biocuration attributes on these two
# sex
- 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 generate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
# TODO: Biocuration attributes on these two
# sex
Method transliteration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.transliteration(common_name)
n = common_name.alternate_values.where(type: 'AlternateValue::Translation', alternate_value_object_attribute: :name).load
if n.any?
n.collect{|a| a.language.name == 'English' ? a.language.name : nil}.compact.join('; ')
else
- 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: Map to biocuration attribute via URI
- Exclude checks
TODO found Open
Open
# Not used internally within CoLDP, for reference only. TODO: confirm.
- Exclude checks
TODO found Open
Open
# TODO: Biocuration attributes on these two
- Exclude checks