Showing 12,634 of 12,634 total issues
Method dwc_event_date
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dwc_event_date
return unless collecting_event
%w{start_date end_date}
.map { |d| %w{year month day}
- 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 source_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def source_tag(source)
return nil if source.nil?
# TODO: sanitize should happen at the model validation level, not here!
source.cached ? sanitize(source.cached, tags: ['i']).html_safe : (source.new_record? ? nil : 'ERROR - Source cache not set, please notify admin.')
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 show
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show
@distribution = []
if params[:otu_id]
@otu = Otu.where(project_id: sessions_current_project_id).find(params[:otu_id])
elsif params[:taxon_name_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 create_primers_batch_load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_primers_batch_load
if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Primers_sequences_md5)
@result = BatchLoad::Import::Sequences::PrimersInterpreter.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 create_castor_batch_load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_castor_batch_load
if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Castor_collecting_events_md5)
@result = BatchLoad::Import::CollectingEvents::CastorInterpreter.new(**batch_params)
if @result.create
flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} collecting events 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
next_sqed_depiction = @sqed_depiction
if @sqed_depiction.depiction.depiction_object.update(collection_object_params)
flash[:notice] = 'Successfully updated'
- 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 collecting_event_identifiers_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def collecting_event_identifiers_tag(collecting_event)
return nil if collecting_event.nil?
if i = collecting_event.identifiers.load.first
collecting_event.identifiers.limit(10).collect{|j|
content_tag(:span, j.cached, class: [ :feedback, 'feedback-thin', 'feedback-secondary' ])
- 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 batch_data_created_td
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def batch_data_created_td(rp)
content_tag :td do
content_tag :table do
rp.objects.collect { |klass, objs|
content_tag(:tr, content_tag(:td, klass), class: 'underlined_elements') +
- 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 include_continuous_matrix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def include_continuous_matrix(options = {})
opt = {target: '', descriptors: []}.merge!(options)
xml = Builder::XmlMarkup.new(target: opt[:target])
m = opt[:observation_matrix]
- 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 repository_usage_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def repository_usage_tag(repository)
total_in_project = repository.collection_objects.where(collection_objects: {project_id: sessions_current_project_id}).count
total_current_in_project = repository.current_collection_objects.where(collection_objects: {project_id: sessions_current_project_id}).count
total = (repository.respond_to?(:use_count) ? repository.use_count : repository.collection_objects.count)
- 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 container_location
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def container_location(object)
return nil if !object.containable?
parts = []
object.enclosing_containers.each do |c|
s = c.name.blank? ? c.class.class_name : c.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 paper_repositories
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def paper_repositories(entry_item)
return nil if entry_item.object_class != 'Protonym' || !entry_item.is_first || !entry_item.object.is_species_rank?
types = entry_item.object.get_primary_type
repositories = []
if types.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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create
# can't use project_params here because :create_with_current_user param will be rejected
# (as it should, it's a one off that shouldn't be accepted anywhere else)
create_with_current_user = params.dig(:project, :create_with_current_user)
- 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_simple_batch_load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_simple_batch_load
if params[:file] && digested_cookie_exists?(
params[:file].tempfile,
:batch_collection_objects_md5)
@result = BatchLoad::Import::CollectionObjects.new(**batch_params.merge(user_map))
- 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 annotator_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.annotator_params
h = nil
if i = included_annotator_facets
# Setup with the first
a = i.shift
- 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 build_otus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_otus
@total_data_lines = 0
i = 0
# loop through rows
- 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 predicate_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def predicate_data
return @predicate_data if @predicate_data
# if no predicate data found, return empty file
if used_predicates.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 collection_object_by_identifier
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def collection_object_by_identifier(columns)
r = BatchLoad::ColumnResolver::Result.new
# find a namespace (ns1) with a short_name of row[headers[0]] (id1)
# find a collection_object which has an identifier which has a namespace (ns1), and a cached of
- 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"