SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

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

    sel_all.click(function (event) {
      // find all the checkboxes in the 'matching_span' and set them to 'checked'
      // class is selectable_select
      for (var i = 0; i < selectable.length; i++) {
        selectable[i]['checked'] = true;
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 68..75
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 77..84
app/assets/javascripts/views/tasks/collecting_events/parse/lat_long/index.js on lines 67..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 72.

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

    des_all.click(function (event) {
      // find all the checkboxes in the 'matching_span' and set them to 'checked'
      // class is selectable_select
      for (var i = 0; i < selectable.length; i++) {
        selectable[i]['checked'] = false;
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 68..75
app/assets/javascripts/views/tasks/collecting_events/parse/lat_long/index.js on lines 58..65
app/assets/javascripts/views/tasks/collecting_events/parse/lat_long/index.js on lines 67..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 72.

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

    des_all.click(function (event) {
      // find all the checkboxes in the 'matching_span' and set them to 'checked'
      // class is selectable_select
      for (var i = 0; i < selectable.length; i++) {
        selectable[i]['checked'] = false;
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 68..75
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 77..84
app/assets/javascripts/views/tasks/collecting_events/parse/lat_long/index.js on lines 58..65

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

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

    sel_all.click(function (event) {
      // find all the checkboxes in the 'matching_span' and set them to 'checked'
      // class is selectable_select
      for (var i = 0; i < selectable.length; i++) {
        selectable[i]['checked'] = true;
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 77..84
app/assets/javascripts/views/tasks/collecting_events/parse/lat_long/index.js on lines 58..65
app/assets/javascripts/views/tasks/collecting_events/parse/lat_long/index.js on lines 67..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 72.

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

Method make_lat_long_matching_table has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def make_lat_long_matching_table(*pieces, collection)
    columns = ['CEID', 'Match', 'Verbatim Lat', 'Verbatim Long',
               'Decimal lat', 'Decimal long', 'Is georeferenced?', 'Select']

    thead = content_tag(:thead) do

    Method create_quick_verbatim has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.create_quick_verbatim(options  = {})
        # We could refactor this to use nested attributes, but it's not that much cleaner
        opts = {
          'collection_objects' => {},
          'note' => nil,
    Severity: Minor
    Found in lib/material.rb - About 1 hr to fix

      Method extract_params has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def extract_params
          params.require(:extract).permit(
            :repository_id,
            :verbatim_anatomical_origin,
            :year_made,
      Severity: Minor
      Found in app/controllers/extracts_controller.rb - About 1 hr to fix

        Method conform_significant has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def self.conform_significant(number, sig_digits)
              input = significant_digits(number.to_s)
              input_string = input[0]
              intg = input[2]
              decimal_point = input[3]
        Severity: Minor
        Found in lib/utilities/geo.rb - About 1 hr to fix

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

                if coordinates[:long_we].nil?
                  long_string = coordinates[:long_deg]
                  if coordinates[:long_deg].to_f < 0
                    coordinates[:long_we] = 'W'
                    coordinates[:long_deg] = coordinates[:long_deg].gsub('-', '')
          Severity: Major
          Found in lib/utilities/geo.rb and 1 other location - About 1 hr to fix
          lib/utilities/geo.rb on lines 708..721

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

          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

                if coordinates[:lat_ns].nil?
                  lat_string = coordinates[:lat_deg]
                  if coordinates[:lat_deg].to_f < 0 # -5° S; 5° N
                    coordinates[:lat_ns] = 'S'
                    coordinates[:lat_deg] = coordinates[:lat_deg].gsub('-', '')
          Severity: Major
          Found in lib/utilities/geo.rb and 1 other location - About 1 hr to fix
          lib/utilities/geo.rb on lines 722..735

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

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

          export function makeCollectingEvent (ceData = {}) {
            return {
              id: ceData.id,
              globalId: ceData.global_id,
              printLabel: ceData.print_label,
          Severity: Minor
          Found in app/javascript/vue/adapters/makeCollectingEvent.js - About 1 hr to fix

            Method observations_set has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def observations_set(query)
                    o = ::Observation.arel_table
            
                    # Descriptors on OTUs scored
                    f = 'descriptors_scored_for_otus'
            Severity: Minor
            Found in lib/queries/taxon_name/tabular.rb - About 1 hr to fix

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

              const ActionFunctions = {
                [ActionNames.LoadCitations]: loadCitations,
                [ActionNames.LoadOtuByProxy]: loadOtuByProxy,
                [ActionNames.LoadSource]: loadSource,
                [ActionNames.UpdateCitation]: updateCitation,
              app/javascript/vue/tasks/collection_objects/slide_breakdown/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/interactive_keys/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/actions/actions.js on lines 10..18
              app/javascript/vue/tasks/uniquify/people/store/getters/getters.js on lines 19..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 71.

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

              const GetterFunctions = {
                [GetterNames.GetDescriptorsFilter]: getDescriptorsFilter,
                [GetterNames.GetObservationMatrix]: getObservationMatrix,
                [GetterNames.GetObservationMatrixDescriptors]: getObservationMatrixDescriptors,
                [GetterNames.GetSettings]: getSettings,
              app/javascript/vue/tasks/collection_objects/slide_breakdown/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/nomenclature/by_source/store/actions/actions.js on lines 10..18
              app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/actions/actions.js on lines 10..18
              app/javascript/vue/tasks/uniquify/people/store/getters/getters.js on lines 19..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 71.

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

              const ActionFunctions = {
                [ActionNames.LoadColumns]: loadColumn,
                [ActionNames.LoadObservations]: loadObservations,
                [ActionNames.LoadUnits]: loadUnits,
                [ActionNames.SaveObservationsFor]: saveObservationsFor,
              app/javascript/vue/tasks/collection_objects/slide_breakdown/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/interactive_keys/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/nomenclature/by_source/store/actions/actions.js on lines 10..18
              app/javascript/vue/tasks/uniquify/people/store/getters/getters.js on lines 19..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 71.

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

              const GetterFunctions = {
                [GetterNames.GetSledImage]: getSledImage,
                [GetterNames.GetIdentifier]: getIdentifier,
                [GetterNames.GetCollectionObject]: getCollectionObject,
                [GetterNames.GetImage]: getImage,
              app/javascript/vue/tasks/interactive_keys/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/nomenclature/by_source/store/actions/actions.js on lines 10..18
              app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/actions/actions.js on lines 10..18
              app/javascript/vue/tasks/uniquify/people/store/getters/getters.js on lines 19..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 71.

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

              const GetterFunctions = {
                [GetterNames.GetFoundPeopleList]: getFoundPeopleList,
                [GetterNames.GetMatchPeople]: getMatchPeople,
                [GetterNames.GetMergePeople]: getMergePeople,
                [GetterNames.GetRequestState]: getRequestState,
              app/javascript/vue/tasks/collection_objects/slide_breakdown/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/interactive_keys/store/getters/getters.js on lines 19..27
              app/javascript/vue/tasks/nomenclature/by_source/store/actions/actions.js on lines 10..18
              app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/actions/actions.js on lines 10..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 71.

              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

                  removeItem (item) {
                    this.destroy(`/${this.type}/${item.id}`, item).then(response => {
                      this.removeFromList(item.id)
                    })
                  },
              app/javascript/vue/components/radials/annotator/components/annotatorExtend.js on lines 57..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 71.

              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

                  removeItem (item) {
                    this.destroy(`/${this.type}/${item.id}`, item).then(response => {
                      this.removeFromList(item.id)
                    })
                  },
              app/javascript/vue/components/radials/navigation/components/radialObjectExtend.js on lines 51..55

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

              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 const SLICE = {
                data_attributes: dataAttributes,
                biological_associations: biologicalAssociations,
                asserted_distributions: assertedDistributions,
                common_names: commonNames,
              app/javascript/vue/components/radials/annotator/constants/slices.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 71.

              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