SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,628 of 12,628 total issues

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

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

        def create_simple_batch_load
          if params[:file] && digested_cookie_exists?(params[:file].tempfile, :batch_collecting_events_md5)
            @result = BatchLoad::Import::CollectingEvent.new(**batch_params)
            if @result.create
              flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} collecting events were created."
      Severity: Major
      Found in app/controllers/collecting_events_controller.rb and 2 other locations - About 1 hr to fix
      app/controllers/asserted_distributions_controller.rb on lines 140..153
      app/controllers/taxon_names_controller.rb on lines 173..186

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

      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_simple_batch_load
          if params[:file] && digested_cookie_exists?(params[:file].tempfile, :simple_taxon_names_md5)
            @result =  BatchLoad::Import::TaxonifiToTaxonworks.new(**batch_params)
            if @result.create
              flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} taxon names were created."
      Severity: Major
      Found in app/controllers/taxon_names_controller.rb and 2 other locations - About 1 hr to fix
      app/controllers/asserted_distributions_controller.rb on lines 140..153
      app/controllers/collecting_events_controller.rb on lines 184..197

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

      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_simple_batch_load
          if params[:file] && digested_cookie_exists?(params[:file].tempfile, :batch_asserted_distributions_md5)
            @result =  BatchLoad::Import::AssertedDistributions.new(**batch_params)
            if @result.create
              flash[:notice] = "Successfully proccessed file, #{@result.total_records_created} asserted distributions were created."
      Severity: Major
      Found in app/controllers/asserted_distributions_controller.rb and 2 other locations - About 1 hr to fix
      app/controllers/collecting_events_controller.rb on lines 184..197
      app/controllers/taxon_names_controller.rb on lines 173..186

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

      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

      Consider simplifying this complex logical expression.
      Open

          if (
            (page !== undefined &&
              state.datasetRecords[pagePosition] &&
              (state.datasetRecords[pagePosition].downloaded ||
                state.datasetRecords.rows)) ||

        Function createPages has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          labels,
          maxColumns,
          maxRows,
          divisor,
          cssStye,

          Consider simplifying this complex logical expression.
          Open

                if ($&.nil?) or
                    (isbn_10.nil? and isbn_13.nil?) or
                    ((isbn_10.nil? and type == '10') or (isbn_13.nil? and type == '13'))
                  errors.add(:identifier, "'#{identifier}' has the wrong number of digits.")
                  return
          Severity: Major
          Found in app/models/identifier/global/isbn.rb - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if !t.end_with?('us') &&
                    !t.end_with?('a') &&
                    !t.end_with?('um') &&
                    !t.end_with?('is') &&
                    !t.end_with?('e') &&

              Consider simplifying this complex logical expression.
              Open

                  if !t.end_with?('us') &&
                      !t.end_with?('a') &&
                      !t.end_with?('um') &&
                      !t.end_with?('is') &&
                      !t.end_with?('e') &&

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

                              dispatch(ActionNames.GetIdentifiers, {
                                id: coId,
                                type: COLLECTION_OBJECT
                              }).then((response) => {
                                if (response.length) {
                app/javascript/vue/tasks/digitize/store/actions/loadDigitalization.js on lines 23..31

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

                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

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

                function makeObservationArgs(observation) {
                  const args = {
                    descriptorId: observation.descriptorId,
                    observationId: observation.id || observation.internalId,
                    characterStateId: observation.characterStateId
                app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/actions/saveObservationsFor.js on lines 36..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 55.

                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

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

                              dispatch(ActionNames.GetIdentifiers, {
                                id: response.body.id,
                                type: CONTAINER
                              }).then((response) => {
                                if (response.length) {
                app/javascript/vue/tasks/digitize/store/actions/loadDigitalization.js on lines 42..50

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

                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

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

                export default function (observationData) {
                  const observation = makeBaseObservation(observationData)
                  return Object.assign(observation, {
                    description: observationData.description,
                    isChecked: !!observationData.id
                app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/helpers/makeFreeTextObservation.js on lines 3..9

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

                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

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

                function makeObservationArgs (observation) {
                  const args = {
                    descriptorId: observation.descriptorId,
                    observationId: observation.id || observation.internalId,
                    characterStateId: observation.characterStateId
                app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/actions/saveObservation.js on lines 54..62

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

                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

                  handleEvents() {
                    const element = document.querySelector('[data-panel-name="pinboard"]')
                
                    element.addEventListener('click', this.toggleSectionEvent)
                    element.addEventListener('click', this.removePinItemsFromSectionEvent)
                Severity: Major
                Found in app/assets/javascripts/workbench/pinboard.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/workbench/pinboard.js on lines 320..325

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

                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

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

                  const observation = state.observations
                    .find(o =>
                      o.rowObjectId === rowObjectId &&
                      o.rowObjectType === rowObjectType &&
                      o.characterStateId === characterStateId)
                app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/getters/getCharacterStateChecked.js on lines 9..13

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

                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

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

                export default function (observationData) {
                  const observation = makeBaseObservation(observationData)
                  return Object.assign(observation, {
                    description: observationData.description,
                    isChecked: !!observationData.id
                app/javascript/vue/tasks/observation_matrices/matrix_column_coder/helpers/makeFreeTextObservation.js on lines 3..9

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

                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

                  if (descriptor.componentName === ComponentNames.Qualitative) {
                    return state.observations.find(o => o.characterStateId === characterStateId && o.rowObjectId === rowObjectId && o.rowObjectType === rowObjectType)
                  } else if (descriptor.componentName === ComponentNames.Continuous) {
                    return state.observations.find(o => o.internalId === internalId && o.rowObjectId === rowObjectId && o.rowObjectType === rowObjectType)
                  } else if (descriptor.componentName === ComponentNames.Sample) {
                app/javascript/vue/tasks/observation_matrices/matrix_column_coder/helpers/getObservationFromArgs.js on lines 15..21
                app/javascript/vue/tasks/observation_matrices/matrix_column_coder/helpers/getObservationFromArgs.js on lines 17..21

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

                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

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

                    const observation = state.observations.find(o =>
                      o.rowObjectId === rowObjectId &&
                      o.rowObjectType === rowObjectType &&
                      o.characterStateId === characterStateId
                    )
                app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/mutations/setCharacterStateChecked.js on lines 12..16

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

                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