lib/export/coldp/files/name_relation.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|
csv << %w{
nameID
- 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|
csv << %w{
nameID
Method generate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
nameID
- 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: SupressedSynony misspelled in TW models, which probably should be SupressedSynonym
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
type = "type"
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
if tnr.type.include? "TaxonNameRelationship::Typification" # There are no nomen_uri's for Typification
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"