Showing 732 of 12,569 total issues
Method nuke
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def nuke
known = ApplicationRecord.subclasses.select {|a| a.column_names.include?('project_id')}.map(&:name)
known.each do |k|
next if k.constantize.table_name == 'test_classes' # TODO: a kludge to ignore stubbed classes in testing
- 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 sv_primary_types
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_primary_types
if is_species_rank? && is_available?
if self.type_materials.primary.empty? && self.type_materials.syntypes.empty?
soft_validations.add(:base, 'Primary type is not selected')
elsif self.type_materials.primary.count > 1 || (!self.type_materials.primary.empty? && !self.type_materials.syntypes.empty?)
- 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 sv_fix_coordinated_names_source
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_source
fixed = false
pg = nil
return false unless self.source.nil?
list_of_coordinated_names.each do |t|
- 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 sv_fix_coordinated_names_original_subgenus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_original_subgenus
fixed = false
return false unless self.original_subgenus.nil?
list_of_coordinated_names.each do |t|
if !t.original_subgenus.nil?
- 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 nomenclature_code_matches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def nomenclature_code_matches
if taxon_name && type && nomenclature_code
tn = taxon_name.type == 'Combination' ? taxon_name.protonyms.last : taxon_name
nc = tn.rank_class.nomenclatural_code
errors.add(:taxon_name, "#{taxon_name.cached_html} belongs to #{taxon_name.rank_class.nomenclatural_code} nomenclatural code, but the status used from #{nomenclature_code} nomenclature code") if nomenclature_code != nc
- 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 basis
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def basis
case dwc_occurrence_object_type
when 'CollectionObject'
if dwc_occurrence_object.is_fossil?
return 'FossilSpecimen'
- 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 sv_validate_coordinated_names_page
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_page
return true unless is_valid?
s = self.origin_citation
list_of_coordinated_names.each do |t|
ts = t.origin_citation
- 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 set_dwc_occurrence
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_dwc_occurrence
retried = false
begin
if dwc_occurrence_persisted?
dwc_occurrence.generate_uuid_if_required # TODO: at some point when syncronized make this optional
- 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 sv_fix_coordinated_names_original_genus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_original_genus
fixed = false
return false unless self.original_genus.nil?
list_of_coordinated_names.each do |t|
if !t.original_genus.nil?
- 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 sv_fix_coordinated_names_type_species_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_type_species_type
sttnr = self.type_taxon_name_relationship
return false if sttnr.nil?
fixed = false
list_of_coordinated_names.each do |t|
- 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 using_lsid_class
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def using_lsid_class
unless identifier.nil?
lsid = identifier.split(':')
# this is a test of http://rubular.com/regexes/13295
/SID=([\s\S]*?)LSID=([\s\S]*?)Auth=([\s\S]*)/ =~ identifier
- 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 some_roles_present
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def some_roles_present
ATTRIBUTION_ROLES.each do |r|
return true if send("#{r}_roles".to_sym).any?
end
- 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 sv_fix_coordinated_names_etymology
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_etymology
fixed = false
return false unless self.etymology.blank?
list_of_coordinated_names.each do |t|
if !t.etymology.blank?
- 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 sv_fix_coordinated_names_original_variety
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_original_variety
fixed = false
return false unless self.original_variety.nil?
list_of_coordinated_names.each do |t|
if !t.original_variety.nil?
- 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 code_column
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.code_column(observation_matrix_column_id, observation_params)
c = ObservationMatrixColumn.find(observation_matrix_column_id)
o = ObservationMatrix.find(c.observation_matrix_id)
descriptor = c.descriptor
- 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 sv_fix_combination_relationship
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_combination_relationship
s = self.subject_taxon_name
list = s.list_of_coordinated_names + [s]
if s.rank_string =~ /Species/
s_new = list.detect{|t| t.rank_class.rank_name == 'species'}
- 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 sv_validate_coordinated_names_source
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_source
return true unless is_valid?
s = self.source
list_of_coordinated_names.each do |t|
if ((s && t.source && s.id != t.source.id) || (s.nil? && t.source))
- 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 descriptors_autocomplete_tag
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def descriptors_autocomplete_tag(descriptor, term = nil)
return nil if descriptor.nil?
if term
s = descriptor.name.gsub(/#{Regexp.escape(term)}/i, "<mark>#{term}</mark>")
- 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 history_in_taxon_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def history_in_taxon_name(t, c, i)
if c
a = history_author_year_tag(t)
b = source_author_year_tag(c.source)
- 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 history_statuses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def history_statuses(nomenclature_catalog_entry_item)
i = nomenclature_catalog_entry_item
s = i.base_object.taxon_name_classifications_for_statuses
return nil if (s.empty? || !i.is_first) # is_subsequent?
return nil if i.from_relationship?
- 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"