SpeciesFileGroup/taxonworks

View on GitHub

Showing 1,084 of 12,558 total issues

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

  def update
    respond_to do |format|
      if @observation_matrix.update(observation_matrix_params)
        format.html { redirect_to @observation_matrix, notice: 'Matrix was successfully updated.' }
        format.json { render :show, status: :ok, location: @observation_matrix }
Severity: Major
Found in app/controllers/observation_matrices_controller.rb and 22 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 45..52
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 23 locations. Consider refactoring.
Open

  def update
    respond_to do |format|
      if @document.update(document_params)
        format.html { redirect_to @document, notice: 'Document was successfully updated.' }
        format.json { render :show, status: :ok, location: @document }
Severity: Major
Found in app/controllers/documents_controller.rb and 22 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/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/observation_matrices_controller.rb on lines 63..70
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[2]
      date[:start_date_month] = matchdata1[1]
      date[:start_date_year] = matchdata1[3]
      date[:end_date_day]  = matchdata1[5]
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 771..777
lib/utilities/dates.rb on lines 780..786
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 23 locations. Consider refactoring.
Open

  def update
    respond_to do |format|
      if @protocol.update(protocol_params)
        format.html { redirect_to @protocol, notice: 'Protocol was successfully updated.' }
        format.json { render :show, status: :ok, location: @protocol }
Severity: Major
Found in app/controllers/protocols_controller.rb and 22 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 45..52
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/observation_matrices_controller.rb on lines 63..70
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/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 23 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 22 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 45..52
app/controllers/extracts_controller.rb on lines 60..67
app/controllers/gene_attributes_controller.rb on lines 49..56
app/controllers/observation_matrices_controller.rb on lines 63..70
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[2]
      date[:start_date_month] = matchdata1[1]
      date[:start_date_year] = matchdata1[5]
      date[:end_date_day]  = matchdata1[4]
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 780..786
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 10 locations. Consider refactoring.
Open

      date[:verbatim_date] = matchdata1[0].strip
      date[:start_date_day] = matchdata1[2]
      date[:start_date_month] = matchdata1[1]
      date[:start_date_year] = matchdata1[4]
      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 780..786
lib/utilities/dates.rb on lines 789..795
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 10 locations. Consider refactoring.
Open

      date[:verbatim_date] = matchdata1[0].strip
      date[:start_date_day] = matchdata1[2]
      date[:start_date_month] = matchdata1[1]
      date[:start_date_year] = matchdata1[4]
      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 780..786
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

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 23 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 22 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 45..52
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/observation_matrices_controller.rb on lines 63..70
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 23 locations. Consider refactoring.
Open

  def update
    respond_to do |format|
      if @protocol_relationship.update(protocol_relationship_params)
        format.html { redirect_to @protocol_relationship, notice: 'Protocol relationship was successfully updated.' }
        format.json { render :show, status: :ok, location: @protocol_relationship }
Severity: Major
Found in app/controllers/protocol_relationships_controller.rb and 22 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 45..52
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/observation_matrices_controller.rb on lines 63..70
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/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 23 locations. Consider refactoring.
Open

  def update
    respond_to do |format|
      if @type_material.update(type_material_params)
        format.html { redirect_to @type_material, notice: 'Type material was successfully updated.' }
        format.json { render :show, status: :ok, location: @type_material }
Severity: Major
Found in app/controllers/type_materials_controller.rb and 22 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 45..52
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/observation_matrices_controller.rb on lines 63..70
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

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

  def update
    respond_to do |format|
      if @ranged_lot_category.update(ranged_lot_category_params)
        format.html { redirect_to @ranged_lot_category, notice: 'Ranged lot category was successfully updated.' }
        format.json { render :show, status: :ok, location: @ranged_lot_category }
Severity: Major
Found in app/controllers/ranged_lot_categories_controller.rb and 22 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 45..52
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/observation_matrices_controller.rb on lines 63..70
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/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 23 locations. Consider refactoring.
Open

  def update
    respond_to do |format|
      if @biological_associations_graph.update(biological_associations_graph_params)
        format.html { redirect_to @biological_associations_graph, notice: 'Biological associations graph was successfully updated.' }
        format.json { render :show, status: :ok, location: @biological_associations_graph }
Severity: Major
Found in app/controllers/biological_associations_graphs_controller.rb and 22 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_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 45..52
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/observation_matrices_controller.rb on lines 63..70
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 {
        @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 23 locations. Consider refactoring.
Open

  def update
    respond_to do |format|
      if @confidence.update(confidence_params)
        format.html { redirect_to @confidence, notice: 'Confidence was successfully updated.' }
        format.json { render :show, status: :ok, location: @confidence }
Severity: Major
Found in app/controllers/confidences_controller.rb and 22 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/depictions_controller.rb on lines 86..93
app/controllers/documents_controller.rb on lines 45..52
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/observation_matrices_controller.rb on lines 63..70
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 23 locations. Consider refactoring.
Open

  def update
    respond_to do |format|
      if @asserted_distribution.update(asserted_distribution_params)
        format.html { redirect_to @asserted_distribution, notice: 'Asserted distribution was successfully updated.' }
        format.json { render :show, status: :ok, location: @asserted_distribution }
Severity: Major
Found in app/controllers/asserted_distributions_controller.rb and 22 other locations - About 55 mins to fix
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 45..52
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/observation_matrices_controller.rb on lines 63..70
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 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

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

  def update
    respond_to do |format|
      if @organization.update(organization_params)
        format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }
        format.json { render :show, status: :ok, location: @organization }
Severity: Major
Found in app/controllers/organizations_controller.rb and 22 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 45..52
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/observation_matrices_controller.rb on lines 63..70
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

Severity
Category
Status
Source
Language