Showing 316 of 5,704 total issues

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

        user = get_user_model().objects.get_or_create(
            username="2021awilliam", graduation_year=get_senior_graduation_year(), user_type="student", last_name="William"
Severity: Major
Found in intranet/apps/eighth/tests/test_commands.py and 9 other locations - About 40 mins to fix
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 193..194
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 233..234
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 280..281
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 311..312
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 336..337
intranet/apps/eighth/tests/test_commands.py on lines 48..49
intranet/apps/eighth/tests/test_commands.py on lines 130..131
intranet/apps/eighth/tests/test_commands.py on lines 191..192
intranet/apps/eighth/tests/test_commands.py on lines 238..239

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

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

            self.assertEqual("2021-03-26", data["days"][-1]["sched_ctx"]["date_today"])  # last day of the week
Severity: Major
Found in intranet/apps/schedule/tests.py and 6 other locations - About 40 mins to fix
intranet/apps/schedule/tests.py on lines 125..125
intranet/apps/schedule/tests.py on lines 126..126
intranet/apps/schedule/tests.py on lines 134..134
intranet/apps/schedule/tests.py on lines 135..135
intranet/apps/schedule/tests.py on lines 136..136
intranet/apps/schedule/tests.py on lines 393..393

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

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

            self.assertEqual("2021-03-22", data["days"][0]["sched_ctx"]["date_today"])  # first day of the week
Severity: Major
Found in intranet/apps/schedule/tests.py and 6 other locations - About 40 mins to fix
intranet/apps/schedule/tests.py on lines 126..126
intranet/apps/schedule/tests.py on lines 127..127
intranet/apps/schedule/tests.py on lines 134..134
intranet/apps/schedule/tests.py on lines 135..135
intranet/apps/schedule/tests.py on lines 136..136
intranet/apps/schedule/tests.py on lines 393..393

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

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

        user = get_user_model().objects.get_or_create(
            username="2021awilliam", graduation_year=get_senior_graduation_year(), user_type="student", last_name="William"
Severity: Major
Found in intranet/apps/eighth/tests/test_commands.py and 9 other locations - About 40 mins to fix
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 193..194
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 233..234
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 280..281
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 311..312
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 336..337
intranet/apps/eighth/tests/test_commands.py on lines 48..49
intranet/apps/eighth/tests/test_commands.py on lines 130..131
intranet/apps/eighth/tests/test_commands.py on lines 164..165
intranet/apps/eighth/tests/test_commands.py on lines 238..239

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

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

    if not settings.PARKING_ENABLED and not request.user.has_admin_permission("parking"):
        return redirect("index")
Severity: Major
Found in intranet/apps/parking/views.py and 3 other locations - About 40 mins to fix
intranet/apps/parking/views.py on lines 19..20
intranet/apps/parking/views.py on lines 85..86
intranet/apps/parking/views.py on lines 140..141

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

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

            self.assertEqual("2021-03-23", data["days"][1]["sched_ctx"]["date_today"])  # second day of the week
Severity: Major
Found in intranet/apps/schedule/tests.py and 6 other locations - About 40 mins to fix
intranet/apps/schedule/tests.py on lines 125..125
intranet/apps/schedule/tests.py on lines 126..126
intranet/apps/schedule/tests.py on lines 127..127
intranet/apps/schedule/tests.py on lines 134..134
intranet/apps/schedule/tests.py on lines 136..136
intranet/apps/schedule/tests.py on lines 393..393

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

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

        user = get_user_model().objects.get_or_create(
            username="2021awilliam", graduation_year=get_senior_graduation_year(), user_type="student", last_name="William"
Severity: Major
Found in intranet/apps/eighth/tests/admin/test_admin_attendance.py and 9 other locations - About 40 mins to fix
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 233..234
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 280..281
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 311..312
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 336..337
intranet/apps/eighth/tests/test_commands.py on lines 48..49
intranet/apps/eighth/tests/test_commands.py on lines 130..131
intranet/apps/eighth/tests/test_commands.py on lines 164..165
intranet/apps/eighth/tests/test_commands.py on lines 191..192
intranet/apps/eighth/tests/test_commands.py on lines 238..239

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

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

        user = get_user_model().objects.get_or_create(
            username="2021awilliam", graduation_year=get_senior_graduation_year(), user_type="student", last_name="William"
Severity: Major
Found in intranet/apps/eighth/tests/test_commands.py and 9 other locations - About 40 mins to fix
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 193..194
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 233..234
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 280..281
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 311..312
intranet/apps/eighth/tests/admin/test_admin_attendance.py on lines 336..337
intranet/apps/eighth/tests/test_commands.py on lines 48..49
intranet/apps/eighth/tests/test_commands.py on lines 164..165
intranet/apps/eighth/tests/test_commands.py on lines 191..192
intranet/apps/eighth/tests/test_commands.py on lines 238..239

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

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

            self.assertEqual("2021-03-26", data["days"][-1]["sched_ctx"]["date_today"])  # last day of the week
Severity: Major
Found in intranet/apps/schedule/tests.py and 6 other locations - About 40 mins to fix
intranet/apps/schedule/tests.py on lines 125..125
intranet/apps/schedule/tests.py on lines 126..126
intranet/apps/schedule/tests.py on lines 127..127
intranet/apps/schedule/tests.py on lines 134..134
intranet/apps/schedule/tests.py on lines 135..135
intranet/apps/schedule/tests.py on lines 393..393

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

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

    if not settings.PARKING_ENABLED and not request.user.has_admin_permission("parking"):
        return redirect("index")
Severity: Major
Found in intranet/apps/parking/views.py and 3 other locations - About 40 mins to fix
intranet/apps/parking/views.py on lines 19..20
intranet/apps/parking/views.py on lines 34..35
intranet/apps/parking/views.py on lines 85..86

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

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

            self.assertEqual("2021-03-23", data["days"][1]["sched_ctx"]["date_today"])  # second day of the week
Severity: Major
Found in intranet/apps/schedule/tests.py and 6 other locations - About 40 mins to fix
intranet/apps/schedule/tests.py on lines 125..125
intranet/apps/schedule/tests.py on lines 127..127
intranet/apps/schedule/tests.py on lines 134..134
intranet/apps/schedule/tests.py on lines 135..135
intranet/apps/schedule/tests.py on lines 136..136
intranet/apps/schedule/tests.py on lines 393..393

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

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

        self.assertEqual("Hello Day", response_data["results"][0]["day_type"]["name"])
Severity: Major
Found in intranet/apps/schedule/tests.py and 6 other locations - About 40 mins to fix
intranet/apps/schedule/tests.py on lines 125..125
intranet/apps/schedule/tests.py on lines 126..126
intranet/apps/schedule/tests.py on lines 127..127
intranet/apps/schedule/tests.py on lines 134..134
intranet/apps/schedule/tests.py on lines 135..135
intranet/apps/schedule/tests.py on lines 136..136

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

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

        self.assertEqual(response.client.cookies["accessed_csl-app_" + str(app.id)].value, "1")
Severity: Minor
Found in intranet/apps/cslapps/tests.py and 1 other location - About 40 mins to fix
intranet/apps/cslapps/tests.py on lines 49..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 34.

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

        self.assertEqual(response.client.cookies["accessed_csl-app_" + str(app.id)].value, "1")
Severity: Minor
Found in intranet/apps/cslapps/tests.py and 1 other location - About 40 mins to fix
intranet/apps/cslapps/tests.py on lines 28..28

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

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

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

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

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

Refactorings

Further Reading

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

    def queryset(self, request, queryset):
        if self.value():
            return queryset.filter(method=self.value())
        return queryset
Severity: Minor
Found in intranet/apps/logs/admin.py and 1 other location - About 40 mins to fix
intranet/apps/logs/admin.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 34.

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

        self.assertEqual([sponsor], list(EighthActivity.objects.get(id=activity.id).sponsors.all()))
Severity: Major
Found in intranet/apps/eighth/tests/admin/test_admin_activities.py and 2 other locations - About 40 mins to fix
intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 158..158
intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 262..262

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

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

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

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

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

Refactorings

Further Reading

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

    def queryset(self, request, queryset):
        if self.value():
            return queryset.filter(path__startswith=self.value())
        return queryset
Severity: Minor
Found in intranet/apps/logs/admin.py and 1 other location - About 40 mins to fix
intranet/apps/logs/admin.py on lines 59..62

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

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

                if now.hour < 17:
                    now = now.replace(hour=0, minute=0, second=0, microsecond=0)
Severity: Minor
Found in intranet/apps/dashboard/views.py and 1 other location - About 40 mins to fix
intranet/apps/dashboard/views.py on lines 41..42

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

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

            if now.hour < 17:
                now = now.replace(hour=0, minute=0, second=0, microsecond=0)
Severity: Minor
Found in intranet/apps/dashboard/views.py and 1 other location - About 40 mins to fix
intranet/apps/dashboard/views.py on lines 326..327

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

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

        self.assertEqual([sponsor], list(EighthActivity.objects.get(id=activity.id).sponsors.all()))
Severity: Major
Found in intranet/apps/eighth/tests/admin/test_admin_activities.py and 2 other locations - About 40 mins to fix
intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 120..120
intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 262..262

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

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