Showing 739 of 12,579 total issues
Method batch_create_from_pinboard
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.batch_create_from_pinboard(observation_matrix_id, project_id, user_id, klass)
return false if observation_matrix_id.blank? || project_id.blank? || user_id.blank?
created = []
ObservationMatrixColumn.transaction do
begin
- 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 selected_headers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def selected_headers
retval = []
%w(ce co bc).each { |column|
group = @selected_column_names[column.to_sym]
group.each_key { |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"
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"
Further reading
Method create_simple_batch_load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_simple_batch_load
if params[:file] && digested_cookie_exists?(params[:file].tempfile, :batch_collecting_events_md5)
@result = BatchLoad::Import::CollectingEvent.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 destroy_redirect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def destroy_redirect(object, **args)
back_location = (request.referer || root_path)
unless object.persisted?
begin
- 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 index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def index
respond_to do |format|
format.html {
redirect_to hub_path, notice: 'You requested a papertrail for nothing.' and return if params[:object_type].blank?
klass = whitelist_constantize(params.require(:object_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"
Further reading
Method result_message
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def result_message
case fixed
when :fix_not_triggered
'fix available, but not triggered'
when :no_fix_available
- 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 global_identifiers_facet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def global_identifiers_facet
return nil if global_identifiers.nil?
a = nil
if global_identifiers
- 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 classification_types
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def classification_types
return [] if taxon_name_classification_set.empty?
t = []
taxon_name_classification_set.each do |i|
- 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 duplicate_with_locks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def duplicate_with_locks
n = QuickVerbatimResponse.new(form_params)
# nullify if not locked
#
n.repository = nil if !locked?('repository')
- 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 autocomplete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def autocomplete
queries = [
autocomplete_exact_id,
autocomplete_identifier_identifier_exact,
autocomplete_identifier_cached_like,
- 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_bibtex_batch_load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_bibtex_batch_load
file = params.require(:file)
redirect_to batch_load_sources_path, notice: 'no file has been selected' and return if file.blank?
sha256 = Digest::SHA256.file(file.tempfile)
if cookies[:batch_sources_md5] == sha256.hexdigest
- 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 preview_bibtex_batch_load
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def preview_bibtex_batch_load
file = params.require(:file)
redirect_to batch_load_sources_path, notice: 'No file has been selected.' and return if file.blank?
file_ok, mimetype = Utilities::Files.recognized_batch_file_type?(file.tempfile)
if !file_ok
- 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 7 (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::SequenceRelationships::PrimersInterpreter.new(**batch_params)
if @result.create!
flash[:notice] = "Successfully proccessed file, #{@result.total_records_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 meta
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def meta
return @meta if @meta
@meta = Tempfile.new('meta.xml')
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def create_simple_batch_load
if params[:file] && digested_cookie_exists?(params[:file].tempfile, :Simple_namespaces_md5)
@result = BatchLoad::Import::Namespaces::SimpleInterpreter.new(**batch_params)
if @result.create
flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} namespaces 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 term_facet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def term_facet
return nil if term.blank?
w = '%' + term.gsub(/\s+/, '%') + '%'
if term_exact
- 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 local_identifiers_facet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def local_identifiers_facet
return nil if local_identifiers.nil?
a = nil
if local_identifiers
- 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 global_identifiers_facet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def global_identifiers_facet
return nil if global_identifiers.nil?
a = nil
if global_identifiers
- 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_sequences
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_sequences
@total_data_lines = 0;
sequences = {}
sequence_values = {}
- 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"