scottwillson/racing_on_rails

View on GitHub
test_ruby/models/competitions/calculations/calculator_test.rb

Summary

Maintainability
D
2 days
Test Coverage

File calculator_test.rb has 353 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_relative "../../../../app/models/competitions/calculations/calculator"
require_relative "calculations_test"

# :stopdoc:
# TODO remove noisy member setup
Severity: Minor
Found in test_ruby/models/competitions/calculations/calculator_test.rb - About 4 hrs to fix

    Class CalculatorTest has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class CalculatorTest < CalculationsTest
          def test_calculate_with_no_source_results
            assert_equal [], Calculator.calculate([])
          end
    
    
    Severity: Minor
    Found in test_ruby/models/competitions/calculations/calculator_test.rb - About 2 hrs to fix

      Method test_calculate_team_results_best_3_for_event has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def test_calculate_team_results_best_3_for_event
              source_results = [
                { event_id: 1, race_id: 1, participant_id: 1, place: 107 },
                { event_id: 1, race_id: 1, participant_id: 1, place: 7 },
                { event_id: 1, race_id: 1, participant_id: 2, place: 1 },
      Severity: Minor
      Found in test_ruby/models/competitions/calculations/calculator_test.rb - About 1 hr to fix

        Method test_missing_result_penalty has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def test_missing_result_penalty
                source_results = [
                  { event_id: 1, participant_id: 10, place: 2, race_id: 100 },
                  { event_id: 1, participant_id: 10, place: 4, race_id: 100 },
                  { event_id: 1, participant_id: 20, place: 5, race_id: 100 },
        Severity: Minor
        Found in test_ruby/models/competitions/calculations/calculator_test.rb - About 1 hr to fix

          TODO found
          Open

          # TODO remove noisy member setup

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

                def test_calculate_ignore_non_starters
                  source_results = [
                    { event_id: 1, participant_id: 1, place: "", member_from: Date.new(2012), member_to: end_of_year },
                    { event_id: 1, participant_id: 2, place: "DNS", member_from: Date.new(2012), member_to: end_of_year },
                    { event_id: 1, participant_id: 3, place: "DQ", member_from: Date.new(2012), member_to: end_of_year },
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 87..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 65.

          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_calculate_should_ignore_non_scoring_results
                  source_results = [
                    { event_id: 1, participant_id: 1, place: "", member_from: Date.new(2012), member_to: end_of_year },
                    { event_id: 1, participant_id: 2, place: "DNS", member_from: Date.new(2012), member_to: end_of_year },
                    { event_id: 1, participant_id: 3, place: "DQ", member_from: Date.new(2012), member_to: end_of_year },
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 99..108

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

          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 = [
                    { "place" => "1", "participant_id" => 1, "event_id" => 1, "race_id" => 1 },
                    { "place" => "2", "participant_id" => 2, "event_id" => 1, "race_id" => 1 },
                    { "place" => "3", "participant_id" => 3, "event_id" => 1, "race_id" => 1 },
                    { "place" => "1", "participant_id" => 1, "event_id" => 2, "race_id" => 2 },
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 318..325

          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

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

                  source_results = [
                    { "place" => "1", "participant_id" => 1, "event_id" => 1, "race_id" => 1 },
                    { "place" => "2", "participant_id" => 2, "event_id" => 1, "race_id" => 1 },
                    { "place" => "3", "participant_id" => 3, "event_id" => 1, "race_id" => 1 },
                    { "place" => "1", "participant_id" => 1, "event_id" => 2, "race_id" => 2 },
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 264..271

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

                  expected = [
                    result(place: 1, participant_id: 1, points: 51, scores: [
                             { numeric_place: 6, participant_id: 1, points: 46, event_id: 1 },
                             { numeric_place: 1, participant_id: 1, points: 5, event_id: 2, upgrade: true }
                           ]),
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 348..356

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

          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: 49.5, scores: [
                             { numeric_place: 6, participant_id: 1, points: 46, event_id: 1 },
                             { numeric_place: 1, participant_id: 1, points: 3.5, event_id: 2, upgrade: true }
                           ]),
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 368..376

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

          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

                  expected = [
                    result(place: 1, participant_id: 1, points: 2.0, scores: [{ numeric_place: 2, participant_id: 1, points: 2.0, event_id: 1 }]),
                    result(place: 2, participant_id: 2, points: 5.0, scores: [{ numeric_place: 5, participant_id: 2, points: 5.0, 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 29..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 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

                  source_results = [
                    { "place" => "6", "participant_id" => 1, "event_id" => 1, "race_id" => 1, "field_size" => 51 },
                    { "place" => "1", "participant_id" => 1, "event_id" => 2, "race_id" => 2, "field_size" => 22, "points" => 20, "upgrade" => true },
                    { "place" => "3", "participant_id" => 2, "event_id" => 3, "race_id" => 3, "field_size" => 9 }
                  ]
          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 343..347

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

          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

                  source_results = [
                    { "place" => "6", "participant_id" => 1, "event_id" => 1, "race_id" => 1, "field_size" => 51 },
                    { "place" => "1", "participant_id" => 1, "event_id" => 2, "race_id" => 2, "field_size" => 22, "points" => 7, "upgrade" => true },
                    { "place" => "3", "participant_id" => 2, "event_id" => 3, "race_id" => 3, "field_size" => 9 }
                  ]
          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 363..367

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

          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

                             { numeric_place: 1, participant_id: 1, points: 10, event_id: 2 },
                             { numeric_place: 2, participant_id: 1, points: 9, event_id: 1 },
                             { numeric_place: 3, participant_id: 1, points: 8, event_id: 1 },
                             { numeric_place: 4, participant_id: 1, points: 7, event_id: 1 }
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 1 other location - About 40 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 156..159

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

          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

                    { event_id: 1, participant_id: 10, place: 2, race_id: 100 },
                    { event_id: 1, participant_id: 10, place: 4, race_id: 100 },
                    { event_id: 1, participant_id: 20, place: 5, race_id: 100 },
                    { event_id: 1, participant_id: 10, place: 5, race_id: 200 }
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 1 other location - About 40 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 67..70

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

          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

                    result(place: 1, participant_id: 1, points: 2, preliminary: nil, scores: [
                             { numeric_place: 1, participant_id: 1, points: 1, event_id: 1 },
                             { numeric_place: 1, participant_id: 1, points: 1, event_id: 2 }
                           ]),
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 2 other locations - About 25 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 304..307
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 332..335

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

          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

                    result(place: 2, participant_id: 2, points: 2, preliminary: nil, scores: [
                             { numeric_place: 2, participant_id: 2, points: 1, event_id: 1 },
                             { numeric_place: 2, participant_id: 2, points: 1, event_id: 2 }
                           ])
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 2 other locations - About 25 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 300..303
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 304..307

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

          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

                    result(place: 2, participant_id: 2, points: 2, preliminary: nil, scores: [
                             { numeric_place: 2, participant_id: 2, points: 1, event_id: 1 },
                             { numeric_place: 2, participant_id: 2, points: 1, event_id: 2 }
                           ]),
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 2 other locations - About 25 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 300..303
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 332..335

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

          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

                    { event_id: 1, participant_id: 1, place: 2, race_id: 1 },
                    { event_id: 1, participant_id: 1, place: 4, race_id: 1 },
                    { event_id: 1, participant_id: 2, place: 5, race_id: 1 }
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 2 other locations - About 20 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 274..276
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 328..330

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

          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

                             { numeric_place: 1, participant_id: 1, points: 1, event_id: 1 },
                             { numeric_place: 1, participant_id: 1, points: 1, event_id: 2 },
                             { numeric_place: 3, participant_id: 1, points: 1, event_id: 3 }
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 2 other locations - About 20 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 134..136
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 274..276

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

          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

                             { numeric_place: 1, participant_id: 1, points: 1, event_id: 1 },
                             { numeric_place: 1, participant_id: 1, points: 1, event_id: 2 },
                             { numeric_place: 3, participant_id: 1, points: 1, event_id: 3 }
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/calculator_test.rb and 2 other locations - About 20 mins to fix
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 134..136
          test_ruby/models/competitions/calculations/calculator_test.rb on lines 328..330

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

          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

          There are no issues that match your filters.

          Category
          Status