Showing 12,634 of 12,634 total issues
Method sv_synonym_linked_to_valid_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_synonym_linked_to_valid_name
#synonyms and misspellings should be linked to valid names
if ::TAXON_NAME_RELATIONSHIP_NAMES_SYNONYM.include?(self.type_name)
obj = self.object_taxon_name
subj = self.subject_taxon_name
- 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_parent_rank
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_parent_rank
if self.rank_class && self.id == self.cached_valid_taxon_name_id
if rank_string == 'NomenclaturalRank' || self.parent&.rank_string == 'NomenclaturalRank' || !!self.iczn_uncertain_placement_relationship
true
elsif !self.rank_class&.valid_parents.include?(self.parent&.rank_string)
- 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 validate_object_and_subject_both_protonyms
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_object_and_subject_both_protonyms
if /TaxonNameRelationship::Combination::/.match(self.type)
errors.add(:object_taxon_name_id, 'Not a Combination') if object_taxon_name.type != 'Combination'
else
errors.add(:object_taxon_name_id, 'Not a Protonym') if object_taxon_name.type == 'Combination'
- 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 valid_gen_bank_accession_code
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def valid_gen_bank_accession_code
if identifier.present?
matched = false
if /\A[A-Z][A-Z][0-9]{6}\Z/.match(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 validate_number
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_number
t = self.collection_type.to_s
if self.number_of_collection_objects.nil? && self.number_of_containers.nil?
errors.add(:number_of_collection_objects, 'At least one number of specimens or number of containers should be specified')
errors.add(:number_of_containers, 'At least one number of specimens or number of containers should be specified')
- 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 member_syncronize_matrices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def member_syncronize_matrices
# TODO: refine to eliminate other possibilities
# Don't bother with the overhead if there are no matrices
if ObservationMatrix.where(project_id: project_id).any?
- 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_type_species
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_type_species
return true unless is_valid?
return true unless is_genus_rank?
list_of_coordinated_names.each do |t|
if self.type_species != t.type_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_type_genus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_type_genus
return true unless is_valid?
return true unless is_family_rank?
list_of_coordinated_names.each do |t|
if self.type_genus != t.type_genus
- 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 perform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def perform(import_dataset, uuid, max_time, max_records)
begin
Current.user_id = import_dataset.created_by_id
Current.project_id = import_dataset.project_id
- 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 annotators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def annotators
known = ApplicationRecord.subclasses.select {|a| a.column_names.include?('project_id')}.map(&:name)
known.each do |k|
next if k.safe_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 validate_indices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_indices
unless self.collection_type.blank?
ct = self.collection_type.to_sym
COLLECTION_PROFILE_INDICES[:Favret][ct].each_key do |a|
- 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_gender
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_gender
return true unless is_available?
return true unless is_genus_rank?
s = self.gender_class
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_validate_coordinated_names_part_of_speech
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sv_validate_coordinated_names_part_of_speech
return true unless is_available?
return true unless is_species_rank?
list_of_coordinated_names.each do |t|
if self.part_of_speech_class != t.part_of_speech_class
- 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 verbatim_map_center
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def verbatim_map_center(delta_z = 0.0)
retval = nil
unless verbatim_latitude.blank? or verbatim_longitude.blank?
lat = Utilities::Geo.degrees_minutes_seconds_to_decimal_degrees(verbatim_latitude.to_s)
long = Utilities::Geo.degrees_minutes_seconds_to_decimal_degrees(verbatim_longitude.to_s)
- 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 find_matching_otus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_matching_otus(names, match_otus_by_name, match_otus_by_taxon)
return {} if !match_otus_by_name && !match_otus_by_taxon
matches = {}
if match_otus_by_taxon
- 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 create_data_attributes_batch_load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_data_attributes_batch_load
if params[:file] && digested_cookie_exists?(params[:file].tempfile, :data_attributes_batch_load_otus_md5)
@result = BatchLoad::Import::Otus::DataAttributesInterpreter.new(**batch_params)
if @result.create
flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} TODO RECORD TYPES were created."
- 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 get_highlighted_words
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_highlighted_words words, highlighted_words, highlighted_words_indices, style_class
start_index = 0
end_index = 0
html_string = ''
- 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 count_info
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def count_info(count)
term = 'Collection object'
if count < 25
if count == 0
retval = "No #{term}s"
- 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 create_genbank_batch_load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_genbank_batch_load
if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Genbank_sequences_md5)
@result = BatchLoad::Import::Sequences::GenbankInterpreter.new(**batch_params)
if @result.create
flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} sequences were created."
- 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 similar_labels
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def similar_labels
retval = {}
start_date = similar_params[:start_date]
end_date = similar_params[:end_date]
piece = similar_params[:piece]
- 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"