Showing 740 of 12,584 total issues
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init(element) {
const model = element.getAttribute('data-smart-selector-model')
const target = element.getAttribute('data-smart-selector-target')
const klass = element.getAttribute('data-smart-selector-klass')
const fieldObject = element.getAttribute('data-smart-selector-field-object')
Function handleClickCategoryFilter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleClickCategoryFilter(e) {
const element = e.target
const elementFilter = element.getAttribute('data-filter-category')
const activated = element.classList.contains('activated')
const allBtns = [
Function useScroll
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useScroll (elementRef) {
const scroll = reactive({
x: 0,
y: 0
})
Function createPages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createPages(
labels,
maxColumns,
maxRows,
divisor,
Function addToPinboard
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addToPinboard(object) {
const insertedItem = this.getInsertedPin(object)
const pinboardItemElement = this.createPinboardItem(object)
let sectionElement = document.querySelector(
`[data-pinboard-section="${object.pinned_object_section}"]`
Method syncronize_otus
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def syncronize_otus(taxon_name_id: nil, user_id: nil, mode: :all_valid)
return false if mode.nil? || taxon_name_id.nil? || user_id.nil?
t = TaxonName.find(taxon_name_id)
i = 0
names = case mode
Method related_summary
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def related_summary(ids)
h = { restrict: {}, destroy: {} }
objects = self.where(id: ids)
base = self.table_name.to_sym
Method api_index
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def api_index
q = ::Queries::BiologicalAssociation::Filter.new(params.merge!(api: true)).all
.where(project_id: sessions_current_project_id)
.order('biological_associations.id')
Method otu_content_params
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def otu_content_params
{ observation_matrix: @observation_matrix,
target: '',
include_otus: 'true',
include_collection_objects: 'false',
Method drawn_georeferences
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def drawn_georeferences
message = ''
value = params['gr_geographic_item_attributes_shape']
if value.blank?
@georeferences = Georeference.where('false')
Method drawn_collecting_events
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def drawn_collecting_events
message = ''
value = params['ce_geographic_item_attributes_shape']
if value.blank?
@collecting_events = CollectingEvent.where('false')
Method batch_create_match_georeferences
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def batch_create_match_georeferences
message = ''
respond_to do |format|
format.json {
# we want to repackage the checkmarks we get from the client side into an array of ids with which
Method autocomplete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def autocomplete
return [] if query_string.blank?
queries = [
autocomplete_recipient_email,
Method initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(query_params = {})
super
@active_after_year = params[:active_after_year]
@active_before_year = params[:active_before_year]
Method data_class_summary
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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])
Method build_otus
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_otus
@total_data_lines = 0
i = 0
# loop through rows
Method build_descriptors
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_descriptors
i = 0
csv.each do |row|
parse_result = BatchLoad::RowParse.new
Method generate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.generate(otus, project_members, reference_csv = nil )
::CSV.generate(col_sep: "\t") do |csv|
csv << %w{
taxonID
Method target_scope
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def target_scope(target = 'subject')
a = send((target + '_otu_query').to_sym)
b = send((target + '_collection_object_query').to_sym)
a_sql, b_sql = nil, nil
Method to_s_verbose
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def to_s_verbose
d = data
str = ''
d.keys.sort{|a,b| (a || 'zzz') <=> (b || 'zzz')}.each do |c|