SpeciesFileGroup/taxonworks

View on GitHub

Showing 12,628 of 12,628 total issues

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

  def update
    respond_to do |format|
      if @image.update(image_params)
        format.html { redirect_to @image, notice: 'Image was successfully updated.' }
        format.json { render :show, status: :ok, location: @image }
Severity: Major
Found in app/controllers/images_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/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 5 locations. Consider refactoring.
Open

  def index
    respond_to do |format|
      format.html do
        @recent_objects = Image.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/images_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/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 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 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 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 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 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

  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}")
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/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/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}")
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/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/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

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

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

  def data_attribute_import_wildcard_pair_facet
    return nil if data_attribute_import_wildcard_pair.blank?
    a = []
    data_attribute_import_wildcard_pair.each do |k,v|
      a.push data_attribute_table[:import_predicate].eq(k).and( data_attribute_table[:value].matches(wildcard_value(v)) )
Severity: Minor
Found in lib/queries/concerns/data_attributes.rb and 1 other location - About 50 mins to fix
lib/queries/concerns/data_attributes.rb on lines 271..282

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