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 "mixed canceled states" do
    FactoryBot.create(:discipline, name: "Road")

    SingleDayEvent.create!(date: Date.new(2020, 5, 31), name: "single past")
    single = SingleDayEvent.create!(date: Date.new(2020, 6, 1), name: "single")
Severity: Major
Found in test/models/events/upcoming_test.rb and 1 other location - About 3 days to fix
test/models/events/upcoming_test.rb on lines 320..442

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

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 "mixed postponed states" do
    FactoryBot.create(:discipline, name: "Road")

    SingleDayEvent.create!(date: Date.new(2020, 5, 31), name: "single past")
    single = SingleDayEvent.create!(date: Date.new(2020, 6, 1), name: "single")
Severity: Major
Found in test/models/events/upcoming_test.rb and 1 other location - About 3 days to fix
test/models/events/upcoming_test.rb on lines 194..316

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

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 test_last_event_should_be_more_points
        rules = { double_points_for_last_event: true, maximum_events: 5, end_date: Date.new(2014, 7, 9), point_schedule: [100, 70, 50, 40, 36, 32, 28, 24, 20, 16, 15, 14, 13, 12, 11], members_only: false }
        source_results = [
          { "place" => "1", "date" => Date.new(2014, 6, 4), "event_id" => 1, "race_id" => 1, "participant_id" => 1 },
          { "place" => "3", "date" => Date.new(2014, 6, 11), "event_id" => 2, "race_id" => 2, "participant_id" => 1 },
Severity: Major
Found in test_ruby/models/competitions/calculations/points_test.rb and 1 other location - About 6 hrs to fix
test_ruby/models/competitions/calculations/points_test.rb on lines 112..132

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

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 test_double_points_and_maximum_events
        rules = { double_points_for_last_event: true, maximum_events: 5, end_date: Date.new(2014, 7, 9), point_schedule: [100, 70, 50, 40, 36, 32, 28, 24, 20, 16, 15, 14, 13, 12, 11], members_only: false }
        source_results = [
          { "place" => "10", "date" => Date.new(2014, 6, 4), "event_id" => 1, "race_id" => 1, "participant_id" => 1 },
          { "place" => "9", "date" => Date.new(2014, 6, 11), "event_id" => 2, "race_id" => 2, "participant_id" => 1 },
Severity: Major
Found in test_ruby/models/competitions/calculations/points_test.rb and 1 other location - About 6 hrs to fix
test_ruby/models/competitions/calculations/points_test.rb on lines 135..155

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

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 "import mbra csv" do
    FactoryBot.create(:discipline)
    FactoryBot.create(:discipline, name: "Criterium")
    Team.create!(id: 1_200_000, name: "Bike Team")
    Schedule::Schedule.import(file_fixture("schedule/comma-delimited.csv"))
Severity: Major
Found in test/models/schedule/schedule_test.rb and 1 other location - About 4 hrs to fix
test/models/schedule/schedule_test.rb on lines 347..378

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

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 "import mbra tabbed" do
    FactoryBot.create(:discipline)
    FactoryBot.create(:discipline, name: "Criterium")
    Team.create!(id: 1_200_000, name: "Bike Team")
    Schedule::Schedule.import(file_fixture("schedule/tab-delimited.txt"))
Severity: Major
Found in test/models/schedule/schedule_test.rb and 1 other location - About 4 hrs to fix
test/models/schedule/schedule_test.rb on lines 381..412

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

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

          result(place: 2, participant_id: 2, points: 355, tied: nil, scores: [
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
                   { numeric_place: 2, points: 29, date: Date.new(2015, 9, 13) },
                   { numeric_place: 2, points: 29, date: Date.new(2015, 9, 13) },
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 19) },
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 4 hrs to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 300..313

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

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

          result(place: 1, participant_id: 1, points: 355, tied: nil, scores: [
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
                   { numeric_place: 2, points: 29, date: Date.new(2015, 9, 13) },
                   { numeric_place: 1, points: 30, date: Date.new(2015, 10, 3) },
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 4 hrs to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 314..327

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

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

          result(points: 355, participant_id: 1, scores: [
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
                   { numeric_place: 2, points: 29, date: Date.new(2015, 9, 13) },
                   { numeric_place: 1, points: 30, date: Date.new(2015, 10, 3) },
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 4 hrs to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 284..297

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

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

          result(points: 355, participant_id: 2, scores: [
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 13) },
                   { numeric_place: 2, points: 29, date: Date.new(2015, 9, 13) },
                   { numeric_place: 2, points: 29, date: Date.new(2015, 9, 13) },
                   { numeric_place: 1, points: 30, date: Date.new(2015, 9, 19) },
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 4 hrs to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 270..283

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

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 test_highest_place_in_last_race_breaks_tie
        source_results = [
          result(points: 27, participant_id: 1, scores: [
                   { numeric_place: 1, date: Date.new(2012, 10, 1) },
                   { numeric_place: 2, date: Date.new(2012, 10, 8) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 2 other locations - About 3 hrs to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 96..119
test_ruby/models/competitions/calculations/place_test.rb on lines 242..265

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

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 test_last_result_should_break_tie
        source_results = [
          result(points: 27, participant_id: 1, scores: [
                   { numeric_place: 1, date: Date.new(2012, 10, 1) },
                   { numeric_place: 2, date: Date.new(2012, 10, 19) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 2 other locations - About 3 hrs to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 96..119
test_ruby/models/competitions/calculations/place_test.rb on lines 216..239

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

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 test_highest_result_breaks_tie
        source_results = [
          result(points: 27, participant_id: 1, scores: [
                   { numeric_place: 1, date: Date.new(2012, 10, 1) },
                   { numeric_place: 2, date: Date.new(2012, 10, 8) }
Severity: Major
Found in test_ruby/models/competitions/calculations/place_test.rb and 2 other locations - About 3 hrs to fix
test_ruby/models/competitions/calculations/place_test.rb on lines 216..239
test_ruby/models/competitions/calculations/place_test.rb on lines 242..265

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

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

        categories << Category.find_or_create_by(name: "Masters Men A 40+") if race.name == "Masters 35+ A"
        categories << Category.find_or_create_by(name: "Masters Men B 40+") if race.name == "Masters 35+ B"
        if race.name == "Masters 35+ C"
          categories << Category.find_or_create_by(name: "Masters Men C 40+")
          categories << Category.find_or_create_by(name: "Men C 35+")
Severity: Major
Found in app/models/competitions/cross_crusade_callups.rb and 1 other location - About 3 hrs to fix
app/models/competitions/cross_crusade_callups.rb on lines 38..55

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

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

        categories << Category.find_or_create_by(name: "Masters Men 1/2 40+") if race.name == "Masters 35+ 1/2"
        categories << Category.find_or_create_by(name: "Masters Men 3 40+") if race.name == "Masters 35+ 3"
        if race.name == "Masters 35+ 4"
          categories << Category.find_or_create_by(name: "Masters Men 4 40+")
          categories << Category.find_or_create_by(name: "Men 4 35+")
Severity: Major
Found in app/models/competitions/cross_crusade_callups.rb and 1 other location - About 3 hrs to fix
app/models/competitions/cross_crusade_callups.rb on lines 19..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 123.

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 test_over_maximum
          category = Models::Category.new("Women")
          source_results = []
          source_results << Models::SourceResult.new(id: 0, event_category: Models::EventCategory.new(category), points: 10, place: 7)
          source_results << Models::SourceResult.new(id: 1, event_category: Models::EventCategory.new(category), points: 5, place: 9)
test_ruby/models/calculations/v3/steps/reject_more_than_maximum_events_test.rb on lines 206..221

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

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 test_points_not_place
          category = Models::Category.new("Women")
          source_results = []
          source_results << Models::SourceResult.new(id: 0, event_category: Models::EventCategory.new(category), points: 10, place: 1)
          source_results << Models::SourceResult.new(id: 1, event_category: Models::EventCategory.new(category), points: 50, place: 2)
test_ruby/models/calculations/v3/steps/reject_more_than_maximum_events_test.rb on lines 168..183

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

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

        source_results = [
          result(id: 1, event_id: 1, race_id: 1, place: 1),
          result(id: 2, event_id: 1, race_id: 1, participant_id: 1, place: nil),
          result(id: 3, event_id: 1, race_id: 1, participant_id: 1, place: ""),
          result(id: 4, event_id: 1, race_id: 1, participant_id: 1, place: "DQ"),
test_ruby/models/competitions/calculations/select_results_test.rb on lines 41..51
test_ruby/models/competitions/calculations/select_results_test.rb on lines 86..96

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

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

        source_results = [
          result(id: 1, event_id: 1, race_id: 1, place: 1),
          result(id: 2, event_id: 1, race_id: 1, participant_id: 1, place: nil),
          result(id: 3, event_id: 1, race_id: 1, participant_id: 1, place: ""),
          result(id: 4, event_id: 1, race_id: 1, participant_id: 1, place: "DQ"),
test_ruby/models/competitions/calculations/select_results_test.rb on lines 66..76
test_ruby/models/competitions/calculations/select_results_test.rb on lines 86..96

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

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

        source_results = [
          result(id: 1, event_id: 1, race_id: 1, place: 1),
          result(id: 2, event_id: 1, race_id: 1, participant_id: 1, place: nil),
          result(id: 3, event_id: 1, race_id: 1, participant_id: 1, place: ""),
          result(id: 4, event_id: 1, race_id: 1, participant_id: 1, place: "DQ"),
test_ruby/models/competitions/calculations/select_results_test.rb on lines 41..51
test_ruby/models/competitions/calculations/select_results_test.rb on lines 66..76

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

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