svthalia/concrexit

View on GitHub

Showing 374 of 702 total issues

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

        with self.subTest("Payments that are 7 years old must be minimised"):
            p = Payment.objects.create(
                paid_by=self.member,
                amount=1,
                created_at=timezone.now() - timezone.timedelta(days=(365 * 7) + 1),
Severity: Major
Found in website/payments/tests/test_services.py and 1 other location - About 6 hrs to fix
website/payments/tests/test_services.py on lines 256..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 108.

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("Dry run should not actually delete"):
            p = Payment.objects.create(
                paid_by=self.member,
                amount=1,
                created_at=timezone.now() - timezone.timedelta(days=(365 * 7) + 1),
Severity: Major
Found in website/payments/tests/test_services.py and 1 other location - About 6 hrs to fix
website/payments/tests/test_services.py on lines 232..242

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

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("send_notification=False, registration not required"):
            food_event = FoodEvent.objects.create(
                event=self.event,
                send_notification=False,
                start=self.time + timezone.timedelta(days=1),
Severity: Major
Found in website/pushnotifications/tests/test_pizzas.py and 1 other location - About 6 hrs to fix
website/pushnotifications/tests/test_pizzas.py on lines 98..108

Duplicated Code

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

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

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

Tuning

This issue has a mass of 105.

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("send_notification=False, registration required"):
            food_event = FoodEvent.objects.create(
                event=self.event,
                send_notification=False,
                start=self.time + timezone.timedelta(days=1),
Severity: Major
Found in website/pushnotifications/tests/test_pizzas.py and 1 other location - About 6 hrs to fix
website/pushnotifications/tests/test_pizzas.py on lines 60..70

Duplicated Code

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

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

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

Tuning

This issue has a mass of 105.

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 freeze_time("2023-08-27"):
            with self.subTest(
                "Discounted membership upgrade before membership expiry."
            ):
                create_payment(self.renewal, self.admin, Payment.CASH)
Severity: Major
Found in website/registrations/tests/test_services.py and 2 other locations - About 6 hrs to fix
website/registrations/tests/test_services.py on lines 529..538
website/registrations/tests/test_services.py on lines 582..591

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

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 freeze_time("2023-09-10"):
            with self.subTest("Non-discounted membership upgrade."):
                create_payment(self.renewal, self.admin, Payment.CASH)

                self.renewal.refresh_from_db()
Severity: Major
Found in website/registrations/tests/test_services.py and 2 other locations - About 6 hrs to fix
website/registrations/tests/test_services.py on lines 501..512
website/registrations/tests/test_services.py on lines 529..538

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

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 freeze_time("2023-09-10"):
            with self.subTest("Discounted membership upgrade after membership expiry."):
                create_payment(self.renewal, self.admin, Payment.CASH)

                self.renewal.refresh_from_db()
Severity: Major
Found in website/registrations/tests/test_services.py and 2 other locations - About 6 hrs to fix
website/registrations/tests/test_services.py on lines 501..512
website/registrations/tests/test_services.py on lines 582..591

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

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

    @mock.patch("registrations.emails.send_email")
    def test_send_renewal_complete_message(self, send_email):
        member = Member(
            email="test@example.org",
            first_name="John",
Severity: Major
Found in website/registrations/tests/test_emails.py and 1 other location - About 6 hrs to fix
website/registrations/tests/test_emails.py on lines 152..170

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

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

    @mock.patch("registrations.emails.send_email")
    def test_send_renewal_rejected_message(self, send_email):
        member = Member(
            email="test@example.org",
            first_name="John",
Severity: Major
Found in website/registrations/tests/test_emails.py and 1 other location - About 6 hrs to fix
website/registrations/tests/test_emails.py on lines 173..191

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

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("An iCIS employee"):
            self.view.post(request)

            request = super_post.call_args[0][0]
            self.assertEqual(request.POST["membership_type"], Membership.BENEFACTOR)
Severity: Major
Found in website/registrations/tests/test_views.py and 1 other location - About 6 hrs to fix
website/registrations/tests/test_views.py on lines 361..367

Duplicated Code

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

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

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

Tuning

This issue has a mass of 98.

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("No iCIS employee"):
            self.view.post(request)

            request = super_post.call_args[0][0]
            self.assertEqual(request.POST["membership_type"], Membership.BENEFACTOR)
Severity: Major
Found in website/registrations/tests/test_views.py and 1 other location - About 6 hrs to fix
website/registrations/tests/test_views.py on lines 375..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 98.

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("Renewal"):
            response = self.client.get(
                reverse("registrations:reference", args=(self.renewal.pk,))
            )
            self.assertEqual(200, response.status_code)
Severity: Major
Found in website/registrations/tests/test_views.py and 1 other location - About 5 hrs to fix
website/registrations/tests/test_views.py on lines 678..686

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

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

Severity
Category
Status
Source
Language