Showing 316 of 5,704 total issues

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

        response = self.client.get(reverse("apps") + "?id=" + str(app.id))
Severity: Major
Found in intranet/apps/cslapps/tests.py and 2 other locations - About 45 mins to fix
intranet/apps/cslapps/tests.py on lines 40..40
intranet/apps/cslapps/tests.py on lines 47..47

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

        self.assertEqual([sponsor, sponsor2], list(EighthActivity.objects.get(id=activity.id).sponsors.all()))
Severity: Minor
Found in intranet/apps/eighth/tests/admin/test_admin_activities.py and 1 other location - About 45 mins to fix
intranet/apps/eighth/tests/admin/test_admin_activities.py on lines 204..204

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

        response = self.client.get(reverse("apps") + "?id=" + str(restricted_app.id))
Severity: Major
Found in intranet/apps/cslapps/tests.py and 2 other locations - About 45 mins to fix
intranet/apps/cslapps/tests.py on lines 24..24
intranet/apps/cslapps/tests.py on lines 40..40

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

    def test_schedule_view(self):
        response = self.client.get(reverse("schedule"))
        self.assertEqual(200, response.status_code)
Severity: Minor
Found in intranet/apps/schedule/tests.py and 1 other location - About 45 mins to fix
intranet/apps/schedule/tests.py on lines 164..166

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

            if (recommendeds.length === 0) {
                $(".recommended-header").addClass("no-activities");
            } else {
                $(".recommended-header").removeClass("no-activities");
            }
Severity: Major
Found in intranet/static/js/eighth/signup.js and 2 other locations - About 40 mins to fix
intranet/static/js/eighth/signup.js on lines 520..524
intranet/static/js/eighth/signup.js on lines 532..536

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

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

    betweenPeriod = function(period1, period2, now) {
        var en = period1.end.date;
        var st = period2.start.date;
        return now >= en && now < st;
    }
Severity: Minor
Found in intranet/static/js/schedule.js and 1 other location - About 40 mins to fix
intranet/static/js/schedule.js on lines 122..126

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

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 (favorites.length === 0) {
                $(".favorites-header").addClass("hidden");
            } else {
                $(".favorites-header").removeClass("hidden");
            }
Severity: Major
Found in intranet/static/js/eighth/signup.js and 2 other locations - About 40 mins to fix
intranet/static/js/eighth/signup.js on lines 532..536
intranet/static/js/eighth/signup.js on lines 544..548

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

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

        $.post("/announcements/" + action + "?" + id, {
            announcement_id: id
        }, function() {
            console.info("Announcement", id, action);
        });
Severity: Minor
Found in intranet/static/js/dashboard/announcements.js and 1 other location - About 40 mins to fix
intranet/static/js/dashboard/events.js on lines 16..20

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

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 (specials.length === 0) {
                $(".special-header").addClass("no-activities");
            } else {
                $(".special-header").removeClass("no-activities");
            }
Severity: Major
Found in intranet/static/js/eighth/signup.js and 2 other locations - About 40 mins to fix
intranet/static/js/eighth/signup.js on lines 520..524
intranet/static/js/eighth/signup.js on lines 544..548

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

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

        $.post("/events/" + action + "?" + id, {
            event_id: id
        }, function() {
            console.info("event", id, action);
        });
Severity: Minor
Found in intranet/static/js/dashboard/events.js and 1 other location - About 40 mins to fix
intranet/static/js/dashboard/announcements.js on lines 72..76

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

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

    withinPeriod = function(period, now) {
        var st = period.start.date;
        var en = period.end.date;
        return now >= st && now < en;
    }
Severity: Minor
Found in intranet/static/js/schedule.js and 1 other location - About 40 mins to fix
intranet/static/js/schedule.js on lines 128..132

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

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

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 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/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 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 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/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 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 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

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 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 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/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 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/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 130..131
intranet/apps/eighth/tests/test_commands.py on lines 164..165
intranet/apps/eighth/tests/test_commands.py on lines 191..192

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

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 193..194
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

Severity
Category
Status
Source
Language