scottwillson/racing_on_rails

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

Summary

Maintainability
F
1 wk
Test Coverage

File place_test.rb has 380 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

# :stopdoc:
module Competitions
Severity: Minor
Found in test_ruby/models/competitions/calculations/place_test.rb - About 5 hrs to fix

    Method test_last_result_should_break_tie_different_dates has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def test_last_result_should_break_tie_different_dates
            source_results = [
              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) },
    Severity: Major
    Found in test_ruby/models/competitions/calculations/place_test.rb - About 2 hrs to fix

      Method test_highest_result_breaks_three_way_tie_2 has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def test_highest_result_breaks_three_way_tie_2
              source_results = [
                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) },
      Severity: Minor
      Found in test_ruby/models/competitions/calculations/place_test.rb - About 1 hr to fix

        Method test_highest_result_breaks_three_way_tie has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def test_highest_result_breaks_three_way_tie
                source_results = [
                  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) },
        Severity: Minor
        Found in test_ruby/models/competitions/calculations/place_test.rb - About 1 hr to fix

          Method test_compare_by_most_recent_result has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def test_compare_by_most_recent_result
                  x = Struct::CalculatorResult.new
                  y = Struct::CalculatorResult.new
                  assert_equal 0, Calculator.compare_by_most_recent_result(x, y)
          
          
          Severity: Minor
          Found in test_ruby/models/competitions/calculations/place_test.rb - About 1 hr to fix

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

                    source_results = [
                      result(points: 1, participant_id: 10, scores: [{ numeric_place: 5, date: Date.new(2012) }]),
                      result(points: 10, participant_id: 20, scores: [{ numeric_place: 1, date: Date.new(2012) }]),
                      result(points: 2, participant_id: 30, scores: [{ numeric_place: 3, date: Date.new(2011) }]),
                      result(points: 2, participant_id: 30, scores: [{ numeric_place: 3, date: Date.new(2011) }]),
            Severity: Major
            Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 2 hrs to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 39..45

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

            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, points: 10, scores: [{ numeric_place: 1, date: Date.new(2012) }]),
                      result(place: 2, points: 2,  scores: [{ numeric_place: 3, date: Date.new(2012) }]),
                      result(place: 3, points: 2,  scores: [{ numeric_place: 3, date: Date.new(2011) }]),
                      result(place: 4, points: 2,  scores: [{ numeric_place: 3, date: Date.new(2010) }]),
            Severity: Major
            Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 2 hrs to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 51..57

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

            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(place: 3, points: 62, participant_id: 3, tied: nil, 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 1 hr to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 144..149
            test_ruby/models/competitions/calculations/place_test.rb on lines 150..155
            test_ruby/models/competitions/calculations/place_test.rb on lines 191..196
            test_ruby/models/competitions/calculations/place_test.rb on lines 197..202

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

            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(place: 2, points: 38, participant_id: 1, tied: nil, 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 1 hr to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 144..149
            test_ruby/models/competitions/calculations/place_test.rb on lines 150..155
            test_ruby/models/competitions/calculations/place_test.rb on lines 156..161
            test_ruby/models/competitions/calculations/place_test.rb on lines 191..196

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

            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(place: 2, points: 62, participant_id: 1, tied: nil, 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 1 hr to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 144..149
            test_ruby/models/competitions/calculations/place_test.rb on lines 156..161
            test_ruby/models/competitions/calculations/place_test.rb on lines 191..196
            test_ruby/models/competitions/calculations/place_test.rb on lines 197..202

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

            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(place: 1, points: 62, participant_id: 2, tied: nil, 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 1 hr to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 150..155
            test_ruby/models/competitions/calculations/place_test.rb on lines 156..161
            test_ruby/models/competitions/calculations/place_test.rb on lines 191..196
            test_ruby/models/competitions/calculations/place_test.rb on lines 197..202

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

            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(place: 1, points: 38, participant_id: 3, tied: nil, 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 1 hr to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 144..149
            test_ruby/models/competitions/calculations/place_test.rb on lines 150..155
            test_ruby/models/competitions/calculations/place_test.rb on lines 156..161
            test_ruby/models/competitions/calculations/place_test.rb on lines 197..202

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

            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

                               { 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

            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

            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

                    y = result(scores: [{ date: Date.new(2012, 10, 25), numeric_place: 1 }, { date: Date.new(2012, 10, 3), numeric_place: 1 }, { date: Date.new(2012, 4), numeric_place: 1 }])
            Severity: Minor
            Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 25 mins to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 407..407

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

            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

                    x = result(scores: [{ date: Date.new(2012, 10, 25), numeric_place: 1 }, { date: Date.new(2012, 10, 18), numeric_place: 1 }, { date: Date.new(2012, 4), numeric_place: 1 }])
            Severity: Minor
            Found in test_ruby/models/competitions/calculations/place_test.rb and 1 other location - About 25 mins to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 408..408

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

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

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

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

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

            Refactorings

            Further Reading

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

                    x = result(scores: [{ date: Date.new(2012, 9), numeric_place: 1 }, { date: Date.new(2012, 2), numeric_place: 1 }, { date: Date.new(2012, 4), numeric_place: 1 }])
            Severity: Minor
            Found in test_ruby/models/competitions/calculations/place_test.rb and 3 other locations - About 25 mins to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 399..399
            test_ruby/models/competitions/calculations/place_test.rb on lines 400..400
            test_ruby/models/competitions/calculations/place_test.rb on lines 404..404

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

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

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

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

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

            Refactorings

            Further Reading

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

                    x = result(scores: [{ date: Date.new(2012, 9), numeric_place: 1 }, { date: Date.new(2012, 2), numeric_place: 1 }, { date: Date.new(2012, 4), numeric_place: 1 }])
            Severity: Minor
            Found in test_ruby/models/competitions/calculations/place_test.rb and 3 other locations - About 25 mins to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 400..400
            test_ruby/models/competitions/calculations/place_test.rb on lines 403..403
            test_ruby/models/competitions/calculations/place_test.rb on lines 404..404

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

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

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

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

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

            Refactorings

            Further Reading

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

                    y = result(scores: [{ date: Date.new(2012, 4), numeric_place: 1 }, { date: Date.new(2012, 2), numeric_place: 1 }, { date: Date.new(2012, 10), numeric_place: 1 }])
            Severity: Minor
            Found in test_ruby/models/competitions/calculations/place_test.rb and 3 other locations - About 25 mins to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 399..399
            test_ruby/models/competitions/calculations/place_test.rb on lines 403..403
            test_ruby/models/competitions/calculations/place_test.rb on lines 404..404

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

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

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

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

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

            Refactorings

            Further Reading

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

                    y = result(scores: [{ date: Date.new(2012, 4), numeric_place: 1 }, { date: Date.new(2012, 2), numeric_place: 1 }, { date: Date.new(2012, 4), numeric_place: 1 }])
            Severity: Minor
            Found in test_ruby/models/competitions/calculations/place_test.rb and 3 other locations - About 25 mins to fix
            test_ruby/models/competitions/calculations/place_test.rb on lines 399..399
            test_ruby/models/competitions/calculations/place_test.rb on lines 400..400
            test_ruby/models/competitions/calculations/place_test.rb on lines 403..403

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

            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