Showing 12,628 of 12,628 total issues
Avoid deeply nested control flow statements. Open
if new_index_new > version_new.length || version_old[new_index_old] == version_new[new_index_new]
if curr_index_new != new_index_new
added_strings.push(version_new[curr_index_new...new_index_new])
added_strings_indices.push(curr_index_new)
end
Avoid deeply nested control flow statements. Open
if feminine_name.blank?
soft_validations.add(:feminine_name, "The species name is marked as #{part_of_speech_name}, but the name spelling in feminine is not provided")
else
# e = species_questionable_ending(TaxonNameClassification::Latinized::Gender::Feminine, feminine_name)
# soft_validations.add(:feminine_name, "Name has a non feminine ending: -#{e}") unless e.nil?
Method nexml_depictions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def nexml_depictions(options = {})
opt = {target: '', descriptors: []}.merge!(options)
xml = Builder::XmlMarkup.new(target: opt[:target])
m = opt[:observation_matrix]
xml.depictions do
- 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 recursive_catalog_tag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def recursive_catalog_tag(taxon_name, data = { body: '', sources: [], supplementary_distribution: ::Catalog::Distribution::Entry.new([]), repositories: [], options: OPTIONS}, depth = 0 )
data[:body] << [
paper_header_prefix(taxon_name, data[:options]),
full_taxon_name_tag(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
Avoid deeply nested control flow statements. Open
name2 = self.cached_primary_homonym_alternative_spelling ? self.cached_primary_homonym_alternative_spelling : nil
Method cached_trigger_methods
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cached_trigger_methods(object)
k = object.class.base_class.name.to_sym
if cached_triggers[k]
cached_triggers[k]
elsif
- 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 object_tag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def object_tag(object)
return nil if object.nil?
method = object_tag_method(object)
# meh, exceptions
- 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 send_password_reset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def send_password_reset
if params[:email]
user = User.find_by_email(params[:email].downcase)
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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create
@georeference = Georeference::GeoLocate.new(georeference_params)
respond_to do |format|
if @georeference.save
format.html {
- 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 data_class_summary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def data_class_summary
@klass = params.require(:klass)&.safe_constantize
@time_span = params.require(:time_span)
@target = params.require(:target)
@projects = params[:project_id].blank? ? Project.all : Project.where(id: params[: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
Avoid deeply nested control flow statements. Open
r.error_messages << "Multiple OTUs matched the name '#{name}'." if r.multiple_matches?
Method matches?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def matches?(is_fixable, include_flagged = false)
a = is_fixable.nil? ? true : (is_fixable ? fixable? : true)
b = include_flagged == true ? true : !flagged
a && b
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 add_scopes_to_routes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_scopes_to_routes
scopes = ['scope :tasks']
scope_index = 0
@paths.each do |path|
- 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 nom_status_field
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.nom_status_field(taxon_name)
case taxon_name.type
when 'Combination'
nil # This is *not* 'chresonym' sensu CoL (which is this: [correct: 'Aus bus Smith 1920', chresonym: 'Aus bus Jones 1922'])
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
Avoid deeply nested control flow statements. Open
r.error_messages << "No OTU with name '#{name}' exists." if r.no_matches?
Method autocomplete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def autocomplete
queries = [
autocomplete_exact_cached,
autocomplete_exact_identifier,
autocomplete_matching_cached,
- 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 all_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def all_data
return @all_data if @all_data
Rails.logger.debug 'dwca_export: start combining all data'
- 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 with_parsed_date
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def with_parsed_date(t = :start)
if d = simple_date
r = []
r.push(table["#{t}_date_day".to_sym].eq(d.day)) if d.day
r.push(table["#{t}_date_month".to_sym].eq(d.month)) if d.month
- 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
Avoid deeply nested control flow statements. Open
if list.blank? # treat it like a taxon name
list = Otu.joins(:taxon_name)
.where(taxon_names: {cached: name}, project_id: proj_id)
.limit(2)
end
Method import_value_facet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def import_value_facet
return nil if data_attribute_import_exact_value.blank? && data_attribute_import_wildcard_value.blank?
a,b = nil, 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"