osu-cascades/ecotone-web

View on GitHub

Showing 15 of 15 total issues

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

  def create
    @tree_sample = TreeSample.new(tree_sample_params)
    @tree_sample.user = current_user
    respond_to do |format|
      if @tree_sample.save
Severity: Major
Found in app/controllers/tree_samples_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/mycorrhizal_fungi_samples_controller.rb on lines 24..35
app/controllers/species_variation_observations_controller.rb on lines 25..36

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

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

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

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

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

Refactorings

Further Reading

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

  def create
    @mycorrhizal_fungi_sample = MycorrhizalFungiSample.new(mycorrhizal_fungi_sample_params)
    @mycorrhizal_fungi_sample.user = current_user
    respond_to do |format|
      if @mycorrhizal_fungi_sample.save
Severity: Major
Found in app/controllers/mycorrhizal_fungi_samples_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/species_variation_observations_controller.rb on lines 25..36
app/controllers/tree_samples_controller.rb on lines 28..39

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

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

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

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

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

Refactorings

Further Reading

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

  def create
    @species_variation_observation = SpeciesVariationObservation.new(species_variation_observation_params)
    @species_variation_observation.user = current_user
    respond_to do |format|
      if @species_variation_observation.save
app/controllers/mycorrhizal_fungi_samples_controller.rb on lines 24..35
app/controllers/tree_samples_controller.rb on lines 28..39

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

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

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

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

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

Refactorings

Further Reading

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

  def create
    @lichen_sample = LichenSample.new(lichen_sample_params)
    @lichen_sample.user = current_user
    respond_to do |format|
      if @lichen_sample.save
Severity: Major
Found in app/controllers/lichen_samples_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/fungi_samples_controller.rb on lines 22..32
app/controllers/macroinvertebrate_samples_controller.rb on lines 22..32
app/controllers/nonvascular_plant_samples_controller.rb on lines 23..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

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

  def create
    @macroinvertebrate_sample = MacroinvertebrateSample.new(macroinvertebrate_sample_params)
    @macroinvertebrate_sample.user = current_user
    respond_to do |format|
      if @macroinvertebrate_sample.save
Severity: Major
Found in app/controllers/macroinvertebrate_samples_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/fungi_samples_controller.rb on lines 22..32
app/controllers/lichen_samples_controller.rb on lines 22..32
app/controllers/nonvascular_plant_samples_controller.rb on lines 23..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

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

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

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

Refactorings

Further Reading

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

  def create
    @nonvascular_plant_sample = NonvascularPlantSample.new(nonvascular_plant_sample_params)
    @nonvascular_plant_sample.user = current_user
    respond_to do |format|
      if @nonvascular_plant_sample.save
Severity: Major
Found in app/controllers/nonvascular_plant_samples_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/fungi_samples_controller.rb on lines 22..32
app/controllers/lichen_samples_controller.rb on lines 22..32
app/controllers/macroinvertebrate_samples_controller.rb on lines 22..32

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

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

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

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

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

Refactorings

Further Reading

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

  def update
    respond_to do |format|
      if @tree_sample.update(tree_sample_params)
        format.html { redirect_to @tree_sample, flash: {success: 'Tree sample was successfully updated.'} }
        format.json { render :show, status: :ok, location: @tree_sample }
Severity: Major
Found in app/controllers/tree_samples_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/mycorrhizal_fungi_samples_controller.rb on lines 40..49
app/controllers/species_variation_observations_controller.rb on lines 41..50

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

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

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

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

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

Refactorings

Further Reading

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

  def update
    respond_to do |format|
      if @species_variation_observation.update(species_variation_observation_params)
        format.html { redirect_to @species_variation_observation, flash: {success: 'Species variation observation was successfully updated.' } }
        format.json { render :show, status: :ok, location: @species_variation_observation }
app/controllers/mycorrhizal_fungi_samples_controller.rb on lines 40..49
app/controllers/tree_samples_controller.rb on lines 44..53

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

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

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

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

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

Refactorings

Further Reading

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

  def update
    respond_to do |format|
      if @mycorrhizal_fungi_sample.update(mycorrhizal_fungi_sample_params)
        format.html { redirect_to @mycorrhizal_fungi_sample, flash: {success: 'Mycorrhizal fungi sample was successfully updated.'} }
        format.json { render :show, status: :ok, location: @mycorrhizal_fungi_sample }
Severity: Major
Found in app/controllers/mycorrhizal_fungi_samples_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/species_variation_observations_controller.rb on lines 41..50
app/controllers/tree_samples_controller.rb on lines 44..53

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

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

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

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

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

Refactorings

Further Reading

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

  def create
    @fungi_sample = FungiSample.new(fungi_sample_params)
    @fungi_sample.user = current_user
    respond_to do |format|
      if @fungi_sample.save
Severity: Major
Found in app/controllers/fungi_samples_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/lichen_samples_controller.rb on lines 22..32
app/controllers/macroinvertebrate_samples_controller.rb on lines 22..32
app/controllers/nonvascular_plant_samples_controller.rb on lines 23..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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 update
    respond_to do |format|
      if @fungi_sample.update(fungi_sample_params)
        format.html { redirect_to @fungi_sample, flash: {success: 'Fungi sample was successfully updated.'} }
        format.json { render :show, status: :ok, location: @fungi_sample }
Severity: Major
Found in app/controllers/fungi_samples_controller.rb and 4 other locations - About 1 hr to fix
app/controllers/lichen_samples_controller.rb on lines 37..45
app/controllers/macroinvertebrate_samples_controller.rb on lines 37..45
app/controllers/nonvascular_plant_samples_controller.rb on lines 38..46
app/controllers/soil_samples_controller.rb on lines 41..49

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

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 update
    respond_to do |format|
      if @nonvascular_plant_sample.update(nonvascular_plant_sample_params)
        format.html { redirect_to @nonvascular_plant_sample, flash: {success: 'Nonvascular plant sample was successfully updated.'} }
        format.json { render :show, status: :ok, location: @nonvascular_plant_sample }
Severity: Major
Found in app/controllers/nonvascular_plant_samples_controller.rb and 4 other locations - About 1 hr to fix
app/controllers/fungi_samples_controller.rb on lines 37..45
app/controllers/lichen_samples_controller.rb on lines 37..45
app/controllers/macroinvertebrate_samples_controller.rb on lines 37..45
app/controllers/soil_samples_controller.rb on lines 41..49

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

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 update
    respond_to do |format|
      if @soil_sample.update(soil_sample_params)
        format.html { redirect_to @soil_sample, flash: {success: 'Soil sample was successfully updated.'} }
        format.json { render :show, status: :ok, location: @soil_sample }
Severity: Major
Found in app/controllers/soil_samples_controller.rb and 4 other locations - About 1 hr to fix
app/controllers/fungi_samples_controller.rb on lines 37..45
app/controllers/lichen_samples_controller.rb on lines 37..45
app/controllers/macroinvertebrate_samples_controller.rb on lines 37..45
app/controllers/nonvascular_plant_samples_controller.rb on lines 38..46

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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 update
    respond_to do |format|
      if @lichen_sample.update(lichen_sample_params)
        format.html { redirect_to @lichen_sample, flash: {success: 'Lichen sample was successfully updated.'} }
        format.json { render :show, status: :ok, location: @lichen_sample }
Severity: Major
Found in app/controllers/lichen_samples_controller.rb and 4 other locations - About 1 hr to fix
app/controllers/fungi_samples_controller.rb on lines 37..45
app/controllers/macroinvertebrate_samples_controller.rb on lines 37..45
app/controllers/nonvascular_plant_samples_controller.rb on lines 38..46
app/controllers/soil_samples_controller.rb on lines 41..49

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

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 update
    respond_to do |format|
      if @macroinvertebrate_sample.update(macroinvertebrate_sample_params)
        format.html { redirect_to @macroinvertebrate_sample, flash: {success: 'Macroinvertebrate sample was successfully updated.'} }
        format.json { render :show, status: :ok, location: @macroinvertebrate_sample }
Severity: Major
Found in app/controllers/macroinvertebrate_samples_controller.rb and 4 other locations - About 1 hr to fix
app/controllers/fungi_samples_controller.rb on lines 37..45
app/controllers/lichen_samples_controller.rb on lines 37..45
app/controllers/nonvascular_plant_samples_controller.rb on lines 38..46
app/controllers/soil_samples_controller.rb on lines 41..49

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

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