SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,628 of 12,628 total issues

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

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

  if (el) { initApp(el) }
})
Severity: Major
Found in app/javascript/vue/tasks/content/publisher/main.js and 32 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 10..16
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 10..16
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 13..19
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/containers/new_container/main.js on lines 12..18
app/javascript/vue/tasks/contents/filter/main.js on lines 10..16
app/javascript/vue/tasks/data_attributes/field_synchronize/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/dwc_occurrences/filter/main.js on lines 10..16
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/images/new_filename_depicting_image/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/observation_matrices/import_nexus/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 6 locations. Consider refactoring.
Open

      const request = this.container.id
        ? Container.update(this.container.id, payload)
        : Container.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/digitize/store/pinia/identifiers.js on lines 81..83
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/store/fieldOccurrence.js on lines 35..37
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 6 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/tasks/containers/new_container/store/container.js on lines 282..284
app/javascript/vue/tasks/digitize/store/pinia/identifiers.js on lines 81..83
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/store/fieldOccurrence.js on lines 35..37
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 33 locations. Consider refactoring.
Open

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

  if (el) {
    initApp(el)
Severity: Major
Found in app/javascript/vue/tasks/dwc_occurrences/filter/main.js and 32 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 10..16
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 10..16
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 13..19
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/containers/new_container/main.js on lines 12..18
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/data_attributes/field_synchronize/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/images/new_filename_depicting_image/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/observation_matrices/import_nexus/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

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

export default (person, roleType) => {
  return {
    first_name: person.first_name,
    last_name: person.last_name,
    person_id: person.id,
app/javascript/vue/tasks/collection_objects/freeform_digitize/helpers/CreatePerson.js on lines 1..8

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 6 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/containers/new_container/store/container.js on lines 282..284
app/javascript/vue/tasks/digitize/store/pinia/identifiers.js on lines 81..83
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 4 locations. Consider refactoring.
Open

export default function (state) {
  return state.matrixColumnItems.sort((a, b) => {
    return a.position - b.position
  })
}
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixColumnsDynamic.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixRows.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixRowsDynamic.js on lines 1..5

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

export default function (state) {
  return state.matrixRowDynamicItems.sort((a, b) => {
    return a.position - b.position
  })
}
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixColumns.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixColumnsDynamic.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixRows.js on lines 1..5

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

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

      collection_object_attributes: {
        id: undefined,
        total: 1,
        preparation_type_id: undefined,
        repository_id: undefined,
Severity: Minor
Found in app/javascript/vue/tasks/type_specimens/store/store.js and 1 other location - About 35 mins to fix
app/javascript/vue/tasks/type_specimens/store/actions/setNewTypeMaterial.js on lines 11..20

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

        const request = this.identifier.id
          ? Identifier.update(this.identifier.id, payload)
          : Identifier.create(payload)
Severity: Major
Found in app/javascript/vue/tasks/digitize/store/pinia/identifiers.js and 5 other locations - About 35 mins to fix
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/containers/new_container/store/container.js on lines 282..284
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/store/fieldOccurrence.js on lines 35..37
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 4 locations. Consider refactoring.
Open

export default function (state) {
  return state.matrixColumnDynamicItems.sort((a, b) => {
    return a.position - b.position
  })
}
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixColumns.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixRows.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixRowsDynamic.js on lines 1..5

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

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

    collection_object_attributes: {
      id: undefined,
      total: 1,
      preparation_type_id: undefined,
      repository_id: undefined,
app/javascript/vue/tasks/type_specimens/store/store.js on lines 19..28

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

document.addEventListener('turbolinks:load', () => {
  const element = document.querySelector('#vue-data-download-form')
  if (element) {
    init(element)
  }
Severity: Major
Found in app/javascript/vue/data/downloads/index.js and 32 other locations - About 35 mins to fix
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 10..16
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 10..16
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 13..19
app/javascript/vue/tasks/collection_objects/stepwise/determinations/main.js on lines 10..14
app/javascript/vue/tasks/containers/new_container/main.js on lines 12..18
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/data_attributes/field_synchronize/main.js on lines 10..16
app/javascript/vue/tasks/descriptors/filter/main.js on lines 10..14
app/javascript/vue/tasks/dwc_occurrences/filter/main.js on lines 10..16
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/images/new_filename_depicting_image/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/observation_matrices/import_nexus/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 6 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/containers/new_container/store/container.js on lines 282..284
app/javascript/vue/tasks/digitize/store/pinia/identifiers.js on lines 81..83
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 4 locations. Consider refactoring.
Open

export default function (state) {
  return state.matrixRowItems.sort((a, b) => {
    return a.position - b.position
  })
}
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixColumns.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixColumnsDynamic.js on lines 1..5
app/javascript/vue/tasks/observation_matrices/new/store/getters/getMatrixRowsDynamic.js on lines 1..5

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

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

export default (person, roleType) => {
  return {
    first_name: person.first_name,
    last_name: person.last_name,
    person_id: person.id,
app/javascript/vue/tasks/collection_objects/slide_breakdown/helpers/CreatePerson.js on lines 1..8

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

  Combination.destroy(id)
    .then(({ body }) => {
      commit(MutationNames.RemoveCombination, id)
      TW.workbench.alert.create(
        'Combination was successfully destroyed.',
app/javascript/vue/tasks/nomenclature/new_taxon_name/store/actions/createCombination.js on lines 15..19
app/javascript/vue/tasks/sources/new_source/store/actions/saveDocumentation.js on lines 16..22

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

      const request = this.collectingEvent.id
        ? CollectingEvent.update(this.collectingEvent.id, payload)
        : CollectingEvent.create(payload)
app/javascript/vue/components/Form/FormCollectingEvent/store/identifier.js on lines 38..40
app/javascript/vue/tasks/containers/new_container/store/container.js on lines 282..284
app/javascript/vue/tasks/digitize/store/pinia/identifiers.js on lines 81..83
app/javascript/vue/tasks/field_occurrences/new_field_occurrences/store/fieldOccurrence.js on lines 35..37
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 3 locations. Consider refactoring.
Open

  saveRequest
    .then(({ body }) => {
      commit(MutationNames.AddCombination, body)
      TW.workbench.alert.create('Combination was successfully saved.', 'notice')
    })
app/javascript/vue/tasks/nomenclature/new_taxon_name/store/actions/removeCombination.js on lines 5..12
app/javascript/vue/tasks/sources/new_source/store/actions/saveDocumentation.js on lines 16..22

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

    Documentation.create({ documentation }).then(({ body }) => {
      commit(MutationNames.AddDocumentation, body)
      TW.workbench.alert.create(
        'Documentation was successfully created.',
        'notice'
app/javascript/vue/tasks/nomenclature/new_taxon_name/store/actions/createCombination.js on lines 15..19
app/javascript/vue/tasks/nomenclature/new_taxon_name/store/actions/removeCombination.js on lines 5..12

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