SpeciesFileGroup/taxonworks

View on GitHub

Showing 1,079 of 12,577 total issues

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

  def update
    respond_to do |format|
      if @collection_object_observation.update(collection_object_observation_params)
        format.html { redirect_to @collection_object_observation,
                                  notice: 'Collection object observation was successfully updated.' }
Severity: Major
Found in app/controllers/collection_object_observations_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 58..65
app/controllers/attributions_controller.rb on lines 58..65
app/controllers/biological_associations_controller.rb on lines 60..67
app/controllers/biological_associations_graphs_controller.rb on lines 60..67
app/controllers/biological_relationships_controller.rb on lines 77..84
app/controllers/character_states_controller.rb on lines 45..52
app/controllers/common_names_controller.rb on lines 62..69
app/controllers/confidences_controller.rb on lines 55..62
app/controllers/depictions_controller.rb on lines 86..93
app/controllers/documents_controller.rb on lines 58..65
app/controllers/extracts_controller.rb on lines 60..67
app/controllers/gene_attributes_controller.rb on lines 49..56
app/controllers/images_controller.rb on lines 87..94
app/controllers/organizations_controller.rb on lines 52..59
app/controllers/origin_relationships_controller.rb on lines 59..66
app/controllers/otu_page_layouts_controller.rb on lines 47..54
app/controllers/protocol_relationships_controller.rb on lines 63..70
app/controllers/protocols_controller.rb on lines 56..63
app/controllers/ranged_lot_categories_controller.rb on lines 45..52
app/controllers/sequences_controller.rb on lines 54..61
app/controllers/type_materials_controller.rb on lines 58..65

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

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

  def update
    respond_to do |format|
      if @sequence.update(sequence_params)
        format.html { redirect_to @sequence, notice: 'Sequence was successfully updated.' }
        format.json { render :show, status: :ok, location: @sequence }
Severity: Major
Found in app/controllers/sequences_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 58..65
app/controllers/attributions_controller.rb on lines 58..65
app/controllers/biological_associations_controller.rb on lines 60..67
app/controllers/biological_associations_graphs_controller.rb on lines 60..67
app/controllers/biological_relationships_controller.rb on lines 77..84
app/controllers/character_states_controller.rb on lines 45..52
app/controllers/collection_object_observations_controller.rb on lines 47..55
app/controllers/common_names_controller.rb on lines 62..69
app/controllers/confidences_controller.rb on lines 55..62
app/controllers/depictions_controller.rb on lines 86..93
app/controllers/documents_controller.rb on lines 58..65
app/controllers/extracts_controller.rb on lines 60..67
app/controllers/gene_attributes_controller.rb on lines 49..56
app/controllers/images_controller.rb on lines 87..94
app/controllers/organizations_controller.rb on lines 52..59
app/controllers/origin_relationships_controller.rb on lines 59..66
app/controllers/otu_page_layouts_controller.rb on lines 47..54
app/controllers/protocol_relationships_controller.rb on lines 63..70
app/controllers/protocols_controller.rb on lines 56..63
app/controllers/ranged_lot_categories_controller.rb on lines 45..52
app/controllers/type_materials_controller.rb on lines 58..65

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

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

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

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

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

Refactorings

Further Reading

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

  def index
    respond_to do |format|
      format.html do
        @recent_objects = Georeference.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)
        render '/shared/data/all/index'
Severity: Major
Found in app/controllers/georeferences_controller.rb and 4 other locations - About 55 mins to fix
app/controllers/biological_associations_controller.rb on lines 9..20
app/controllers/extracts_controller.rb on lines 9..19
app/controllers/images_controller.rb on lines 9..18
app/controllers/observations_controller.rb on lines 9..21

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

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

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

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

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

Refactorings

Further Reading

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

  def index
    respond_to do |format|
      format.html do
        @recent_objects = Extract.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)
        render '/shared/data/all/index'
Severity: Major
Found in app/controllers/extracts_controller.rb and 4 other locations - About 55 mins to fix
app/controllers/biological_associations_controller.rb on lines 9..20
app/controllers/georeferences_controller.rb on lines 8..18
app/controllers/images_controller.rb on lines 9..18
app/controllers/observations_controller.rb on lines 9..21

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

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

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

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

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

Refactorings

Further Reading

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

  def index
    respond_to do |format|
      format.html {
        @recent_objects = BiologicalAssociation.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)
        render '/shared/data/all/index'
Severity: Major
Found in app/controllers/biological_associations_controller.rb and 4 other locations - About 55 mins to fix
app/controllers/extracts_controller.rb on lines 9..19
app/controllers/georeferences_controller.rb on lines 8..18
app/controllers/images_controller.rb on lines 9..18
app/controllers/observations_controller.rb on lines 9..21

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

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

  def update
    respond_to do |format|
      if @gene_attribute.update(gene_attribute_params)
        format.html { redirect_to @gene_attribute, notice: 'Gene attribute was successfully updated.' }
        format.json { render :show, status: :ok, location: @gene_attribute }
Severity: Major
Found in app/controllers/gene_attributes_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 58..65
app/controllers/attributions_controller.rb on lines 58..65
app/controllers/biological_associations_controller.rb on lines 60..67
app/controllers/biological_associations_graphs_controller.rb on lines 60..67
app/controllers/biological_relationships_controller.rb on lines 77..84
app/controllers/character_states_controller.rb on lines 45..52
app/controllers/collection_object_observations_controller.rb on lines 47..55
app/controllers/common_names_controller.rb on lines 62..69
app/controllers/confidences_controller.rb on lines 55..62
app/controllers/depictions_controller.rb on lines 86..93
app/controllers/documents_controller.rb on lines 58..65
app/controllers/extracts_controller.rb on lines 60..67
app/controllers/images_controller.rb on lines 87..94
app/controllers/organizations_controller.rb on lines 52..59
app/controllers/origin_relationships_controller.rb on lines 59..66
app/controllers/otu_page_layouts_controller.rb on lines 47..54
app/controllers/protocol_relationships_controller.rb on lines 63..70
app/controllers/protocols_controller.rb on lines 56..63
app/controllers/ranged_lot_categories_controller.rb on lines 45..52
app/controllers/sequences_controller.rb on lines 54..61
app/controllers/type_materials_controller.rb on lines 58..65

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

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

  def update
    respond_to do |format|
      if @common_name.update(common_name_params)
        format.html { redirect_to @common_name, notice: 'Common name was successfully updated.' }
        format.json { render :show, status: :ok, location: @common_name }
Severity: Major
Found in app/controllers/common_names_controller.rb and 21 other locations - About 55 mins to fix
app/controllers/asserted_distributions_controller.rb on lines 58..65
app/controllers/attributions_controller.rb on lines 58..65
app/controllers/biological_associations_controller.rb on lines 60..67
app/controllers/biological_associations_graphs_controller.rb on lines 60..67
app/controllers/biological_relationships_controller.rb on lines 77..84
app/controllers/character_states_controller.rb on lines 45..52
app/controllers/collection_object_observations_controller.rb on lines 47..55
app/controllers/confidences_controller.rb on lines 55..62
app/controllers/depictions_controller.rb on lines 86..93
app/controllers/documents_controller.rb on lines 58..65
app/controllers/extracts_controller.rb on lines 60..67
app/controllers/gene_attributes_controller.rb on lines 49..56
app/controllers/images_controller.rb on lines 87..94
app/controllers/organizations_controller.rb on lines 52..59
app/controllers/origin_relationships_controller.rb on lines 59..66
app/controllers/otu_page_layouts_controller.rb on lines 47..54
app/controllers/protocol_relationships_controller.rb on lines 63..70
app/controllers/protocols_controller.rb on lines 56..63
app/controllers/ranged_lot_categories_controller.rb on lines 45..52
app/controllers/sequences_controller.rb on lines 54..61
app/controllers/type_materials_controller.rb on lines 58..65

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

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

      date[:verbatim_date] = matchdata1[0].strip
      date[:start_date_day] = matchdata1[1]
      date[:start_date_month] = matchdata1[2]
      date[:start_date_year] = matchdata1[5]
      date[:end_date_day]  = matchdata1[3]
Severity: Major
Found in lib/utilities/dates.rb and 9 other locations - About 55 mins to fix
lib/utilities/dates.rb on lines 744..750
lib/utilities/dates.rb on lines 753..759
lib/utilities/dates.rb on lines 762..768
lib/utilities/dates.rb on lines 771..777
lib/utilities/dates.rb on lines 789..795
lib/utilities/dates.rb on lines 798..804
lib/utilities/dates.rb on lines 807..813
lib/utilities/dates.rb on lines 817..823
lib/utilities/dates.rb on lines 827..833

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

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

    when 'column'
      (0.._column_total).each do |c|
        (0.._row_total).each do |r|
          k += j[r][c]
          i[r] ||= []
Severity: Minor
Found in app/models/sled_image.rb and 1 other location - About 55 mins to fix
app/models/sled_image.rb on lines 151..156

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

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 autocomplete
    @alternate_values = AlternateValue.find_for_autocomplete(params.merge(project_id: sessions_current_project_id))

    data = @alternate_values.collect do |t|
      str = render_to_string(partial: 'tag', locals: {alternate_value: t})
Severity: Minor
Found in app/controllers/alternate_values_controller.rb and 1 other location - About 55 mins to fix
app/controllers/citations_controller.rb on lines 111..125

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

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

    when 'row'
      (0.._row_total).each do |r|
        (0.._column_total).each do |c|
          k += j[r][c]
          i[r] ||= []
Severity: Minor
Found in app/models/sled_image.rb and 1 other location - About 55 mins to fix
app/models/sled_image.rb on lines 160..165

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

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

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

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

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

Refactorings

Further Reading

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

  def index
    respond_to do |format|
      format.html do
        @recent_objects = Observation.recent_from_project_id(sessions_current_project_id)
          .order(updated_at: :desc).limit(10)
Severity: Major
Found in app/controllers/observations_controller.rb and 4 other locations - About 55 mins to fix
app/controllers/biological_associations_controller.rb on lines 9..20
app/controllers/extracts_controller.rb on lines 9..19
app/controllers/georeferences_controller.rb on lines 8..18
app/controllers/images_controller.rb on lines 9..18

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

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 autocomplete
    @citations = Citation.find_for_autocomplete(params.merge(project_id: sessions_current_project_id))
    data = @citations.collect do |t|
      lbl = render_to_string(partial: 'tag', locals: {citation: t})
      {id: t.id,
Severity: Minor
Found in app/controllers/citations_controller.rb and 1 other location - About 55 mins to fix
app/controllers/alternate_values_controller.rb on lines 92..105

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

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

  def sv_validate_priority
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
      soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
Severity: Major
Found in app/models/taxon_name_relationship/original_combination.rb and 10 other locations - About 50 mins to fix
app/models/taxon_name_relationship/icn/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icn/accepting/sanctioned_name.rb on lines 39..44
app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icvcn/unaccepting/supressed.rb on lines 48..53
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/forgotten.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/suppressed.rb on lines 34..39
app/models/taxon_name_relationship/iczn/invalidating/synonym/forgotten_name.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/synonym/suppression.rb on lines 61..66
app/models/taxon_name_relationship/iczn/validating/conserved_name.rb on lines 67..72
app/models/taxon_name_relationship/iczn/validating/conserved_work.rb on lines 67..72

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

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

  def sv_validate_priority
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
      soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
app/models/taxon_name_relationship/icn/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icn/accepting/sanctioned_name.rb on lines 39..44
app/models/taxon_name_relationship/icvcn/unaccepting/supressed.rb on lines 48..53
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/forgotten.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/suppressed.rb on lines 34..39
app/models/taxon_name_relationship/iczn/invalidating/synonym/forgotten_name.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/synonym/suppression.rb on lines 61..66
app/models/taxon_name_relationship/iczn/validating/conserved_name.rb on lines 67..72
app/models/taxon_name_relationship/iczn/validating/conserved_work.rb on lines 67..72
app/models/taxon_name_relationship/original_combination.rb on lines 106..111

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

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

  def sv_validate_priority
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
      soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
app/models/taxon_name_relationship/icn/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icn/accepting/sanctioned_name.rb on lines 39..44
app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icvcn/unaccepting/supressed.rb on lines 48..53
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/suppressed.rb on lines 34..39
app/models/taxon_name_relationship/iczn/invalidating/synonym/forgotten_name.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/synonym/suppression.rb on lines 61..66
app/models/taxon_name_relationship/iczn/validating/conserved_name.rb on lines 67..72
app/models/taxon_name_relationship/iczn/validating/conserved_work.rb on lines 67..72
app/models/taxon_name_relationship/original_combination.rb on lines 106..111

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

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

  def sv_validate_priority
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
      soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
app/models/taxon_name_relationship/icn/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icn/accepting/sanctioned_name.rb on lines 39..44
app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icvcn/unaccepting/supressed.rb on lines 48..53
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/forgotten.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/synonym/forgotten_name.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/synonym/suppression.rb on lines 61..66
app/models/taxon_name_relationship/iczn/validating/conserved_name.rb on lines 67..72
app/models/taxon_name_relationship/iczn/validating/conserved_work.rb on lines 67..72
app/models/taxon_name_relationship/original_combination.rb on lines 106..111

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

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

  def sv_validate_priority
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
      soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
app/models/taxon_name_relationship/icn/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icn/accepting/sanctioned_name.rb on lines 39..44
app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icvcn/unaccepting/supressed.rb on lines 48..53
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/forgotten.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/suppressed.rb on lines 34..39
app/models/taxon_name_relationship/iczn/invalidating/synonym/suppression.rb on lines 61..66
app/models/taxon_name_relationship/iczn/validating/conserved_name.rb on lines 67..72
app/models/taxon_name_relationship/iczn/validating/conserved_work.rb on lines 67..72
app/models/taxon_name_relationship/original_combination.rb on lines 106..111

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

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

  def sv_validate_priority
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
      soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
app/models/taxon_name_relationship/icn/accepting/sanctioned_name.rb on lines 39..44
app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icvcn/unaccepting/supressed.rb on lines 48..53
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/forgotten.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/suppressed.rb on lines 34..39
app/models/taxon_name_relationship/iczn/invalidating/synonym/forgotten_name.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/synonym/suppression.rb on lines 61..66
app/models/taxon_name_relationship/iczn/validating/conserved_name.rb on lines 67..72
app/models/taxon_name_relationship/iczn/validating/conserved_work.rb on lines 67..72
app/models/taxon_name_relationship/original_combination.rb on lines 106..111

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

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

  def sv_validate_priority
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
      soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
app/models/taxon_name_relationship/icn/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icn/accepting/sanctioned_name.rb on lines 39..44
app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb on lines 39..44
app/models/taxon_name_relationship/icvcn/unaccepting/supressed.rb on lines 48..53
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/forgotten.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/homonym/primary/suppressed.rb on lines 34..39
app/models/taxon_name_relationship/iczn/invalidating/synonym/forgotten_name.rb on lines 43..48
app/models/taxon_name_relationship/iczn/invalidating/synonym/suppression.rb on lines 61..66
app/models/taxon_name_relationship/iczn/validating/conserved_work.rb on lines 67..72
app/models/taxon_name_relationship/original_combination.rb on lines 106..111

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

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