Cloud-CV/EvalAI

View on GitHub

Showing 705 of 1,371 total issues

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

@api_view(["POST"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/hosts/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["PATCH"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["POST"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

                if serializer.is_valid():
                    leaderboard_data_list.append(serializer)
                else:
                    return Response(
                        serializer.errors, status=status.HTTP_400_BAD_REQUEST
Severity: Minor
Found in apps/jobs/views.py and 2 other locations - About 35 mins to fix
apps/jobs/views.py on lines 1239..1243
apps/jobs/views.py on lines 1635..1639

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

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

@api_view(["GET"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

                if serializer.is_valid():
                    leaderboard_data_list.append(serializer)
                else:
                    return Response(
                        serializer.errors, status=status.HTTP_400_BAD_REQUEST
Severity: Minor
Found in apps/jobs/views.py and 2 other locations - About 35 mins to fix
apps/jobs/views.py on lines 1635..1639
apps/jobs/views.py on lines 1823..1827

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

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

@api_view(["PATCH"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["GET"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["GET"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["GET"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["GET"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

                    models.CharField(
                        choices=[
                            ("Accepted", "Accepted"),
                            ("Denied", "Denied"),
                            ("Pending", "Pending"),
Severity: Minor
Found in apps/hosts/migrations/0001_initial.py and 1 other location - About 35 mins to fix
apps/participants/migrations/0006_alter_status_participant_choices.py on lines 13..22

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

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

@api_view(["GET"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/analytics/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["PATCH"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/jobs/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/accounts/views.py on lines 90..93
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

@api_view(["GET"])
@throttle_classes([UserRateThrottle])
@permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
@authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
Severity: Major
Found in apps/accounts/views.py and 20 other locations - About 35 mins to fix
apps/accounts/views.py on lines 41..44
apps/analytics/views.py on lines 278..281
apps/hosts/views.py on lines 214..217
apps/hosts/views.py on lines 238..241
apps/hosts/views.py on lines 262..265
apps/jobs/views.py on lines 399..402
apps/jobs/views.py on lines 830..833
apps/jobs/views.py on lines 1873..1876
apps/jobs/views.py on lines 1921..1924
apps/jobs/views.py on lines 1992..1995
apps/jobs/views.py on lines 2232..2235
apps/jobs/views.py on lines 2293..2296
apps/jobs/views.py on lines 2389..2392
apps/jobs/views.py on lines 2439..2442
apps/jobs/views.py on lines 2489..2492
apps/jobs/views.py on lines 2525..2528
apps/jobs/views.py on lines 2697..2700
apps/jobs/views.py on lines 2820..2823
apps/jobs/views.py on lines 2917..2920
apps/jobs/views.py on lines 2948..2951

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

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

        migrations.AlterField(
            model_name="participant",
            name="status",
            field=models.CharField(
                choices=[
apps/hosts/migrations/0001_initial.py on lines 33..39

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

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

                total_submissions_done.filter(
                    submitted_at__gte=timezone.now().replace(
Severity: Minor
Found in apps/jobs/models.py and 1 other location - About 35 mins to fix
apps/jobs/utils.py on lines 60..61

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

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

    submissions_done_this_month = submissions_done.filter(
        submitted_at__gte=timezone.now().replace(
Severity: Minor
Found in apps/jobs/utils.py and 1 other location - About 35 mins to fix
apps/jobs/models.py on lines 231..232

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

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

            vm.metaAttributesforCurrentSubmission = vm.submissionMetaAttributes.find(function(element){
                return element["phaseId"] == phaseId;
            }).attributes;
Severity: Minor
Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 35 mins to fix
frontend/src/js/controllers/challengeCtrl.js on lines 861..863

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

            vm.currentPhaseMetaAttributesVisibility = vm.defaultSubmissionMetaAttributes.find(function(element) {
                return element["phaseId"] == phaseId;
            }).defaultAttributes;
Severity: Minor
Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 35 mins to fix
frontend/src/js/controllers/challengeCtrl.js on lines 854..856

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language