Showing 732 of 12,572 total issues
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ({ commit, state }, args) {
const observation = getObservationFromArgs(state, args)
if (observation?.id) { return Promise.resolve() }
- 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
Function removeEmptyProperties
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function removeEmptyProperties(object) {
const obj = { ...object }
for (const key in obj) {
const value = obj[key]
- 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
Function default
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function ({ dispatch, state, commit }, { rowObjectId, rowObjectType }) {
const observations = state.observations.filter(o => o.isUnsaved)
return Promise.all(observations.map(o => {
if (isQualitativeObservation(o)) {
- 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_subspecies
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_original_subspecies
fixed = false
return false unless self.original_subspecies.nil?
list_of_coordinated_names.each do |t|
if !t.original_subspecies.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_orcid_class
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def using_orcid_class
unless identifier.nil?
orcid = identifier.upcase
/^(?<preamble>http[s]?:\/\/){0,1}(?<domain>orcid\.org\/){1}(?<part_1>\d{4})-(?<part_2>\d{4})-(?<part_3>\d{4})-(?<part_4>\d{3})(?<last>.)$/i =~ orcid
- 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 is_metadata_depiction?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def is_metadata_depiction?
if depiction_params && !depiction_params.empty?
a = depiction_params[:is_metadata_depiction]
((a == 'true') || (a == true)) ? true : false
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
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_subject_parent_update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_subject_parent_update
res = false
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 validate_name_format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.validate_name_format(taxon_name)
if !taxon_name.name.blank?
taxon_name.errors.add(:name, 'must be capitalized') unless taxon_name.name == taxon_name.name.capitalize
# TODO: this should be inherited/applied higher up?
- 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 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 validate_name_format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.validate_name_format(taxon_name)
taxon_name.errors.add(:name, 'name must be capitalized') unless !taxon_name.name.blank? && taxon_name.name == taxon_name.name.capitalize
taxon_name.errors.add(:name, 'name must be at least two letters') unless taxon_name.name.length > 1
taxon_name.errors.add(:name, 'name must not end in -virus') if (taxon_name.name =~ /.*virus\Z/) && taxon_name.name.length > 1
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_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 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_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 sv_family_is_invalid_no_substitute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_family_is_invalid_no_substitute
if persisted? && is_family_rank? && self.id == self.lowest_rank_coordinated_taxon.id
if !TaxonNameClassification.where_taxon_name(self).with_type_base('TaxonNameClassification::Iczn::Available::Invalid').empty?
if self.iczn_set_as_synonym_of.nil?
soft_validations.add(:base, 'Missing relationship: The name is invalid, but a substitute name is not selected')
- 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 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_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_type_specimen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sv_fix_coordinated_names_type_specimen
fixed = false
return false unless self.get_primary_type.empty?
list_of_coordinated_names.each do |t1|
types2 = t1.get_primary_type
- 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"