svthalia/concrexit

View on GitHub

Showing 374 of 705 total issues

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

        cls.account1 = BankAccount.objects.create(
            owner=cls.user,
Severity: Minor
Found in website/payments/tests/api/v1/test_viewsets_payments.py and 1 other location - About 55 mins to fix
website/payments/tests/api/v2/test_views.py on lines 20..21

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

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

        return Response(
            {
                "liked": photo.likes.filter(member=request.member).exists(),
                "num_likes": photo.num_likes,
            },
Severity: Major
Found in website/photos/api/v2/views.py and 2 other locations - About 55 mins to fix
website/photos/api/v2/views.py on lines 132..137
website/photos/api/v2/views.py on lines 151..157

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

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

class ThabloidDetailView(RetrieveAPIView):
    """Returns details about a specific Thabloid."""

    serializer_class = ThabloidSerializer

Severity: Minor
Found in website/thabloid/api/v2/views.py and 1 other location - About 55 mins to fix
website/partners/api/v2/views.py on lines 64..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 37.

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

class CommitteeSitemap(sitemaps.Sitemap):
    def items(self):
        return models.Committee.active_objects.all()

    def location(self, item):
Severity: Minor
Found in website/activemembers/sitemaps.py and 1 other location - About 55 mins to fix
website/activemembers/sitemaps.py on lines 30..35

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

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

        if created:
            return Response(
                {
                    "liked": photo.likes.filter(member=request.member).exists(),
                    "num_likes": photo.num_likes,
Severity: Major
Found in website/photos/api/v2/views.py and 2 other locations - About 55 mins to fix
website/photos/api/v2/views.py on lines 132..137
website/photos/api/v2/views.py on lines 159..164

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

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

        cls.account1 = BankAccount.objects.create(
            owner=cls.login_user,
Severity: Minor
Found in website/payments/tests/api/v2/test_views.py and 1 other location - About 55 mins to fix
website/payments/tests/api/v1/test_viewsets_payments.py on lines 34..35

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

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

        context[
            "has_rejected_reference_faces"
        ] = self.request.member.reference_faces.filter(
            status=ReferenceFace.Status.REJECTED,
Severity: Major
Found in website/facedetection/views.py and 2 other locations - About 50 mins to fix
website/facedetection/views.py on lines 39..42
website/facedetection/views.py on lines 77..80

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

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

        context[
            "has_rejected_reference_faces"
        ] = self.request.member.reference_faces.filter(
            status=ReferenceFace.Status.REJECTED,
Severity: Major
Found in website/facedetection/views.py and 2 other locations - About 50 mins to fix
website/facedetection/views.py on lines 39..42
website/facedetection/views.py on lines 46..49

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

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

        context[
            "has_processing_reference_faces"
        ] = self.request.member.reference_faces.filter(
            status=ReferenceFace.Status.PROCESSING,
Severity: Major
Found in website/facedetection/views.py and 2 other locations - About 50 mins to fix
website/facedetection/views.py on lines 46..49
website/facedetection/views.py on lines 77..80

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

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

        OrderItem.objects.create(
            order=o2,
            product=self.shift.product_list.product_items.get(product=self.soda),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=o5,
            product=self.shift.product_list.product_items.get(product=self.wine),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421

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

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

        OrderItem.objects.create(
            order=o1,
            product=self.shift.product_list.product_items.get(product=self.beer),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=o3,
            product=self.shift.product_list.product_items.get(product=self.wine),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=o5,
            product=self.shift.product_list.product_items.get(product=self.beer),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=order4,
            product=self.shift.product_list.product_items.get(product=self.beer),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=order,
            product=self.shift.product_list.product_items.get(product=self.beer),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=o4,
            product=self.shift.product_list.product_items.get(product=self.wine),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=o3,
            product=self.shift.product_list.product_items.get(product=self.beer),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 335..337
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

        OrderItem.objects.create(
            order=order2,
            product=self.shift.product_list.product_items.get(product=self.soda),
Severity: Major
Found in website/sales/tests/test_models.py and 11 other locations - About 45 mins to fix
website/sales/tests/test_models.py on lines 197..199
website/sales/tests/test_models.py on lines 233..236
website/sales/tests/test_models.py on lines 343..345
website/sales/tests/test_models.py on lines 351..353
website/sales/tests/test_models.py on lines 390..392
website/sales/tests/test_models.py on lines 396..398
website/sales/tests/test_models.py on lines 402..404
website/sales/tests/test_models.py on lines 407..409
website/sales/tests/test_models.py on lines 413..415
website/sales/tests/test_models.py on lines 419..421
website/sales/tests/test_models.py on lines 424..426

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

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

            with self.subTest("Already has study-time membership."):
                with self.assertRaises(PaymentError):
                    create_payment(self.renewal, self.admin, Payment.CASH)
Severity: Minor
Found in website/registrations/tests/test_services.py and 1 other location - About 45 mins to fix
website/registrations/tests/test_services.py on lines 571..573

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

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