svthalia/concrexit

View on GitHub
website/registrations/tests/test_forms.py

Summary

Maintainability
F
2 wks
Test Coverage

File test_forms.py has 351 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from django.conf import settings
from django.test import TestCase, override_settings
from django.utils import timezone

from freezegun import freeze_time
Severity: Minor
Found in website/registrations/tests/test_forms.py - About 4 hrs to fix

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

        with self.subTest("Member, membership upgrade discount"):
            with freeze_time("2024-08-20"):
                self.data["length"] = Entry.MEMBERSHIP_STUDY
                self.data["membership_type"] = Membership.MEMBER
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 1 day to fix
website/registrations/tests/test_forms.py on lines 180..193

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

        with self.subTest("Member, membership upgrade discount (last year)"):
            with freeze_time("2024-10-20"):
                # The user had a membership last year, but still should get a discount.
                self.data["length"] = Entry.MEMBERSHIP_STUDY
                self.data["membership_type"] = Membership.MEMBER
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 1 day to fix
website/registrations/tests/test_forms.py on lines 166..178

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

        with self.subTest("Benefactor, year member membership after expiry"):
            with freeze_time("2024-09-10"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.MEMBER
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 6 other locations - About 7 hrs to fix
website/registrations/tests/test_forms.py on lines 195..206
website/registrations/tests/test_forms.py on lines 208..219
website/registrations/tests/test_forms.py on lines 221..233
website/registrations/tests/test_forms.py on lines 278..289
website/registrations/tests/test_forms.py on lines 304..315
website/registrations/tests/test_forms.py on lines 317..328

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

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

        with self.subTest("Member, new year membership before expiry"):
            with freeze_time("2024-08-20"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.MEMBER
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 6 other locations - About 7 hrs to fix
website/registrations/tests/test_forms.py on lines 208..219
website/registrations/tests/test_forms.py on lines 221..233
website/registrations/tests/test_forms.py on lines 278..289
website/registrations/tests/test_forms.py on lines 291..302
website/registrations/tests/test_forms.py on lines 304..315
website/registrations/tests/test_forms.py on lines 317..328

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

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

        with self.subTest("Member, new year membership after expiry"):
            with freeze_time("2024-09-10"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.MEMBER
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 6 other locations - About 7 hrs to fix
website/registrations/tests/test_forms.py on lines 195..206
website/registrations/tests/test_forms.py on lines 221..233
website/registrations/tests/test_forms.py on lines 278..289
website/registrations/tests/test_forms.py on lines 291..302
website/registrations/tests/test_forms.py on lines 304..315
website/registrations/tests/test_forms.py on lines 317..328

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

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

        with self.subTest("Benefactor, study membership after expiry"):
            with freeze_time("2024-09-10"):
                self.data["length"] = Entry.MEMBERSHIP_STUDY
                self.data["membership_type"] = Membership.MEMBER
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 6 other locations - About 7 hrs to fix
website/registrations/tests/test_forms.py on lines 195..206
website/registrations/tests/test_forms.py on lines 208..219
website/registrations/tests/test_forms.py on lines 221..233
website/registrations/tests/test_forms.py on lines 278..289
website/registrations/tests/test_forms.py on lines 291..302
website/registrations/tests/test_forms.py on lines 304..315

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

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

        with self.subTest("Benefactor, study membership before expiry"):
            with freeze_time("2024-08-20"):
                self.data["length"] = Entry.MEMBERSHIP_STUDY
                self.data["membership_type"] = Membership.MEMBER
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 6 other locations - About 7 hrs to fix
website/registrations/tests/test_forms.py on lines 195..206
website/registrations/tests/test_forms.py on lines 208..219
website/registrations/tests/test_forms.py on lines 221..233
website/registrations/tests/test_forms.py on lines 278..289
website/registrations/tests/test_forms.py on lines 291..302
website/registrations/tests/test_forms.py on lines 317..328

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

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

        with self.subTest("Benefactor, year member membership before expiry"):
            with freeze_time("2024-08-20"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.MEMBER
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 6 other locations - About 7 hrs to fix
website/registrations/tests/test_forms.py on lines 195..206
website/registrations/tests/test_forms.py on lines 208..219
website/registrations/tests/test_forms.py on lines 221..233
website/registrations/tests/test_forms.py on lines 291..302
website/registrations/tests/test_forms.py on lines 304..315
website/registrations/tests/test_forms.py on lines 317..328

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

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

        with self.subTest("Member, study membership after more than a year"):
            with freeze_time("2025-09-10"):
                # The membership discount applies up to 1 year after the user last had a membership.
                self.data["length"] = Entry.MEMBERSHIP_STUDY
                self.data["membership_type"] = Membership.MEMBER
Severity: Major
Found in website/registrations/tests/test_forms.py and 6 other locations - About 7 hrs to fix
website/registrations/tests/test_forms.py on lines 195..206
website/registrations/tests/test_forms.py on lines 208..219
website/registrations/tests/test_forms.py on lines 278..289
website/registrations/tests/test_forms.py on lines 291..302
website/registrations/tests/test_forms.py on lines 304..315
website/registrations/tests/test_forms.py on lines 317..328

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

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

        with self.subTest("Member, new benefactor membership before expiry"):
            with freeze_time("2024-08-20"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.BENEFACTOR
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 3 other locations - About 6 hrs to fix
website/registrations/tests/test_forms.py on lines 245..253
website/registrations/tests/test_forms.py on lines 258..266
website/registrations/tests/test_forms.py on lines 268..276

Duplicated Code

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

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

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

Tuning

This issue has a mass of 102.

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

        with self.subTest("Benefactor, year benefactor membership before expiry"):
            with freeze_time("2024-08-20"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.BENEFACTOR
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 3 other locations - About 6 hrs to fix
website/registrations/tests/test_forms.py on lines 235..243
website/registrations/tests/test_forms.py on lines 245..253
website/registrations/tests/test_forms.py on lines 268..276

Duplicated Code

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

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

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

Tuning

This issue has a mass of 102.

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

        with self.subTest("Benefactor, year benefactor membership after expiry"):
            with freeze_time("2024-09-10"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.BENEFACTOR
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 3 other locations - About 6 hrs to fix
website/registrations/tests/test_forms.py on lines 235..243
website/registrations/tests/test_forms.py on lines 245..253
website/registrations/tests/test_forms.py on lines 258..266

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

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

        with self.subTest("Member, new benefactor membership before expiry"):
            with freeze_time("2024-09-10"):
                self.data["length"] = Entry.MEMBERSHIP_YEAR
                self.data["membership_type"] = Membership.BENEFACTOR
                form = forms.RenewalForm(self.data)
Severity: Major
Found in website/registrations/tests/test_forms.py and 3 other locations - About 6 hrs to fix
website/registrations/tests/test_forms.py on lines 235..243
website/registrations/tests/test_forms.py on lines 258..266
website/registrations/tests/test_forms.py on lines 268..276

Duplicated Code

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

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

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

Tuning

This issue has a mass of 102.

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

        with self.subTest("Form throws error about membership end"):
            m = Membership.objects.create(
                type=Membership.MEMBER,
                user=self.member,
                since="2017-09-01",
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 5 hrs to fix
website/registrations/tests/test_forms.py on lines 349..361

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

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

        with self.subTest("Form throws error about benefactor type"):
            m = Membership.objects.create(
                type=Membership.BENEFACTOR,
                user=self.member,
                since="2017-09-01",
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 5 hrs to fix
website/registrations/tests/test_forms.py on lines 362..381

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

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

        with self.subTest(length=Entry.MEMBERSHIP_YEAR):
            self.data["length"] = Entry.MEMBERSHIP_YEAR
            form = forms.MemberRegistrationForm(self.data)
            form.is_valid()
            registration = form.save()
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 5 hrs to fix
website/registrations/tests/test_forms.py on lines 59..68

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

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

        with self.subTest(length=Entry.MEMBERSHIP_STUDY):
            self.data["length"] = Entry.MEMBERSHIP_STUDY
            form = forms.MemberRegistrationForm(self.data)
            form.is_valid()
            registration = form.save()
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 5 hrs to fix
website/registrations/tests/test_forms.py on lines 49..58

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

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

        with self.subTest("Form is not valid"):
            self.data["privacy_policy"] = 0
            form = forms.RenewalForm(self.data)
            self.assertFalse(form.is_valid(), msg=dict(form.errors))
Severity: Major
Found in website/registrations/tests/test_forms.py and 2 other locations - About 2 hrs to fix
website/registrations/tests/test_forms.py on lines 39..42
website/registrations/tests/test_forms.py on lines 99..102

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

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

        with self.subTest("Form is not valid"):
            self.data["privacy_policy"] = 0
            form = forms.MemberRegistrationForm(self.data)
            self.assertFalse(form.is_valid(), msg=dict(form.errors))
Severity: Major
Found in website/registrations/tests/test_forms.py and 2 other locations - About 2 hrs to fix
website/registrations/tests/test_forms.py on lines 99..102
website/registrations/tests/test_forms.py on lines 134..137

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

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

        with self.subTest("Form is not valid"):
            self.data["privacy_policy"] = 0
            form = forms.BenefactorRegistrationForm(self.data)
            self.assertFalse(form.is_valid(), msg=dict(form.errors))
Severity: Major
Found in website/registrations/tests/test_forms.py and 2 other locations - About 2 hrs to fix
website/registrations/tests/test_forms.py on lines 39..42
website/registrations/tests/test_forms.py on lines 134..137

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

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

        with self.subTest("Form is valid"):
            form = forms.RenewalForm(self.data)
            self.assertTrue(form.is_valid(), msg=dict(form.errors))
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 1 hr to fix
website/registrations/tests/test_forms.py on lines 96..98

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

        with self.subTest("Form is valid"):
            form = forms.BenefactorRegistrationForm(self.data)
            self.assertTrue(form.is_valid(), msg=dict(form.errors))
Severity: Major
Found in website/registrations/tests/test_forms.py and 1 other location - About 1 hr to fix
website/registrations/tests/test_forms.py on lines 131..133

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

    def test_has_privacy_policy_field(self):
        form = forms.MemberRegistrationForm(self.data)
        self.assertTrue(form.fields["privacy_policy"] is not None)
Severity: Major
Found in website/registrations/tests/test_forms.py and 2 other locations - About 1 hr to fix
website/registrations/tests/test_forms.py on lines 104..106
website/registrations/tests/test_forms.py on lines 154..156

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_has_privacy_policy_field(self):
        form = forms.BenefactorRegistrationForm(self.data)
        self.assertTrue(form.fields["privacy_policy"] is not None)
Severity: Major
Found in website/registrations/tests/test_forms.py and 2 other locations - About 1 hr to fix
website/registrations/tests/test_forms.py on lines 44..46
website/registrations/tests/test_forms.py on lines 154..156

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_has_privacy_policy_field(self):
        form = forms.RenewalForm(self.data)
        self.assertTrue(form.fields["privacy_policy"] is not None)
Severity: Major
Found in website/registrations/tests/test_forms.py and 2 other locations - About 1 hr to fix
website/registrations/tests/test_forms.py on lines 44..46
website/registrations/tests/test_forms.py on lines 104..106

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

There are no issues that match your filters.

Category
Status