scottwillson/racing_on_rails

View on GitHub

Showing 253 of 1,265 total issues

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

    test "set name same name" do
      vanilla = FactoryBot.create(:team, name: "Vanilla Bicycles")
      put :update_attribute,
          params: {
            id: vanilla.to_param,
Severity: Minor
Found in test/controllers/admin/teams_controller_test.rb and 1 other location - About 1 hr to fix
test/controllers/admin/teams_controller_test.rb on lines 146..160

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

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

    test "set name same name different case" do
      vanilla = FactoryBot.create(:team, name: "Vanilla Bicycles")
      put :update_attribute,
          params: {
            id: vanilla.to_param,
Severity: Minor
Found in test/controllers/admin/teams_controller_test.rb and 1 other location - About 1 hr to fix
test/controllers/admin/teams_controller_test.rb on lines 129..143

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

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

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

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

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

Refactorings

Further Reading

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

                   { numeric_place: 4, date: Date.new(2012, 9, 10) },
                   { numeric_place: 5, date: Date.new(2012, 9, 17) },
                   { numeric_place: 4, date: Date.new(2012, 9, 24) },
                   { numeric_place: 6, date: Date.new(2012, 10, 1) },
                   { numeric_place: 8, date: Date.new(2012, 10, 8) }
Severity: Minor
Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 55 mins to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 177..181

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

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

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

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

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

Refactorings

Further Reading

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

        source_results = [
          result(id: 1, event_id: 1, race_id: 1, participant_id: 1, place: "200",
                 member_from: Date.new(2012), member_to: end_of_year, year: 2013, team_member: false),

          result(id: 2, event_id: 1, race_id: 1, participant_id: 1, place: "6",
test_ruby/models/competitions/calculations/select_results_test.rb on lines 209..215

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

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

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

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

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

Refactorings

Further Reading

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

                   { numeric_place: 4, date: Date.new(2012, 9, 10) },
                   { numeric_place: 5, date: Date.new(2012, 9, 17) },
                   { numeric_place: 4, date: Date.new(2012, 9, 24) },
                   { numeric_place: 6, date: Date.new(2012, 10, 1) },
                   { numeric_place: 8, date: Date.new(2012, 10, 8) }
Severity: Minor
Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 55 mins to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 204..208

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

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

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

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

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

Refactorings

Further Reading

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

        source_results = [
          result(id: 1, event_id: 1, race_id: 1, participant_id: 1, place: "200",
                 member_from: Date.new(2012), member_to: end_of_year, year: 2013, team_member: false),

          result(id: 2, event_id: 1, race_id: 1, participant_id: 1, place: "6",
test_ruby/models/competitions/calculations/select_results_test.rb on lines 197..203

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

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

          result(points: 38, participant_id: 1, scores: [
                   { numeric_place: 3, date: Date.new(2012, 9, 17) },
                   { numeric_place: 2, date: Date.new(2012, 9, 24) },
                   { numeric_place: 5, date: Date.new(2012, 10, 1) },
                   { numeric_place: 5, date: Date.new(2012, 10, 8) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 4 other locations - About 55 mins to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 124..129
test_ruby/models/competitions/calculations/place_test.rb on lines 130..135
test_ruby/models/competitions/calculations/place_test.rb on lines 136..141
test_ruby/models/competitions/calculations/place_test.rb on lines 183..188

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

          result(points: 38, participant_id: 3, scores: [
                   { numeric_place: 2, date: Date.new(2012, 9, 10) },
                   { numeric_place: 6, date: Date.new(2012, 9, 24) },
                   { numeric_place: 4, date: Date.new(2012, 10, 1) },
                   { numeric_place: 3, date: Date.new(2012, 10, 8) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 4 other locations - About 55 mins to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 124..129
test_ruby/models/competitions/calculations/place_test.rb on lines 130..135
test_ruby/models/competitions/calculations/place_test.rb on lines 136..141
test_ruby/models/competitions/calculations/place_test.rb on lines 170..175

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

      def setup
        super
        create_administrator_session
        use_ssl

Severity: Major
Found in test/controllers/admin/events/upload_test.rb and 2 other locations - About 55 mins to fix
test/controllers/admin/people/export_test.rb on lines 11..22
test/controllers/admin/people/import_test.rb on lines 11..22

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

      def setup
        super
        create_administrator_session
        use_ssl

Severity: Major
Found in test/controllers/admin/people/export_test.rb and 2 other locations - About 55 mins to fix
test/controllers/admin/events/upload_test.rb on lines 11..22
test/controllers/admin/people/import_test.rb on lines 11..22

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

      def setup
        super
        create_administrator_session
        use_ssl

Severity: Major
Found in test/controllers/admin/people/import_test.rb and 2 other locations - About 55 mins to fix
test/controllers/admin/events/upload_test.rb on lines 11..22
test/controllers/admin/people/export_test.rb on lines 11..22

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

          result(points: 62, participant_id: 3, scores: [
                   { numeric_place: 4, date: Date.new(2012, 10, 11) },
                   { numeric_place: 2, date: Date.new(2012, 10, 12) },
                   { numeric_place: 6, date: Date.new(2012, 10, 19) },
                   { numeric_place: 5, date: Date.new(2012, 10, 26) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 4 other locations - About 55 mins to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 124..129
test_ruby/models/competitions/calculations/place_test.rb on lines 130..135
test_ruby/models/competitions/calculations/place_test.rb on lines 170..175
test_ruby/models/competitions/calculations/place_test.rb on lines 183..188

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

          result(points: 62, participant_id: 1, scores: [
                   { numeric_place: 6, date: Date.new(2012, 10, 2) },
                   { numeric_place: 2, date: Date.new(2012, 10, 19) },
                   { numeric_place: 6, date: Date.new(2012, 11, 1) },
                   { numeric_place: 3, date: Date.new(2012, 11, 2) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 4 other locations - About 55 mins to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 130..135
test_ruby/models/competitions/calculations/place_test.rb on lines 136..141
test_ruby/models/competitions/calculations/place_test.rb on lines 170..175
test_ruby/models/competitions/calculations/place_test.rb on lines 183..188

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

          result(points: 62, participant_id: 2, scores: [
                   { numeric_place: 8, date: Date.new(2012, 10, 11) },
                   { numeric_place: 4, date: Date.new(2012, 10, 12) },
                   { numeric_place: 3, date: Date.new(2012, 10, 19) },
                   { numeric_place: 2, date: Date.new(2012, 11, 9) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 4 other locations - About 55 mins to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 124..129
test_ruby/models/competitions/calculations/place_test.rb on lines 136..141
test_ruby/models/competitions/calculations/place_test.rb on lines 170..175
test_ruby/models/competitions/calculations/place_test.rb on lines 183..188

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 destroy
    @editor = Person.find(params[:editor_id])

    @person.editors.delete @editor if @person.editors.include?(@editor)

Severity: Minor
Found in app/controllers/editors_controller.rb and 1 other location - About 45 mins to fix
app/controllers/editors_controller.rb on lines 8..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 41.

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 create
    @editor = Person.find(params[:editor_id])

    @person.editors << @editor unless @person.editors.include?(@editor)

Severity: Minor
Found in app/controllers/editors_controller.rb and 1 other location - About 45 mins to fix
app/controllers/editors_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 41.

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

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

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

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

Refactorings

Further Reading

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

        def self.series_overall?(event)
          date = event.date
          end_date = event.end_date
          child_dates = if event.calculated? && event.parent
                          event.parent.days
Severity: Minor
Found in app/models/calculations/v3/steps/reject_calculated_events.rb and 1 other location - About 45 mins to fix
app/models/calculations/v3/steps/reject_weekday_events.rb on lines 35..48

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

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

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

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

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

Refactorings

Further Reading

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

        def self.series_overall?(event)
          date = event.date
          end_date = event.end_date
          child_dates = if event.calculated? && event.parent
                          event.parent.days
Severity: Minor
Found in app/models/calculations/v3/steps/reject_weekday_events.rb and 1 other location - About 45 mins to fix
app/models/calculations/v3/steps/reject_calculated_events.rb on lines 34..47

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

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

        expected = [
          result(place: 1, participant_id: 1, points: 1, scores: [{ numeric_place: 1, participant_id: 1, points: 1, event_id: 1 }]),
          result(place: 1, participant_id: 2, points: 1, scores: [{ numeric_place: 2, participant_id: 2, points: 1, event_id: 1 }])
        ]
Severity: Minor
Found in test_ruby/models/competitions/calculations/calculator_test.rb and 1 other location - About 45 mins to fix
test_ruby/models/competitions/calculations/calculator_test.rb on lines 138..141

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

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 person_event
    @event = Event.find(params[:event_id])
    @person = Person.find(params[:person_id])
    @results = Result.person_event @person, @event
  rescue ActiveRecord::RecordNotFound
Severity: Minor
Found in app/controllers/results_controller.rb and 1 other location - About 45 mins to fix
app/controllers/results_controller.rb on lines 79..85

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

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