swimlane/swimlane-python

View on GitHub
functional_tests/driver_tests/test_date_time_fields.py

Summary

Maintainability
F
1 wk
Test Coverage

File test_date_time_fields.py has 268 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import pytest
import pendulum
from swimlane import exceptions


Severity: Minor
Found in functional_tests/driver_tests/test_date_time_fields.py - About 2 hrs to fix

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

        def test_date_field_time_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            with pytest.raises(exceptions.ValidationError) as excinfo:
                theRecord["Date"] = pendulum.now().time()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 51..56
    functional_tests/driver_tests/test_date_time_fields.py on lines 64..69
    functional_tests/driver_tests/test_date_time_fields.py on lines 103..108
    functional_tests/driver_tests/test_date_time_fields.py on lines 155..160

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 85.

    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

        def test_datetime_field_date_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            with pytest.raises(exceptions.ValidationError) as excinfo:
                theRecord["Date & Time"] = pendulum.now().date()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 64..69
    functional_tests/driver_tests/test_date_time_fields.py on lines 103..108
    functional_tests/driver_tests/test_date_time_fields.py on lines 116..121
    functional_tests/driver_tests/test_date_time_fields.py on lines 155..160

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 85.

    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

        def test_date_field_string_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            with pytest.raises(exceptions.ValidationError) as excinfo:
                theRecord["Date"] = pendulum.now().to_date_string()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 51..56
    functional_tests/driver_tests/test_date_time_fields.py on lines 64..69
    functional_tests/driver_tests/test_date_time_fields.py on lines 116..121
    functional_tests/driver_tests/test_date_time_fields.py on lines 155..160

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 85.

    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

        def test_time_field_date_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            with pytest.raises(exceptions.ValidationError) as excinfo:
                theRecord["Time"] = pendulum.now().date()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 51..56
    functional_tests/driver_tests/test_date_time_fields.py on lines 64..69
    functional_tests/driver_tests/test_date_time_fields.py on lines 103..108
    functional_tests/driver_tests/test_date_time_fields.py on lines 116..121

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

    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

        def test_datetime_field_time_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            with pytest.raises(exceptions.ValidationError) as excinfo:
                theRecord["Date & Time"] = pendulum.now().time()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 51..56
    functional_tests/driver_tests/test_date_time_fields.py on lines 103..108
    functional_tests/driver_tests/test_date_time_fields.py on lines 116..121
    functional_tests/driver_tests/test_date_time_fields.py on lines 155..160

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 85.

    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_readonly_datetime_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            with pytest.raises(exceptions.ValidationError) as excinfo:
                theRecord["Read-only Date & Time"] = pendulum.now()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 233..238

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

    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_timespan_field_datetime_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            with pytest.raises(exceptions.ValidationError) as excinfo:
                theRecord["Timespan"] = pendulum.now()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 276..281

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

    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

        def test_datetime_field_time(helpers):
            with pytest.raises(exceptions.ValidationError) as excinfo:
                pytest.app.records.create(
                    **{"Required Date & Time": pendulum.now(), "Date & Time": pendulum.now().time()})
            assert str(excinfo.value) == 'Validation failed for <Record: %s - New>. Reason: Field \'Date & Time\' expects one of \'datetime\', got \'Time\' instead' % pytest.app.acronym
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 45..49
    functional_tests/driver_tests/test_date_time_fields.py on lines 97..101
    functional_tests/driver_tests/test_date_time_fields.py on lines 110..114
    functional_tests/driver_tests/test_date_time_fields.py on lines 149..153

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

    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

        def test_datetime_field_date(helpers):
            with pytest.raises(exceptions.ValidationError) as excinfo:
                pytest.app.records.create(
                    **{"Required Date & Time": pendulum.now(), "Date & Time": pendulum.now().date()})
            assert str(excinfo.value) == 'Validation failed for <Record: %s - New>. Reason: Field \'Date & Time\' expects one of \'datetime\', got \'Date\' instead' % pytest.app.acronym
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 58..62
    functional_tests/driver_tests/test_date_time_fields.py on lines 97..101
    functional_tests/driver_tests/test_date_time_fields.py on lines 110..114
    functional_tests/driver_tests/test_date_time_fields.py on lines 149..153

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

    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

        def test_time_field_date(helpers):
            with pytest.raises(exceptions.ValidationError) as excinfo:
                pytest.app.records.create(
                    **{"Required Date & Time": pendulum.now(), "Time": pendulum.now().date()})
            assert str(excinfo.value) == 'Validation failed for <Record: %s - New>. Reason: Field \'Time\' expects one of \'datetime\', \'time\', got \'Date\' instead' % pytest.app.acronym
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 45..49
    functional_tests/driver_tests/test_date_time_fields.py on lines 58..62
    functional_tests/driver_tests/test_date_time_fields.py on lines 97..101
    functional_tests/driver_tests/test_date_time_fields.py on lines 110..114

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

    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

        def test_date_field_string(helpers):
            with pytest.raises(exceptions.ValidationError) as excinfo:
                pytest.app.records.create(
                    **{"Required Date & Time": pendulum.now(), "Date": pendulum.now().to_date_string()})
            assert str(excinfo.value) == 'Validation failed for <Record: %s - New>. Reason: Field \'Date\' expects one of \'datetime\', \'date\', got \'str\' instead' % pytest.app.acronym
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 45..49
    functional_tests/driver_tests/test_date_time_fields.py on lines 58..62
    functional_tests/driver_tests/test_date_time_fields.py on lines 110..114
    functional_tests/driver_tests/test_date_time_fields.py on lines 149..153

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

    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

        def test_date_field_time(helpers):
            with pytest.raises(exceptions.ValidationError) as excinfo:
                pytest.app.records.create(
                    **{"Required Date & Time": pendulum.now(), "Date": pendulum.now().time()})
            assert str(excinfo.value) == 'Validation failed for <Record: %s - New>. Reason: Field \'Date\' expects one of \'datetime\', \'date\', got \'Time\' instead' % pytest.app.acronym
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 4 other locations - About 4 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 45..49
    functional_tests/driver_tests/test_date_time_fields.py on lines 58..62
    functional_tests/driver_tests/test_date_time_fields.py on lines 97..101
    functional_tests/driver_tests/test_date_time_fields.py on lines 149..153

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

    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_timespan_field_datetime(helpers):
            with pytest.raises(exceptions.ValidationError) as excinfo:
                pytest.app.records.create(
                    **{"Required Date & Time": pendulum.now(), "Timespan": pendulum.now()})
            assert str(excinfo.value) == 'Validation failed for <Record: %s - New>. Reason: Field \'Timespan\' expects one of \'timedelta\', got \'DateTime\' instead' % pytest.app.acronym
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 3 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 270..274

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

    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_readonly_datetime(helpers):
            with pytest.raises(exceptions.ValidationError) as excinfo:
                pytest.app.records.create(
                    **{"Required Date & Time": pendulum.now(), "Read-only Date & Time": pendulum.now()})
            assert str(excinfo.value) == 'Validation failed for <Record: %s - New>. Reason: Cannot set readonly field \'Read-only Date & Time\'' % pytest.app.acronym
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 3 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 227..231

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

    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_default_current_field_on_save(helpers):
            newDateTime = pendulum.yesterday()
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            theRecord["Default current Date & Time"] = newDateTime
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 3 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 320..326

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

    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_default_specific_field_on_save(helpers):
            newDateTime = pendulum.yesterday()
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            theRecord["Specific Date & Time"] = newDateTime
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 3 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 297..303

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

    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

        @pytest.mark.xfail(reason="SPT-6352: The Last updated should have been blocked from being set.")
        def test_last_updated_field(helpers):
            datetimeValue = pendulum.yesterday()
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now(), "Last Updated": datetimeValue})
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 3 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 169..174

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

    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

        @pytest.mark.xfail(reason="SPT-6352: The First created should have been blocked from being set.")
        def test_first_created_field(helpers):
            datetimeValue = pendulum.tomorrow()
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now(), "First Created": datetimeValue})
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 3 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 193..198

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

    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

    @pytest.fixture(autouse=True, scope='module')
    def my_fixture(helpers):
        # setup stuff
        defaultApp = 'date time fields'
        pytest.swimlane_instance = helpers.swimlane_instance
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 2 hrs to fix
    functional_tests/driver_tests/test_history_fields.py on lines 5..13

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

    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_date_field_date_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            theRecord["Date"] = pendulum.now().date()
            theRecord.save()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 2 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 131..135

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

    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_default_specific_field(helpers):
            newDateTime = pendulum.yesterday()
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now(), "Specific Date & Time": newDateTime})
            assert theRecord["Specific Date & Time"] == newDateTime
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 2 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 291..295

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

    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_time_field_time_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            theRecord["Time"] = pendulum.now().time()
            theRecord.save()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 2 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 91..95

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

    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_default_current_field(helpers):
            newDateTime = pendulum.yesterday()
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now(), "Default current Date & Time": newDateTime})
            assert theRecord["Default current Date & Time"] == newDateTime
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 2 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 314..318

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

    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_date_field_datetime_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            theRecord["Date"] = pendulum.now()
            theRecord.save()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 2 other locations - About 2 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 39..43
    functional_tests/driver_tests/test_date_time_fields.py on lines 143..147

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

        def test_time_field_datetime_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            theRecord["Time"] = pendulum.now()
            theRecord.save()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 2 other locations - About 2 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 39..43
    functional_tests/driver_tests/test_date_time_fields.py on lines 79..83

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

        def test_datetime_field_datetime_on_save(helpers):
            theRecord = pytest.app.records.create(
                **{"Required Date & Time": pendulum.now()})
            theRecord["Date & Time"] = pendulum.now()
            theRecord.save()
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 2 other locations - About 2 hrs to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 79..83
    functional_tests/driver_tests/test_date_time_fields.py on lines 143..147

    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

            assert theRecord["Date & Time"].in_tz('utc').format(
                'YYYY-MM-DD HH:mm:ss') == timeNow.in_tz('utc').format('YYYY-MM-DD HH:mm:ss')
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 1 hr to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 22..23

    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

            assert theRecord["Required Date & Time"].in_tz('utc').format(
                'YYYY-MM-DD HH:mm:ss') == timeNow.in_tz('utc').format('YYYY-MM-DD HH:mm:ss')
    Severity: Major
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 1 hr to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 36..37

    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

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

            delta = pendulum.datetime(2012, 1, 1, 1, 2, 3) - \
                pendulum.datetime(2011, 12, 31, 22, 2, 3)
    Severity: Minor
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 35 mins to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 220..221

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 33.

    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

            delta = pendulum.datetime(2012, 1, 1, 1, 2, 3) - \
                pendulum.datetime(2011, 12, 31, 22, 2, 3)
    Severity: Minor
    Found in functional_tests/driver_tests/test_date_time_fields.py and 1 other location - About 35 mins to fix
    functional_tests/driver_tests/test_date_time_fields.py on lines 213..214

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

    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