SpeciesFileGroup/taxonworks

View on GitHub

Showing 1,085 of 12,578 total issues

Similar blocks of code found in 29 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/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/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 29 locations. Consider refactoring.
Open

document.addEventListener('turbolinks:load', () => {
  const el = document.querySelector('#vue-biological-associations-graph-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/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/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/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 29 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 28 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/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/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

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

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

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

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

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

    return determination.id
      ? TaxonDetermination.update(determination.id, {
          taxon_determination: payload
        })
      : TaxonDetermination.create({ taxon_determination: payload })
app/javascript/vue/tasks/extracts/new_extract/store/actions/saveOriginRelationships.js on lines 20..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 2 locations. Consider refactoring.
Open

    return relationship.id
      ? OriginRelationship.update(data.id, { origin_relationship: data })
      : OriginRelationship.create({ origin_relationship: data })
app/javascript/vue/tasks/digitize/store/actions/saveDeterminations.js on lines 42..46

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

  def preview_genbank_batch_load 
    if params[:file] 
      @result = BatchLoad::Import::Sequences::GenbankInterpreter.new(**batch_params)
      digest_cookie(params[:file].tempfile, :Genbank_sequences_md5)
      render 'sequences/batch_load/genbank/preview'
Severity: Major
Found in app/controllers/sequences_controller.rb and 12 other locations - About 30 mins to fix
app/controllers/collecting_events_controller.rb on lines 195..203
app/controllers/collecting_events_controller.rb on lines 221..230
app/controllers/collection_objects_controller.rb on lines 300..308
app/controllers/collection_objects_controller.rb on lines 326..334
app/controllers/descriptors_controller.rb on lines 121..129
app/controllers/descriptors_controller.rb on lines 132..140
app/controllers/namespaces_controller.rb on lines 105..113
app/controllers/otus_controller.rb on lines 156..164
app/controllers/otus_controller.rb on lines 208..216
app/controllers/sequence_relationships_controller.rb on lines 92..100
app/controllers/sequences_controller.rb on lines 156..164
app/controllers/taxon_names_controller.rb on lines 188..196

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

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

  def preview_simple_batch_load
    if params[:file]
      @result = BatchLoad::Import::Namespaces::SimpleInterpreter.new(**batch_params)
      digest_cookie(params[:file].tempfile, :Simple_namespaces_md5)
      render 'namespaces/batch_load/simple/preview'
Severity: Major
Found in app/controllers/namespaces_controller.rb and 12 other locations - About 30 mins to fix
app/controllers/collecting_events_controller.rb on lines 195..203
app/controllers/collecting_events_controller.rb on lines 221..230
app/controllers/collection_objects_controller.rb on lines 300..308
app/controllers/collection_objects_controller.rb on lines 326..334
app/controllers/descriptors_controller.rb on lines 121..129
app/controllers/descriptors_controller.rb on lines 132..140
app/controllers/otus_controller.rb on lines 156..164
app/controllers/otus_controller.rb on lines 208..216
app/controllers/sequence_relationships_controller.rb on lines 92..100
app/controllers/sequences_controller.rb on lines 130..138
app/controllers/sequences_controller.rb on lines 156..164
app/controllers/taxon_names_controller.rb on lines 188..196

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

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

  def preview_primers_batch_load
    if params[:file]
      @result = BatchLoad::Import::SequenceRelationships::PrimersInterpreter.new(**batch_params)
      digest_cookie(params[:file].tempfile, :Primers_sequences_md5)
      render 'sequence_relationships/batch_load/primers/preview'
Severity: Major
Found in app/controllers/sequence_relationships_controller.rb and 12 other locations - About 30 mins to fix
app/controllers/collecting_events_controller.rb on lines 195..203
app/controllers/collecting_events_controller.rb on lines 221..230
app/controllers/collection_objects_controller.rb on lines 300..308
app/controllers/collection_objects_controller.rb on lines 326..334
app/controllers/descriptors_controller.rb on lines 121..129
app/controllers/descriptors_controller.rb on lines 132..140
app/controllers/namespaces_controller.rb on lines 105..113
app/controllers/otus_controller.rb on lines 156..164
app/controllers/otus_controller.rb on lines 208..216
app/controllers/sequences_controller.rb on lines 130..138
app/controllers/sequences_controller.rb on lines 156..164
app/controllers/taxon_names_controller.rb on lines 188..196

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

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