projectcypress/health-data-standards

View on GitHub
test/unit/models/date_shift_test.rb

Summary

Maintainability
B
5 hrs
Test Coverage

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

    def test_record_shift
        date_shift = 99
        values =  [{birthdate: nil, deathdate: nil},
                                                {birthdate: 1, deathdate: nil},
                                                {birthdate: nil, deathdate: 1},
Severity: Major
Found in test/unit/models/date_shift_test.rb and 3 other locations - About 50 mins to fix
test/unit/models/date_shift_test.rb on lines 69..78
test/unit/models/date_shift_test.rb on lines 94..103
test/unit/models/date_shift_test.rb on lines 189..199

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

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

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

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

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

Refactorings

Further Reading

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

    def test_provider_performance_shift

        date_shift = 20
        values =  [{start_date: nil, end_date: nil},
                                                {start_date: 1, end_date: nil},
Severity: Major
Found in test/unit/models/date_shift_test.rb and 3 other locations - About 50 mins to fix
test/unit/models/date_shift_test.rb on lines 69..78
test/unit/models/date_shift_test.rb on lines 94..103
test/unit/models/date_shift_test.rb on lines 205..215

Duplicated Code

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

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

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

Tuning

This issue has a mass of 42.

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

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

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

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

Refactorings

Further Reading

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

    def test_guarantor_shift
        date_shift = 20
        values =  [{start_time: nil, end_time: nil},
                                                {start_time: 1, end_time: nil},
                                                {start_time: nil, end_time: 1},
Severity: Major
Found in test/unit/models/date_shift_test.rb and 3 other locations - About 50 mins to fix
test/unit/models/date_shift_test.rb on lines 69..78
test/unit/models/date_shift_test.rb on lines 189..199
test/unit/models/date_shift_test.rb on lines 205..215

Duplicated Code

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

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

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

Tuning

This issue has a mass of 42.

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

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

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

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

Refactorings

Further Reading

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

    def test_facility_shift
        date_shift = 20
        facility_values =  [{start_time: nil, end_time: nil},
                                                {start_time: 1, end_time: nil},
                                                {start_time: nil, end_time: 1},
Severity: Major
Found in test/unit/models/date_shift_test.rb and 3 other locations - About 50 mins to fix
test/unit/models/date_shift_test.rb on lines 94..103
test/unit/models/date_shift_test.rb on lines 189..199
test/unit/models/date_shift_test.rb on lines 205..215

Duplicated Code

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

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

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

Tuning

This issue has a mass of 42.

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_procedure_shift

        date_shift = 13
        values = ENTRY_VALUES.clone
        pro_values = [{incisionTime: nil}, {incisionTime: 10}]
Severity: Major
Found in test/unit/models/date_shift_test.rb and 2 other locations - About 45 mins to fix
test/unit/models/date_shift_test.rb on lines 31..40
test/unit/models/date_shift_test.rb on lines 125..134

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

    def test_medical_equipment_shift
        date_shift = 13
        values = ENTRY_VALUES.clone
        con_values = [{removalTime: nil}, {removalTime: 10}]
        values.each do |vals|
Severity: Major
Found in test/unit/models/date_shift_test.rb and 2 other locations - About 45 mins to fix
test/unit/models/date_shift_test.rb on lines 31..40
test/unit/models/date_shift_test.rb on lines 174..184

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

    def test_condition_shift
        date_shift = 13
        values = ENTRY_VALUES.clone
        con_values = [{time_of_death: nil}, {time_of_death: 10}]
        values.each do |vals|
Severity: Major
Found in test/unit/models/date_shift_test.rb and 2 other locations - About 45 mins to fix
test/unit/models/date_shift_test.rb on lines 125..134
test/unit/models/date_shift_test.rb on lines 174..184

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

There are no issues that match your filters.

Category
Status