SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

Class Import has 21 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Import

    # An index of all rows for which some data was present,
    # index is line number, points to a RowParse instance
    attr_accessor :processed_rows
Severity: Minor
Found in lib/batch_load/import.rb - About 2 hrs to fix

    Method build_sequence_relationships has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def build_sequence_relationships
          @total_data_lines = 0
          i = 0
          gene_descriptors = {}
          gene_attributes = {}
    Severity: Major
    Found in lib/batch_load/import/sequence_relationships/primers_interpreter.rb - About 2 hrs to fix

      Method significant_digits has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def self.significant_digits(number_string)
            # is there a decimal point?
            intg = ''
            decimal_point_zeros = ''
            mantissa = ''
      Severity: Major
      Found in lib/utilities/geo.rb - About 2 hrs to fix

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

          def sv_fix_specify_synonymy_type
            s = self.subject_taxon_name
            o = self.object_taxon_name
            subject_type = s.type_taxon_name
            object_type = o.type_taxon_name
        app/models/taxon_name_relationship/icnp/unaccepting/synonym.rb on lines 50..72

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

        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 sv_fix_specify_synonymy_type
            s = self.subject_taxon_name
            o = self.object_taxon_name
            subject_type = s.type_taxon_name
            object_type = o.type_taxon_name
        app/models/taxon_name_relationship/icn/unaccepting/synonym.rb on lines 52..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 82.

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

        const GetterNames = {
          GetRecent: 'getRecent',
          GetExtract: 'getExtract',
          GetIdentifiers: 'getIdentifiers',
          GetSettings: 'getSettings',
        app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/observation_matrices/image/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/otu/browse/store/actions/actionNames.js on lines 1..16
        app/javascript/vue/tasks/sources/new_source/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/sources/new_source/store/mutations/mutations.js on lines 16..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 78.

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

        const MutationNames = {
          AddGeoreference: 'addGeoreference',
          AddGeoreferenceToQueue: 'addGeoreferenceToQueue',
          SetCELabel: 'setCELabel',
          SetCollectingEvent: 'setCollectingEvent',
        app/javascript/vue/tasks/extracts/new_extract/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/observation_matrices/image/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/otu/browse/store/actions/actionNames.js on lines 1..16
        app/javascript/vue/tasks/sources/new_source/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/sources/new_source/store/mutations/mutations.js on lines 16..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 78.

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

        const ActionNames = {
          LoadBiologicalAssociations: 'loadBiologicalAssociations',
          LoadInformation: 'loadInformation',
          LoadCollectionObjects: 'loadCollectionObjects',
          LoadCollectingEvents: 'loadCollectingEvents',
        app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/extracts/new_extract/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/observation_matrices/image/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/sources/new_source/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/sources/new_source/store/mutations/mutations.js on lines 16..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 78.

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

        const GetterNames = {
          GetBibtexType: 'getBibtexType',
          GetDocumentations: 'getDocumentations',
          GetDocuments: 'getDocuments',
          GetLanguageId: 'getLanguageId',
        app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/extracts/new_extract/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/observation_matrices/image/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/otu/browse/store/actions/actionNames.js on lines 1..16
        app/javascript/vue/tasks/sources/new_source/store/mutations/mutations.js on lines 16..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 78.

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

        const MutationNames = {
          AddDocumentation: 'addDocumentation',
          SetDocumentation: 'setDocumentation',
          SetType: 'setType',
          SetVerbatim: 'setVerbatim',
        app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/extracts/new_extract/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/observation_matrices/image/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/otu/browse/store/actions/actionNames.js on lines 1..16
        app/javascript/vue/tasks/sources/new_source/store/getters/getters.js on lines 16..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 78.

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

        const MutationNames = {
          AddDepiction: 'addDepiction',
          AddNewColumn: 'addNewColumn',
          SetObservationMatrix: 'setObservationMatrix',
          SetObservations: 'setObservations',
        app/javascript/vue/tasks/collecting_events/new_collecting_event/store/mutations/mutations.js on lines 16..31
        app/javascript/vue/tasks/extracts/new_extract/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/otu/browse/store/actions/actionNames.js on lines 1..16
        app/javascript/vue/tasks/sources/new_source/store/getters/getters.js on lines 16..31
        app/javascript/vue/tasks/sources/new_source/store/mutations/mutations.js on lines 16..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 78.

        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

        File collecting_events_controller.rb has 256 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class CollectingEventsController < ApplicationController
          include DataControllerConfiguration::ProjectDataControllerConfiguration
        
          before_action :set_collecting_event, only: [:show, :edit, :update, :destroy, :card, :clone, :navigation]
          after_action -> { set_pagination_headers(:collecting_events) }, only: [:index, :api_index], if: :json_request?
        Severity: Minor
        Found in app/controllers/collecting_events_controller.rb - About 2 hrs to fix

          Method has too many lines. [29/25]
          Open

            def get_diffs_date version_new, version_old
              added_strings = []
              added_strings_indices = []
              deleted_strings = []
              deleted_strings_indices = []

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          Method has too many lines. [29/25]
          Open

            def update
              klass = whitelist_constantize(params.require(:object_type))
              @object = klass.find(params[:object_id])
          
              if invalid_object(@object)

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          Method has too many lines. [29/25]
          Open

            def save_selected
              selected = params[:selected]
              next_id  = next_collecting_event_id
              if selected.blank?
                message = 'Nothing to save.'

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          Method has too many lines. [29/25]
          Open

            def self.export_users(io, project)
              members = project.project_members.pluck(:user_id)
              conn = get_connection
          
              User.all.find_each do |user|
          Severity: Minor
          Found in lib/export/project_data/sql.rb by rubocop

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          Method has too many lines. [29/25]
          Open

              def predicate_data
                return @predicate_data if @predicate_data
          
                # if no predicate data found, return empty file
                if used_predicates.empty?
          Severity: Minor
          Found in lib/export/dwca/data.rb by rubocop

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

          Method has too many lines. [29/25]
          Open

            def self.parse_iso_date_str(date_str)
          
              full_pattern = %r{^
                    (?<year>[0-9]{4})(-(?<month>[0-9]{1,2}))?(-(?<day>[0-9]{1,2}))?  # Date in these formats: YYYY | YYYY-M(M)? | YYYY-M(M)?-D(D)?
                    (
          Severity: Minor
          Found in lib/utilities/dates.rb by rubocop

          This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

          export default function (observationData) {
            const observation = makeBaseObservation(observationData)
            return Object.assign(observation, {
              continuousValue: attemptGetContinuousValueFromData(),
              continuousUnit: observationData.continuous_unit || observationData.default_unit
          app/javascript/vue/tasks/observation_matrices/matrix_column_coder/helpers/makeContinuousObservation.js on lines 3..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 77.

          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 default function (observationData) {
            const observation = makeBaseObservation(observationData)
            return Object.assign(observation, {
              continuousValue: attemptGetContinuousValueFromData(),
              continuousUnit: observationData.continuous_unit || observationData.defaultUnit
          app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/helpers/makeContinuousObservation.js on lines 3..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 77.

          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