Showing 732 of 12,571 total issues
Method get_data_to_verify
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_data_to_verify
@collection_objects = []
- 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 type_material_collecting_event_label
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def type_material_collecting_event_label(collecting_event, verbose = false)
missing = '[TODO: A document (preferred) or verbatim label in a collecting event must be provided]'
if ce = collecting_event
if ce.document_label
return ::Utilities::Strings.linearize(ce.document_label)
- 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
user = User.find_by(email: params[:session][:email].downcase)
if user && user.authenticate(params[:session][:password])
unless user.is_flagged_for_password_reset?
- 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_nomen_batch_load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_nomen_batch_load
if params[:file] && digested_cookie_exists?(params[:file].tempfile, :nomen_taxon_names_md5)
@result = BatchLoad::Import::TaxonNames::NomenInterpreter.new(**batch_params)
if @result.create
flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} items 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 dwc_event_time
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dwc_event_time
return unless collecting_event
%w{start_time end_time}
.map { |t| %w{hour minute second}
- 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_history_statuses
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def paper_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 drawn_georeferences
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def drawn_georeferences
message = ''
value = params['gr_geographic_item_attributes_shape']
if value.blank?
@georeferences = Georeference.where('false')
- 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 lat_long_source
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def lat_long_source
if preferred_georeference
:georeference
elsif verbatim_latitude && verbatim_longitude
:verbatim
- 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 image_short_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def image_short_url(image, api: true)
if !image.kind_of?(::Image) && (Integer(image) rescue false)
image = ::Image.find(image)
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_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 metadata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def metadata
@object = GlobalID::Locator.locate(params.require(:global_id))
render(json: { success: false}, status: :not_found) if @object.nil?
render(json: { 'message' => 'Record not found' }, status: :unauthorized) and return if !@object.is_community? && @object.project_id != sessions_current_project_id
render(json: { 'message' => "#{@object.class} is not configured for THE GRAPH"}, status: :method_not_allowed) and return unless @object.class.const_defined?('GRAPH_ENTRY_POINTS')
- 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
respond_to do |format|
if collection_profile_params['force_update'] == '0'
flash['notice'] = 'Collection profile are not updatable unless forced, consider cloning this record or click force.'
render :edit and return
- 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 distribution
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def distribution
respond_to do |format|
format.json do
@cached_map_type = params[:cached_map_type] || 'CachedMapItem::WebLevel1'
@quicker_cached_map = @otu.quicker_cached_map(@cached_map_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 set_page_map_page
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_page_map_page(index, page)
return false if index.kind_of?(Array) && page.kind_of?(Array)
return false if !index.kind_of?(Array) && (index.to_i > page_total)
p = page_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 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 dwc_column
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dwc_column(dwc_occurrence)
return nil if dwc_occurrence.nil?
r = []
dwc_occurrence.dwc_occurrence_object.dwc_occurrence_attributes(false).each do |k, v|
- 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 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"