SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

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

    def self.generate(otus, project_members, reference_csv = nil )
        ::CSV.generate(col_sep: "\t") do |csv|
    
            csv << %w{
                taxonID
Severity: Minor
Found in lib/export/coldp/files/taxon_concept_relation.rb - About 1 hr to fix

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

      def field_occurrence_params
        params.require(:field_occurrence).permit(
          :total, :is_absent,
          :ranged_lot_category_id,
          :collecting_event_id,
    Severity: Minor
    Found in app/controllers/field_occurrences_controller.rb - About 1 hr to fix

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

        def self.elevation_regex_from_verbatim_label(text)
          text = ' ' + text.downcase.squish + ' '
          elevation = {}
      
          if (matchdata1 = text.match(/\D(\d*,?\d+)\s?[-–]\s?(\d*,?\d+) ?(m|ft|feet|meters)\.?\W/))
      Severity: Minor
      Found in lib/utilities/elevation.rb - About 1 hr to fix

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

          def initialize(
            observation_matrix_id: nil,
            project_id: nil,
            language_id: nil,
            keyword_ids: nil,
        Severity: Minor
        Found in lib/tools/interactive_key.rb - About 1 hr to fix

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

          const permitParams = {
            label: {
              text: String,
              total: Number,
              style: String,
          Severity: Major
          Found in app/javascript/vue/routes/endpoints/Label.js and 2 other locations - About 1 hr to fix
          app/javascript/vue/routes/endpoints/ContainerItem.js on lines 4..16
          app/javascript/vue/routes/endpoints/User.js on lines 4..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 59.

          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

          const permitParams = {
            user: {
              name: String,
              email: String,
              password: String,
          Severity: Major
          Found in app/javascript/vue/routes/endpoints/User.js and 2 other locations - About 1 hr to fix
          app/javascript/vue/routes/endpoints/ContainerItem.js on lines 4..16
          app/javascript/vue/routes/endpoints/Label.js on lines 3..15

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

          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

            return (
              extract.id
                ? Extract.update(extract.id, { extract: payload, extend })
                : Extract.create({ extract: payload, extend })
            ).then(({ body }) => {
          app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/saveCollectingEvent.js on lines 30..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 59.

          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

            return (
              collectingEvent.id
                ? CollectingEvent.update(collectingEvent.id, {
                    collecting_event: collectingEvent,
                    extend
          app/javascript/vue/tasks/extracts/new_extract/store/actions/saveExtract.js on lines 15..37

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

          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 (type === ComponentNames.Continuous) {
                return state.observations.filter(
                  (o) =>
                    o.type === ObservationTypes.Continuous &&
                    o.rowObjectId === rowObjectId &&
          app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/actions/removeObservation.js on lines 96..103

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

          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

          const permitParams = {
            container_item: {
              global_entity: String,
              contained_object_id: Number,
              contained_object_type: String,
          Severity: Major
          Found in app/javascript/vue/routes/endpoints/ContainerItem.js and 2 other locations - About 1 hr to fix
          app/javascript/vue/routes/endpoints/Label.js on lines 3..15
          app/javascript/vue/routes/endpoints/User.js on lines 4..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 59.

          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

              } else if (type === ComponentNames.Sample) {
                return state.observations.filter(
                  (o) =>
                    o.type === ObservationTypes.Sample &&
                    o.rowObjectId === rowObjectId &&
          app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/actions/removeObservation.js on lines 89..103

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

          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 destroy
              @observation_matrix_column_item.destroy
              respond_to do |format|
                if @observation_matrix_column_item.destroyed?
                  format.html {
          app/controllers/observation_matrix_row_items_controller.rb on lines 61..70

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

          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
              @taxon_name_relationship = TaxonNameRelationship.new(taxon_name_relationship_params)
          
              respond_to do |format|
                if @taxon_name_relationship.save
          Severity: Major
          Found in app/controllers/taxon_name_relationships_controller.rb and 1 other location - About 1 hr to fix
          app/controllers/collection_objects_controller.rb on lines 212..221

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

          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
              @collection_object = CollectionObject.new(collection_object_params)
          
              respond_to do |format|
                if @collection_object.save
          Severity: Major
          Found in app/controllers/collection_objects_controller.rb and 1 other location - About 1 hr to fix
          app/controllers/taxon_name_relationships_controller.rb on lines 40..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 53.

          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 destroy
              @observation_matrix_row_item.destroy
              respond_to do |format|
                if @observation_matrix_row_item.destroyed?
                  format.html { redirect_to observation_matrix_row_items_url,
          Severity: Major
          Found in app/controllers/observation_matrix_row_items_controller.rb and 1 other location - About 1 hr to fix
          app/controllers/observation_matrix_column_items_controller.rb on lines 60..70

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

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

          export function listParser(result) {
            return result.map((item) => ({
              id: item.id,
              global_id: item.global_id,
              subject_taxonomy_order: parseRank(item.subject?.taxonomy?.order),

            Function initContextMenus has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function initContextMenus() {
                $.contextMenu('destroy', ".contextMenuCells");
                $.contextMenu({
                  selector: '.contextMenuCells',
                  autoHide: true,
            Severity: Minor
            Found in app/assets/javascripts/views/shared/lists.js - About 1 hr to fix

              Function save has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  save({ objectId, objectType }) {
                    this.citations.forEach((item) => {
                      if (item._destroy) {
                        this.remove(item)
                      }

                Function makeInitialState has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const makeInitialState = () => {
                  return {
                    settings: {
                      isLoading: false,
                      lock: {
                Severity: Minor
                Found in app/javascript/vue/tasks/extracts/new_extract/store/store.js - About 1 hr to fix

                  Function showchildren has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  CarrouselTask.prototype.showchildren = function (childIndex) {
                    var count = 0
                  
                    if (typeof childIndex !== 'undefined') {
                      if (childIndex > this.active.length - this.maxCards) {
                  Severity: Minor
                  Found in app/assets/javascripts/views/hub/task-filter.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language