SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

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

    def self.generate(taxon_name)
      ::CSV.generate(col_sep: "\t") do |csv|

        csv << %w{
          global_id
Severity: Minor
Found in lib/export/basic_nomenclature.rb - About 1 hr to fix

    Method similar_labels has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def similar_labels
        retval = {}
        start_date = similar_params[:start_date]
        end_date = similar_params[:end_date]
        piece = similar_params[:piece]

      Method build_image_hash has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def build_image_hash
          #    if !otu_filter.blank? || !row_filter.blank?
          #      img_ids = observation_depictions_from_otu_filter.pluck(:image_id).uniq
          #    else
          #      img_ids = observation_matrix.observation_depictions.pluck(:image_id).uniq
      Severity: Minor
      Found in lib/tools/image_matrix.rb - About 1 hr to fix

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

              def autocomplete
                queries = [
                  autocomplete_internal_exact_key_value,
                  autocomplete_import_exact_key_value,
                  autocomplete_internal_exact_key_wildcard_value,
        Severity: Major
        Found in lib/queries/data_attribute/autocomplete.rb and 1 other location - About 1 hr to fix
        lib/queries/note/autocomplete.rb on lines 49..74

        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 58.

        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 create
            @loan_item = LoanItem.new(loan_item_params)
            respond_to do |format|
              if @loan_item.save
                format.html {redirect_back(fallback_location: (request.referer || root_path), notice: 'Loan item was successfully created.')}
        Severity: Major
        Found in app/controllers/loan_items_controller.rb and 1 other location - About 1 hr to fix
        app/controllers/biocuration_classifications_controller.rb on lines 16..24

        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 58.

        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 create
            @biocuration_classification = BiocurationClassification.new(biocuration_classification_params)
            respond_to do |format|
              if @biocuration_classification.save
                format.html { redirect_back(fallback_location: (request.referer || root_path), notice: 'Biocuration classification was successfully created.')}
        Severity: Major
        Found in app/controllers/biocuration_classifications_controller.rb and 1 other location - About 1 hr to fix
        app/controllers/loan_items_controller.rb on lines 44..52

        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 58.

        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 autocomplete
                queries = [
                  autocomplete_exact_note,
                  autocomplete_wildcard_end,
                  autocomplete_wildcard_wrapped,
        Severity: Major
        Found in lib/queries/note/autocomplete.rb and 1 other location - About 1 hr to fix
        lib/queries/data_attribute/autocomplete.rb on lines 66..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 58.

        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 4 locations. Consider refactoring.
        Open

        const ActionFunctions = {
          [ActionNames.CreateDepiction]: createDepiction,
          [ActionNames.CreateNewColumn]: createNewColumn,
          [ActionNames.CreateObservation]: createObservation,
          [ActionNames.LoadObservationMatrix]: loadObservationMatrix,
        app/javascript/vue/tasks/interactive_keys/store/mutations/mutations.js on lines 17..24
        app/javascript/vue/tasks/observation_matrices/matrix_column_coder/MatrixColumnCoder/CodeColumn/populateRows.js on lines 11..18
        app/javascript/vue/tasks/uniquify/people/store/mutations/mutations.js on lines 17..24

        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 62.

        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 4 locations. Consider refactoring.
        Open

        const MutationFunctions = {
          [MutationNames.SetDescriptorsFilter]: setDescriptorsFilter,
          [MutationNames.SetObservationMatrix]: setObservationMatrix,
          [MutationNames.SetObservationMatrixDescriptors]: setObservationMatrixDescriptors,
          [MutationNames.SetSettings]: setSettings,
        app/javascript/vue/tasks/observation_matrices/image/store/actions/actions.js on lines 9..16
        app/javascript/vue/tasks/observation_matrices/matrix_column_coder/MatrixColumnCoder/CodeColumn/populateRows.js on lines 11..18
        app/javascript/vue/tasks/uniquify/people/store/mutations/mutations.js on lines 17..24

        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 62.

        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 4 locations. Consider refactoring.
        Open

        const MutationFunctions = {
          [MutationNames.AddPersonToFoundList]: addPersonToFoundList,
          [MutationNames.SetFoundPeople]: setFoundPeople,
          [MutationNames.SetMatchPeople]: setMatchPeople,
          [MutationNames.SetMergePeople]: setMergePeople,
        app/javascript/vue/tasks/interactive_keys/store/mutations/mutations.js on lines 17..24
        app/javascript/vue/tasks/observation_matrices/image/store/actions/actions.js on lines 9..16
        app/javascript/vue/tasks/observation_matrices/matrix_column_coder/MatrixColumnCoder/CodeColumn/populateRows.js on lines 11..18

        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 62.

        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 4 locations. Consider refactoring.
        Open

        const adaptPayload = {
          [ComponentNames.Continuous]: setupContinuosPayload,
          [ComponentNames.Sample]: setupSamplePayload,
          [ComponentNames.FreeText]: setupFreeTextPayload,
          [ComponentNames.Presence]: setupPresencePayload,
        app/javascript/vue/tasks/interactive_keys/store/mutations/mutations.js on lines 17..24
        app/javascript/vue/tasks/observation_matrices/image/store/actions/actions.js on lines 9..16
        app/javascript/vue/tasks/uniquify/people/store/mutations/mutations.js on lines 17..24

        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 62.

        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

            roles_attributes: {
              id: Number,
              _destroy: Boolean,
              type: String,
              person_id: Number,
        Severity: Major
        Found in app/javascript/vue/routes/endpoints/TaxonDetermination.js and 1 other location - About 1 hr to fix
        app/javascript/vue/routes/endpoints/Attribution.js on lines 13..26

        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 62.

        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

            roles_attributes: {
              id: Number,
              _destroy: Boolean,
              type: String,
              person_id: Number,
        Severity: Major
        Found in app/javascript/vue/routes/endpoints/Attribution.js and 1 other location - About 1 hr to fix
        app/javascript/vue/routes/endpoints/TaxonDetermination.js on lines 14..27

        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 62.

        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

        export {
          DestroyDataset,
          GetDataset,
          GetImports,
          GetDatasetRecords,
        Severity: Major
        Found in app/javascript/vue/tasks/dwca_import/request/resources.js and 1 other location - About 1 hr to fix
        app/javascript/vue/tasks/collection_objects/slide_breakdown/request/resource.js on lines 35..48

        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 62.

        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

        export {
          GetImage,
          GetSledImage,
          GetCollectingEvent,
          GetRepository,
        app/javascript/vue/tasks/dwca_import/request/resources.js on lines 48..61

        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 62.

        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 default has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default async function () {
          const promises = []
        
          const createObjects = async () => {
            if (

          Function listAdapter has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function listAdapter(result) {
            return result.map((item) => ({
              id: item.id,
              globalId: item.global_id,
              subjectId: item.subject.id,

            Method build_protonyms has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def build_protonyms
                  if name_collection.nil?
                    @file_errors.push 'No names were readable in the file.'
                    return
                  end
            Severity: Minor
            Found in lib/batch_load/import/taxonifi_to_taxonworks.rb - About 1 hr to fix

              Method collection_object_params has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def collection_object_params
                  params.require(:collection_object).permit(
                    :total, :preparation_type_id, :repository_id, :current_repository_id,
                    :ranged_lot_category_id, :collecting_event_id,
                    :buffered_collecting_event, :buffered_determinations,
              Severity: Minor
              Found in app/controllers/collection_objects_controller.rb - About 1 hr to fix

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

                  def create
                    @citation = Citation.new(citation_params)
                    respond_to do |format|
                      if @citation.save
                        format.html {redirect_to url_for(@citation.citation_object.metamorphosize), notice: 'Citation was successfully created.'}
                Severity: Major
                Found in app/controllers/citations_controller.rb and 1 other location - About 1 hr to fix
                app/controllers/confidences_controller.rb on lines 38..48

                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 57.

                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

                Severity
                Category
                Status
                Source
                Language