SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

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

const GetterNames = {
  GetCELabel: 'getCELabel',
  GetCollectingEvent: 'getCollectingEvent',
  GetGeographicArea: 'getGeographicArea',
  GetGeoreferences: 'getGeoreferences',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actionNames.js on lines 1..14
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/digitize/const/components.js on lines 39..52
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 14..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 68.

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

  if (descriptor.componentName === ComponentNames.Qualitative) {
    descriptor.characterStates.forEach(characterState => {
      const emptyCharacterStateObservationData = Object.assign({}, emptyObservationData, { characterStateId: characterState.id })
      observations.push(makeObservation(emptyCharacterStateObservationData))
    })
app/javascript/vue/tasks/observation_matrices/matrix_column_coder/helpers/makeEmptyObservationsFor.js on lines 24..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 68.

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

function init() {
  const app = createApp(App)
  app.use(HelpSystem, {
    languages: {
      en: en
Severity: Major
Found in app/javascript/vue/tasks/dwca_import/main.js and 3 other locations - About 1 hr to fix
app/javascript/vue/tasks/nomenclature/new_taxon_name/main.js on lines 7..18
app/javascript/vue/tasks/otu/browse/main.js on lines 7..17
app/javascript/vue/tasks/sources/new_source/main.js on lines 7..17

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

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

const MutationNames = {
  AddCitationToList: 'addCitationToList',
  AddDepictionToList: 'addDepictionToList',
  ChangeStateCitations: 'changeStateCitations',
  ChangeStateFigures: 'changeStateFigures',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actionNames.js on lines 1..14
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/digitize/const/components.js on lines 39..52
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 14..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 68.

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

function init() {
  const app = createApp(App)

  app.use(HelpSystem, {
    languages: {
Severity: Major
Found in app/javascript/vue/tasks/sources/new_source/main.js and 3 other locations - About 1 hr to fix
app/javascript/vue/tasks/dwca_import/main.js on lines 7..16
app/javascript/vue/tasks/nomenclature/new_taxon_name/main.js on lines 7..18
app/javascript/vue/tasks/otu/browse/main.js on lines 7..17

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

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

function init() {
  const app = createApp(App)

  app.use(HelpSystem, {
    languages: {
app/javascript/vue/tasks/dwca_import/main.js on lines 7..16
app/javascript/vue/tasks/otu/browse/main.js on lines 7..17
app/javascript/vue/tasks/sources/new_source/main.js on lines 7..17

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

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

const MutationNames = {
  SetCurrentVirtualPage: 'setCurrentVirtualPage',
  SetDataset: 'setDataset',
  SetPagination: 'setPagination',
  SetParamsFilter: 'setParamsFilter',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actionNames.js on lines 1..14
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/digitize/const/components.js on lines 39..52
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 14..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 68.

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

const MutationNames = {
  AddLoanItem: 'addLoanItem',
  AddEditLoanItem: 'addEditLoanItem',
  CleanEditLoanItems: 'cleanEditLoanItems',
  SetLoan: 'setLoan',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/actions/actionNames.js on lines 1..14
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/digitize/const/components.js on lines 39..52
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 14..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 68.

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

const ActionNames = {
  CloneCollectingEvent: 'cloneCollectingEvent',
  LoadCELabel: 'loadCELabel',
  LoadCollectingEvent: 'loadCollectingEvent',
  LoadGeographicArea: 'loadGeographicArea',
app/javascript/vue/components/Form/FormCollectingEvent/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/const/components.js on lines 27..40
app/javascript/vue/tasks/collecting_events/new_collecting_event/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/content/editor/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/digitize/const/components.js on lines 39..52
app/javascript/vue/tasks/dwca_import/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/loans/new/store/mutations/mutations.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/image/store/getters/getters.js on lines 14..27
app/javascript/vue/tasks/observation_matrices/new/store/mutations/mutations.js on lines 14..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 68.

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

function init() {
  const app = createApp(App)

  app.use(HelpSystem, {
    languages: {
Severity: Major
Found in app/javascript/vue/tasks/otu/browse/main.js and 3 other locations - About 1 hr to fix
app/javascript/vue/tasks/dwca_import/main.js on lines 7..16
app/javascript/vue/tasks/nomenclature/new_taxon_name/main.js on lines 7..18
app/javascript/vue/tasks/sources/new_source/main.js on lines 7..17

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

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

  clear_role_picker: function (form) {
    var role_picker;
    role_picker = form.find('.role_picker_autocomplete');
    $(role_picker).val("");
    form.find(".new_person").attr("hidden", true);
Severity: Major
Found in app/assets/javascripts/views/people/_role_picker.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/views/tags/tag_picker.js on lines 29..34
app/assets/javascripts/views/topics/_topic_picker.js on lines 28..33

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

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

  clear_topic_picker: function (form) {
    var topic_picker;
    topic_picker = form.find('.topic_picker_autocomplete');
    $(topic_picker).val("");
    form.find(".new_topic").attr("hidden", true);
Severity: Major
Found in app/assets/javascripts/views/topics/_topic_picker.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/views/people/_role_picker.js on lines 77..82
app/assets/javascripts/views/tags/tag_picker.js on lines 29..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 68.

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

  clear_keyword_picker: function (form) {
    var keyword_picker;
    keyword_picker = form.find('.keyword_picker_autocomplete');
    $(keyword_picker).val("");
    form.find(".new_keyword").attr("hidden", true);
Severity: Major
Found in app/assets/javascripts/views/tags/tag_picker.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/views/people/_role_picker.js on lines 77..82
app/assets/javascripts/views/topics/_topic_picker.js on lines 28..33

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

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

    autocomplete_input.autocomplete({
      source: '/confidence_levels/lookup',
      open: function (event, ui) {
        TW.views.confidences.form.bind_hover(form);
      },
Severity: Major
Found in app/assets/javascripts/views/confidences/form.js and 1 other location - About 1 hr to fix
app/assets/javascripts/views/tags/tag_picker.js on lines 39..55

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

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

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

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

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

Refactorings

Further Reading

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

function makeInitialState () {
  return {
    settings: {
      lock: {
        notes_attributes: false,

    Function init has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      init: function () {
        const elementNew = document.querySelector('[data-icon="new"]')
        const elementList = document.querySelector('[data-icon="list"]')
        const elementDownload = document.querySelector('[data-icon="download"]')
        const elementBatch = document.querySelector('[data-icon="batch"]')
    Severity: Minor
    Found in app/assets/javascripts/views/shared/index.js - About 1 hr to fix

      Function bindShortcut has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        bindShortcut: function () {
          const actionKey = navigator.platform.indexOf('Mac') > -1 ? 'ctrl' : 'alt'
      
          TW.workbench.keyboard.createShortcut(
            `${actionKey}+left`,
      Severity: Minor
      Found in app/assets/javascripts/views/shared/show.js - About 1 hr to fix

        Method to_hash has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def to_hash(geometry_collection)
            data = {
              points:   [],
              lines:    [],
              polygons: []
        Severity: Minor
        Found in app/models/geographic_item/geometry_collection.rb - About 1 hr to fix

          Method permitted_params has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def permitted_params(hsh)
                h = self.class::PARAMS.deep_dup
                h.unshift(:per)
                h.unshift(:page)
                h.unshift(:paginate)
          Severity: Minor
          Found in lib/queries/query/filter.rb - About 1 hr to fix

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

            export default function (state) {
              return ({ rowObjectId, rowObjectType }) => state.observations.find(o => o.rowObjectId === rowObjectId && o.rowObjectType === rowObjectType).description
            }
            app/javascript/vue/tasks/observation_matrices/matrix_column_coder/store/getters/getPresenceFor.js on lines 1..3

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

            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