SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

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

  def initialize(params = {})
    super

    self.is_median_z    = false
    self.is_undefined_z = false # and delta_z is zero, or ignored
Severity: Minor
Found in app/models/georeference/verbatim_data.rb - About 1 hr to fix

    Method type_material_catalog_label has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def type_material_catalog_label(type_material, verbose = false) # Possibly parameterize biocurations: true, repository: true, identifiers: true
        t = type_material
    
        if t.nil? && verbose # Anticipate rendering in paper
          return '[TODO: Add type material]'
    Severity: Minor
    Found in app/helpers/type_materials/catalog_helper.rb - About 1 hr to fix

      Method update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def update
          next_id = next_collecting_event_id
          ce = current_collecting_event
          any_failed = false
          

        Method build_collection_objects has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

              def autocomplete
                t = Time.now
                return [] if query_string.blank?
                queries = [
                  [autocomplete_exact_id, nil ],
          Severity: Minor
          Found in lib/queries/repository/autocomplete.rb - About 1 hr to fix

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              def create
                @preparation_type = PreparationType.new(preparation_type_params)
            
                respond_to do |format|
                  if @preparation_type.save
            Severity: Major
            Found in app/controllers/preparation_types_controller.rb and 2 other locations - About 1 hr to fix
            app/controllers/namespaces_controller.rb on lines 38..47
            app/controllers/serials_controller.rb on lines 44..53

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              def create
                @serial = Serial.new(serial_params)
            
                respond_to do |format|
                  if @serial.save
            Severity: Major
            Found in app/controllers/serials_controller.rb and 2 other locations - About 1 hr to fix
            app/controllers/namespaces_controller.rb on lines 38..47
            app/controllers/preparation_types_controller.rb on lines 35..44

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              def create
                @namespace = Namespace.new(namespace_params)
            
                respond_to do |format|
                  if @namespace.save
            Severity: Major
            Found in app/controllers/namespaces_controller.rb and 2 other locations - About 1 hr to fix
            app/controllers/preparation_types_controller.rb on lines 35..44
            app/controllers/serials_controller.rb on lines 44..53

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              def next_object_by_inserted_keyword(object, keyword)
                return nil if keyword.nil? || object.nil?
                t = object.class.base_class.name.tableize
                base = object.class.base_class
                  .joins(:tags)
            Severity: Major
            Found in app/helpers/pinboard_items_helper.rb and 1 other location - About 1 hr to fix
            app/helpers/pinboard_items_helper.rb on lines 79..91

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              def previous_object_by_inserted_keyword(object, keyword)
                return nil if keyword.nil? || object.nil?
                t = object.class.base_class.name.tableize
                base = object.class.base_class
                  .joins(:tags)
            Severity: Major
            Found in app/helpers/pinboard_items_helper.rb and 1 other location - About 1 hr to fix
            app/helpers/pinboard_items_helper.rb on lines 63..75

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function initialize_autocomplete has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              initialize_autocomplete: function (form) {
                var autocomplete_input = form.find(".keyword_picker_autocomplete");
            
                autocomplete_input.autocomplete({
                  source: '/keywords/lookup_keyword',
            Severity: Minor
            Found in app/assets/javascripts/views/tags/tag_picker.js - About 1 hr to fix

              Function reset has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  reset() {
                    const boardStore = useBoardStore()
                    const tagStore = useTagStore()
                    const noteStore = useNoteStore()
                    const lock = useLockStore()

                Function makeFilterRequest has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const makeFilterRequest = (params = state.parameters) => {
                    const payload = removeEmptyParameters({
                      ...params
                    })
                
                
                Severity: Minor
                Found in app/javascript/vue/shared/Filter/composition/useFilter.js - About 1 hr to fix

                  Method sv_fix_add_nominotypical_sub has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def sv_fix_add_nominotypical_sub
                        return false if list_of_coordinated_names.collect{|r| r.id}.include?(parent_id)
                        rank  = rank_string
                        p     = self.parent
                        prank = p.rank_string
                  Severity: Minor
                  Found in app/models/protonym/soft_validation_extensions.rb - About 1 hr to fix

                    Method source_citation_totals has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def source_citation_totals(sources)
                        data = {}
                        max_total = 0
                    
                        Citation.related_klasses.each do |k|
                    Severity: Minor
                    Found in app/helpers/sources_helper.rb - About 1 hr to fix

                      Method otu has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def otu(columns)
                            r = BatchLoad::ColumnResolver::Result.new
                      
                            if columns['otu_id']
                              begin
                      Severity: Minor
                      Found in lib/batch_load/column_resolver.rb - About 1 hr to fix

                        Method generate has 30 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{
                                nameID
                        Severity: Minor
                        Found in lib/export/coldp/files/name_relation.rb - About 1 hr to fix

                          Method create has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def create
                                @create_attempted = true
                          
                                if ready_to_create?
                                  # TODO: DRY
                          Severity: Minor
                          Found in lib/batch_load/import.rb - About 1 hr to fix

                            Method generate has 30 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|
                            
                                  # TODO: Biocuration attributes on these two
                                  # sex
                            Severity: Minor
                            Found in lib/export/coldp/files/vernacular_name.rb - About 1 hr to fix

                              Method observation_params has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def observation_params
                                  params.require(:observation).permit(
                                    :character_state_id, :frequency,
                                    :continuous_value, :continuous_unit,
                                    :day_made,
                              Severity: Minor
                              Found in app/controllers/observations_controller.rb - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language