SpeciesFileGroup/taxonworks

View on GitHub

Showing 1,084 of 12,572 total issues

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

  def batch_update
    if c = CollectionObject.batch_update(
        preview: params[:preview],
        collection_object: collection_object_params.merge(by: sessions_current_user_id),
        collection_object_query: params[:collection_object_query])
Severity: Major
Found in app/controllers/collection_objects_controller.rb and 4 other locations - About 35 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 117..126
app/controllers/biological_associations_controller.rb on lines 153..161
app/controllers/collecting_events_controller.rb on lines 128..136
app/controllers/otus_controller.rb on lines 254..263

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

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

        b.each do |q|
          j = ::ObservationMatrixRow.joins(:collection_object).where(otu: q.limit(50).pluck(:id)).order('observation_matrix_rows.position')
          c = j.where(observation_matrix_id: observation_matrix_id) if observation_matrix_id
          c ||= j
          updated_queries.push c
Severity: Minor
Found in lib/queries/observation_matrix_row/autocomplete.rb and 1 other location - About 35 mins to fix
lib/queries/observation_matrix_row/autocomplete.rb on lines 23..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 34.

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

  def batch_update
    if r = CollectingEvent.batch_update(
        preview: params[:preview],
        collecting_event: collecting_event_params.merge(by: sessions_current_user_id),
        collecting_event_query: params[:collecting_event_query])
Severity: Major
Found in app/controllers/collecting_events_controller.rb and 4 other locations - About 35 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 117..126
app/controllers/biological_associations_controller.rb on lines 153..161
app/controllers/collection_objects_controller.rb on lines 402..410
app/controllers/otus_controller.rb on lines 254..263

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

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

  def batch_update
    if r = Otu.batch_update(
        preview: params[:preview],
        otu: otu_params.merge(by: sessions_current_user_id),
        otu_query: params[:otu_query],
Severity: Major
Found in app/controllers/otus_controller.rb and 4 other locations - About 35 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 117..126
app/controllers/biological_associations_controller.rb on lines 153..161
app/controllers/collecting_events_controller.rb on lines 128..136
app/controllers/collection_objects_controller.rb on lines 402..410

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

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

  def batch_update
    if r = BiologicalAssociation.batch_update(
        preview: params[:preview],
        biological_association: biological_association_params.merge(by: sessions_current_user_id),
        biological_association_query: params[:biological_association_query] )
Severity: Major
Found in app/controllers/biological_associations_controller.rb and 4 other locations - About 35 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 117..126
app/controllers/collecting_events_controller.rb on lines 128..136
app/controllers/collection_objects_controller.rb on lines 402..410
app/controllers/otus_controller.rb on lines 254..263

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

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 preview_simple_batch_load
    if params[:file]
      @result = BatchLoad::Import::Otus.new(**batch_params.merge(user_map))
      digest_cookie(params[:file].tempfile, :batch_otus_md5)
      render('otus/batch_load/simple/preview')
Severity: Minor
Found in app/controllers/otus_controller.rb and 1 other location - About 35 mins to fix
app/controllers/collection_objects_controller.rb on lines 268..276

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

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

          t.project(t['sequence_id'], t['updated_at']).from(t)
            .where(t['updated_at'].gt( 1.weeks.ago ))
            .where(t['created_by_id'].eq(user_id))
            .where(t['project_id'].eq(project_id))
            .order(t['updated_at'])
Severity: Minor
Found in app/models/sequence.rb and 1 other location - About 35 mins to fix
app/models/sequence.rb on lines 97..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 34.

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

          t.project(t['object_sequence_id'], t['updated_at']).from(t)
            .where(
              t['updated_at'].gt(1.weeks.ago)
            )
              .where(t['created_by_id'].eq(user_id))
Severity: Minor
Found in app/models/sequence.rb and 1 other location - About 35 mins to fix
app/models/sequence.rb on lines 105..109

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

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

        a.each do |q|
          j = ::ObservationMatrixRow.joins(:otu).where(otu: q.limit(50).pluck(:id)).order('observation_matrix_rows.position')
          c = j.where(observation_matrix_id: observation_matrix_id) if observation_matrix_id
          c ||= j
          updated_queries.push c
Severity: Minor
Found in lib/queries/observation_matrix_row/autocomplete.rb and 1 other location - About 35 mins to fix
lib/queries/observation_matrix_row/autocomplete.rb on lines 30..34

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

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 preview_simple_batch_load
    if params[:file]
      @result = BatchLoad::Import::CollectionObjects.new(**batch_params.merge(user_map))
      digest_cookie(params[:file].tempfile, :batch_collection_objects_md5)
      render 'collection_objects/batch_load/simple/preview'
Severity: Minor
Found in app/controllers/collection_objects_controller.rb and 1 other location - About 35 mins to fix
app/controllers/otus_controller.rb on lines 132..140

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

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

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#hub_task')

  if (el) { initApp(el) }
})
Severity: Major
Found in app/javascript/vue/tasks/leads/hub/main.js and 27 other locations - About 35 mins to fix
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/initializers/SoftValidations/main.js on lines 23..29
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/administration/data/index.js on lines 9..15
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collecting_events/stepwise/collectors/main.js on lines 10..14
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/extracts/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/leads/show/main.js on lines 10..14
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/observations/filter/main.js on lines 10..16
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#vue-validation-panel')

  if (el) {
    initValidations(el)
Severity: Major
Found in app/javascript/vue/initializers/SoftValidations/main.js and 27 other locations - About 35 mins to fix
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/administration/data/index.js on lines 9..15
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collecting_events/stepwise/collectors/main.js on lines 10..14
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/extracts/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/hub/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/leads/show/main.js on lines 10..14
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/observations/filter/main.js on lines 10..16
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#vue-extract-filter-task')

  if (el) { initApp(el) }
})
Severity: Major
Found in app/javascript/vue/tasks/extracts/filter/main.js and 27 other locations - About 35 mins to fix
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/initializers/SoftValidations/main.js on lines 23..29
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/administration/data/index.js on lines 9..15
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collecting_events/stepwise/collectors/main.js on lines 10..14
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/hub/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/leads/show/main.js on lines 10..14
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/observations/filter/main.js on lines 10..16
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#collectors_task')

  if (el) { initApp(el) }
})
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/initializers/SoftValidations/main.js on lines 23..29
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/administration/data/index.js on lines 9..15
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/extracts/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/hub/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/leads/show/main.js on lines 10..14
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/observations/filter/main.js on lines 10..16
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

document.addEventListener('turbolinks:load', () => {
  const element = document.querySelector('#vue-administration-data')

  if (element) {
    init(element)
Severity: Major
Found in app/javascript/vue/tasks/administration/data/index.js and 27 other locations - About 35 mins to fix
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/initializers/SoftValidations/main.js on lines 23..29
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collecting_events/stepwise/collectors/main.js on lines 10..14
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/extracts/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/hub/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/leads/show/main.js on lines 10..14
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/observations/filter/main.js on lines 10..16
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      const request = this.identifier.id
        ? Identifier.update(this.identifier.id, payload)
        : Identifier.create(payload)
app/javascript/vue/components/Form/FormCollectingEvent/store/collectingEvent.js on lines 65..67
app/javascript/vue/components/Form/FormCollectingEvent/store/identifier.js on lines 38..40
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/store/fieldOccurrence.js on lines 35..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 46.

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

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#show_task')

  if (el) { initApp(el) }
})
Severity: Major
Found in app/javascript/vue/tasks/leads/show/main.js and 27 other locations - About 35 mins to fix
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/initializers/SoftValidations/main.js on lines 23..29
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/administration/data/index.js on lines 9..15
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collecting_events/stepwise/collectors/main.js on lines 10..14
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/extracts/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/hub/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/observations/filter/main.js on lines 10..16
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#vue-filter-observations-task')

  if (el) {
    initApp(el)
Severity: Major
Found in app/javascript/vue/tasks/observations/filter/main.js and 27 other locations - About 35 mins to fix
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/initializers/SoftValidations/main.js on lines 23..29
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/administration/data/index.js on lines 9..15
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collecting_events/stepwise/collectors/main.js on lines 10..14
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/extracts/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/hub/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/leads/show/main.js on lines 10..14
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      const request = this.fieldOccurrence.id
        ? FieldOccurrence.update(this.fieldOccurrence.id, payload)
        : FieldOccurrence.create(payload)
app/javascript/vue/components/Form/FormCollectingEvent/store/collectingEvent.js on lines 65..67
app/javascript/vue/components/Form/FormCollectingEvent/store/identifier.js on lines 38..40
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/store/identifier.js on lines 69..71

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

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

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#determinations_task')

  if (el) { initApp(el) }
})
app/javascript/vue/data/downloads/index.js on lines 15..20
app/javascript/vue/initializers/IssueTracker/main.js on lines 17..25
app/javascript/vue/initializers/SoftValidations/main.js on lines 23..29
app/javascript/vue/tasks/accessions/breakdown/filter/main.js on lines 12..18
app/javascript/vue/tasks/administration/data/index.js on lines 9..15
app/javascript/vue/tasks/asserted_distributions/filter/main.js on lines 10..14
app/javascript/vue/tasks/biological_associations/biological_associations_graph/main.js on lines 21..27
app/javascript/vue/tasks/biological_associations/filter/main.js on lines 12..18
app/javascript/vue/tasks/biological_associations/network/main.js on lines 10..16
app/javascript/vue/tasks/collecting_events/stepwise/collectors/main.js on lines 10..14
app/javascript/vue/tasks/collection_objects/browse/main.js on lines 22..28
app/javascript/vue/tasks/collection_objects/freeform_digitize/main.js on lines 12..18
app/javascript/vue/tasks/collection_objects/simple_new_specimen/index.js on lines 15..21
app/javascript/vue/tasks/content/publisher/main.js on lines 10..14
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/extracts/filter/main.js on lines 10..14
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/main.js on lines 12..18
app/javascript/vue/tasks/graph/object_graph/main.js on lines 10..14
app/javascript/vue/tasks/leads/hub/main.js on lines 10..14
app/javascript/vue/tasks/leads/new_lead/main.js on lines 13..17
app/javascript/vue/tasks/leads/show/main.js on lines 10..14
app/javascript/vue/tasks/loans/filter/main.js on lines 10..14
app/javascript/vue/tasks/metadata/vocabulary/project_vocabulary/main.js on lines 10..14
app/javascript/vue/tasks/observations/filter/main.js on lines 10..16
app/javascript/vue/tasks/otus/new_otu/main.js on lines 10..14
app/javascript/vue/tasks/people/filter/main.js on lines 18..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 46.

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