SpeciesFileGroup/taxonworks

View on GitHub

Showing 740 of 12,584 total issues

Function init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
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')
Severity: Minor
Found in app/javascript/vue/initializers/SmartSelector/main.js - About 1 hr to fix

    Function handleClickCategoryFilter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function handleClickCategoryFilter(e) {
        const element = e.target
        const elementFilter = element.getAttribute('data-filter-category')
        const activated = element.classList.contains('activated')
        const allBtns = [
    Severity: Minor
    Found in app/assets/javascripts/views/hub/filterHub.js - About 1 hr to fix

      Function useScroll has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function useScroll (elementRef) {
        const scroll = reactive({
          x: 0,
          y: 0
        })
      Severity: Minor
      Found in app/javascript/vue/composables/useScroll.js - About 1 hr to fix

        Function createPages has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createPages(
          labels,
          maxColumns,
          maxRows,
          divisor,

          Function addToPinboard has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            addToPinboard(object) {
              const insertedItem = this.getInsertedPin(object)
              const pinboardItemElement = this.createPinboardItem(object)
              let sectionElement = document.querySelector(
                `[data-pinboard-section="${object.pinned_object_section}"]`
          Severity: Minor
          Found in app/assets/javascripts/workbench/pinboard.js - About 1 hr to fix

            Method syncronize_otus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            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
            Severity: Minor
            Found in app/models/taxon_name/otu_syncronization.rb - About 1 hr to fix

              Method related_summary has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def related_summary(ids)
                    h = { restrict: {}, destroy: {} }
                    objects = self.where(id: ids)
              
                    base = self.table_name.to_sym
              Severity: Minor
              Found in app/models/concerns/shared/is_data.rb - About 1 hr to fix

                Method api_index has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                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')
                
                
                Severity: Minor
                Found in app/controllers/biological_associations_controller.rb - About 1 hr to fix

                  Method otu_content_params has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def otu_content_params
                      { observation_matrix: @observation_matrix,
                        target: '',
                        include_otus: 'true',
                        include_collection_objects: 'false',
                  Severity: Minor
                  Found in app/controllers/observation_matrices_controller.rb - About 1 hr to fix

                    Method drawn_georeferences has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def drawn_georeferences
                        message = ''
                        value = params['gr_geographic_item_attributes_shape']
                        if value.blank?
                          @georeferences = Georeference.where('false')
                    Severity: Minor
                    Found in app/controllers/tasks/gis/match_georeference_controller.rb - About 1 hr to fix

                      Method drawn_collecting_events has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def drawn_collecting_events
                          message = ''
                          value = params['ce_geographic_item_attributes_shape']
                          if value.blank?
                            @collecting_events = CollectingEvent.where('false')
                      Severity: Minor
                      Found in app/controllers/tasks/gis/match_georeference_controller.rb - About 1 hr to fix

                        Method batch_create_match_georeferences has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        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
                        Severity: Minor
                        Found in app/controllers/tasks/gis/match_georeference_controller.rb - About 1 hr to fix

                          Method autocomplete has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def autocomplete
                                  return [] if query_string.blank?
                          
                                  queries = [
                                    autocomplete_recipient_email,
                          Severity: Minor
                          Found in lib/queries/loan/autocomplete.rb - About 1 hr to fix

                            Method initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  def initialize(query_params = {})
                                    super
                            
                                    @active_after_year = params[:active_after_year]
                                    @active_before_year = params[:active_before_year]
                            Severity: Minor
                            Found in lib/queries/person/filter.rb - About 1 hr to fix

                              Method data_class_summary has 26 lines of code (exceeds 25 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])
                              Severity: Minor
                              Found in app/controllers/administration_controller.rb - About 1 hr to fix

                                Method build_otus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def build_otus
                                      @total_data_lines = 0
                                      i = 0
                                
                                      # loop through rows
                                Severity: Minor
                                Found in lib/batch_load/import/otus/identifiers_interpreter.rb - About 1 hr to fix

                                  Method build_descriptors has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def build_descriptors
                                        i = 0 
                                        csv.each do |row|
                                          parse_result = BatchLoad::RowParse.new
                                  
                                  
                                  Severity: Minor
                                  Found in lib/batch_load/import/descriptors/qualitative_interpreter.rb - About 1 hr to fix

                                    Method generate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def self.generate(otus, project_members, reference_csv = nil )
                                        ::CSV.generate(col_sep: "\t") do |csv|
                                    
                                          csv << %w{ 
                                            taxonID
                                    Severity: Minor
                                    Found in lib/export/coldp/files/description.rb - About 1 hr to fix

                                      Method target_scope has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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
                                      Severity: Minor
                                      Found in lib/queries/biological_association/filter.rb - About 1 hr to fix

                                        Method to_s_verbose has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def to_s_verbose
                                            d = data
                                            str = ''
                                        
                                            d.keys.sort{|a,b| (a || 'zzz') <=> (b || 'zzz')}.each do |c|
                                        Severity: Minor
                                        Found in lib/catalog/distribution/entry.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language