SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,631 of 12,631 total issues

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

    removeFromList (id) {
      const position = this.list.findIndex(element => element.id == id)

      if (position > -1) {
        this.list.splice(position, 1)
app/javascript/vue/components/radials/annotator/components/annotatorExtend.js on lines 49..55
app/javascript/vue/components/radials/object/components/annotatorExtend.js on lines 60..66

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

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

      combo_options.error = function(xhr, status) {
        $form.trigger('ajaxify:error', {xhr: xhr, status:status, form: $form});
        if (options.error) { options.error(xhr, status);}
      };
Severity: Major
Found in app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js on lines 54..57
app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js on lines 64..67

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

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

      combo_options.success = function(xhr, status) {
        $form.trigger('ajaxify:success', {xhr: xhr, status:status, form: $form});
        if (options.success) { options.success(xhr, status); }
      };
Severity: Major
Found in app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js on lines 59..62
app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js on lines 64..67

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

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

      combo_options.complete = function(xhr, status) {
        $form.trigger('ajaxify:complete', {xhr: xhr, status:status, form: $form});
        if (options.complete) { options.complete(xhr, status);}
      };
Severity: Major
Found in app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js on lines 54..57
app/assets/javascripts/vendor/lib/jquery/jquery.ajaxify.js on lines 59..62

Duplicated Code

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

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

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

Tuning

This issue has a mass of 69.

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

    removeFromList (id) {
      const position = this.list.findIndex(element => element.id === id)

      if (position > -1) {
        this.list.splice(position, 1)
app/javascript/vue/components/radials/navigation/components/radialObjectExtend.js on lines 43..49
app/javascript/vue/components/radials/object/components/annotatorExtend.js on lines 60..66

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

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

$(document).on("turbolinks:load", function () {
  if ($("#ce_parse_lat_long").length) {
    //  var _init_lat_long_parse = TW.views.tasks.collecting_events.parse;
    // _init_lat_long_parse.init();
    TW.views.tasks.collecting_events.parse.lat_long.init();
app/assets/javascripts/views/tasks/collecting_events/parse/dates/index.js on lines 124..130

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

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

  TW.workbench.keyboard.createShortcut('right', "Go to next page", "Lists", function () {
    if ($('.page-navigator a[rel="next"]').length > 0) {
      location.href = $('.page-navigator a[rel="next"]').attr('href');
    }
  });
Severity: Major
Found in app/assets/javascripts/views/shared/lists.js and 1 other location - About 1 hr to fix
app/assets/javascripts/views/shared/lists.js on lines 87..91

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

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

  TW.workbench.keyboard.createShortcut("left", "Go to previous page", "Lists", function () {
    if ($('.page-navigator a[rel="previous"]').length > 0) {
      location.href = $('.page-navigator a[rel="previous"]').attr('href');
    }
  });
Severity: Major
Found in app/assets/javascripts/views/shared/lists.js and 1 other location - About 1 hr to fix
app/assets/javascripts/views/shared/lists.js on lines 93..97

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

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

$(document).on("turbolinks:load", function () {
  if ($("#ce_parse_dates").length) {
    //  var _init_lat_long_parse = TW.views.tasks.collecting_events.parse;
    // _init_lat_long_parse.init();
    TW.views.tasks.collecting_events.parse.dates.init();
app/assets/javascripts/views/tasks/collecting_events/parse/lat_long/index.js on lines 113..119

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

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

Method becomes_combination has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def becomes_combination
    a, original_relationships, c = nil, nil, nil

    if b = convertable_to_combination?
      a, original_relationships = b
Severity: Minor
Found in app/models/protonym/becomes.rb - About 1 hr to fix

    Method sv_potential_species_homonyms has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def sv_potential_species_homonyms
          if persisted? && is_species_rank? && is_available?
            if TaxonNameRelationship.where_subject_is_taxon_name(self).homonym_or_suppressed.empty?
              if self.id == self.lowest_rank_coordinated_taxon.id
                name1 = self.cached_primary_homonym ? self.cached_primary_homonym : nil
    Severity: Minor
    Found in app/models/protonym/soft_validation_extensions.rb - About 1 hr to fix

      Method save_selected has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def save_selected
          next_id = next_collecting_event_id
          selected = params[:selected]
          if selected.blank?
            message = 'Nothing to save.'

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

          def value_facet
            return nil if data_attribute_exact_value.blank?  && data_attribute_wildcard_value.blank?
        
            a,b = nil, nil
        
        
        Severity: Major
        Found in lib/queries/concerns/data_attributes.rb and 1 other location - About 1 hr to fix
        lib/queries/concerns/data_attributes.rb on lines 246..268

        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

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

          def import_value_facet
            return nil if data_attribute_import_exact_value.blank? && data_attribute_import_wildcard_value.blank?
        
            a,b = nil, nil
        
        
        Severity: Major
        Found in lib/queries/concerns/data_attributes.rb and 1 other location - About 1 hr to fix
        lib/queries/concerns/data_attributes.rb on lines 221..243

        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

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

        const ComponentVerbatim = {
          Label: 'Label',
          Locality: 'Locality',
          Latitude: 'Latitude',
          Longitude: 'Longitude',
        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/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 GetterNames = {
          GetMatrix: 'getMatrix',
          GetObservations: 'getObservations',
          GetObservationColumns: 'getObservationColumns',
          GetObservationLanguages: 'getObservationLanguages',
        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/loans/new/store/mutations/mutations.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 ComponentVerbatim = {
          Label: 'Label',
          Locality: 'Locality',
          Latitude: 'Latitude',
          Longitude: 'Longitude',
        Severity: Major
        Found in app/javascript/vue/tasks/digitize/const/components.js and 9 other locations - About 1 hr to fix
        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/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 10 locations. Consider refactoring.
        Open

        const ComponentVerbatim = {
          Label: 'Label',
          Locality: 'Locality',
          Latitude: 'Latitude',
          Longitude: 'Longitude',
        app/javascript/vue/components/Form/FormCollectingEvent/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/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 = {
          SetMatrix: 'setMatrix',
          SetMatrixName: 'setMatrixName',
          SetMatrixColumns: 'setMatrixColumns',
          SetMatrixColumnsDynamic: 'setMatrixColumnDynamic',
        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/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

        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,
        app/javascript/vue/tasks/observation_matrices/matrix_row_coder/store/helpers/makeEmptyObservationsFor.js on lines 22..35

        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

        Severity
        Category
        Status
        Source
        Language