Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

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

        SELF.apiService.deleteUrl(deleteUrl + team.participantId).subscribe(
          (data) => {
            // Success Message in data.message
            SELF.globalService.showToast('success', 'Member was removed from the team!', 5);
            SELF.fetchMyTeams(SELF.fetchTeamsPath);
frontend_v2/src/app/components/publiclists/teamlist/teamlist.component.ts on lines 428..439
frontend_v2/src/app/components/publiclists/teamlist/teamlist.component.ts on lines 469..480

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

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 (data.count === 0) {
            SELF.paginationDetails.showPagination = false;
            SELF.paginationDetails.paginationMessage = 'No results found';
          } else {
            SELF.paginationDetails.showPagination = true;
frontend_v2/src/app/components/challenge/challengesubmissions/challengesubmissions.component.ts on lines 294..300

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

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

Function run has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def run(*args):
    try:
        NUMBER_OF_CHALLENGES = int(args[0])
        status = check_database()
        if status is False:
Severity: Minor
Found in scripts/seed.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function change_submission_data_and_visibility has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def change_submission_data_and_visibility(
    request, challenge_pk, challenge_phase_pk, submission_pk
):
    """
    API Endpoint for updating the submission meta data
Severity: Minor
Found in apps/jobs/views.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function update_allowed_email_ids has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def update_allowed_email_ids(request, challenge_pk, phase_pk):
    """
    API to GET/UPDATE/DELETE email ids from challenge phase allowed email ids
    Arguments:
        challenge_pk {int} -- Challenge primary key
Severity: Minor
Found in apps/challenges/views.py - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function ngOnInit has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  ngOnInit() {
    if (!this.type || this.type === 'email') {
      if (this.type === 'email') {
        this.isEmail = true;
      }
Severity: Minor
Found in frontend_v2/src/app/components/utility/input/input.component.ts - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

apps/challenges/migrations/0004_challenge_is_disabled.py on lines 0..16
apps/challenges/migrations/0009_challengephase_is_public.py on lines 0..16
apps/challenges/migrations/0030_add_boolean_field_in_star_model.py on lines 0..16
apps/challenges/migrations/0053_added_is_registration_open_field.py on lines 0..16
apps/challenges/migrations/0055_add_is_leaderboard_order_descending_in_phase_split_model.py on lines 0..16
apps/challenges/migrations/0058_add_show_leaderboard_by_latest_submission_field_in_challenge_phase_split_model.py on lines 0..21
apps/challenges/migrations/0064_add_is_restricted_to_select_one_submission_field_in_phase_model.py on lines 0..18
apps/challenges/migrations/0066_added_is_partial_submission_evaluation_enabled_field_in_phase_model.py on lines 0..21
apps/challenges/migrations/0073_add_inform_hosts_field.py on lines 0..18
apps/jobs/migrations/0007_add_is_flagged_field.py on lines 0..16
apps/jobs/migrations/0011_Change_submission_visibility_default_to_public.py on lines 0..16
apps/jobs/migrations/0012_add_baseline_submission.py on lines 0..18
apps/jobs/migrations/0016_add_ignore_submission_boolean_field_in_submission_model.py on lines 0..16
apps/web/migrations/0005_modified_default_attribute_of_visible_field_to_false.py on lines 0..16

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

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

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

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

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

Refactorings

Further Reading

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

    for participant_email in all_participants_email:
        if participant_email in challenge.banned_email_ids:
            message = "You're a part of {} team and it has been banned from this challenge. \
            Please contact the challenge host.".format(
                participant_team.team_name
Severity: Major
Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
apps/jobs/views.py on lines 253..261
apps/jobs/views.py on lines 2602..2609
apps/jobs/views.py on lines 2775..2782

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

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

Severity: Major
Found in apps/jobs/migrations/0012_add_baseline_submission.py and 14 other locations - About 2 hrs to fix
apps/challenges/migrations/0004_challenge_is_disabled.py on lines 0..16
apps/challenges/migrations/0009_challengephase_is_public.py on lines 0..16
apps/challenges/migrations/0025_added_is_submission_pubblic_field.py on lines 0..16
apps/challenges/migrations/0030_add_boolean_field_in_star_model.py on lines 0..16
apps/challenges/migrations/0053_added_is_registration_open_field.py on lines 0..16
apps/challenges/migrations/0055_add_is_leaderboard_order_descending_in_phase_split_model.py on lines 0..16
apps/challenges/migrations/0058_add_show_leaderboard_by_latest_submission_field_in_challenge_phase_split_model.py on lines 0..21
apps/challenges/migrations/0064_add_is_restricted_to_select_one_submission_field_in_phase_model.py on lines 0..18
apps/challenges/migrations/0066_added_is_partial_submission_evaluation_enabled_field_in_phase_model.py on lines 0..21
apps/challenges/migrations/0073_add_inform_hosts_field.py on lines 0..18
apps/jobs/migrations/0007_add_is_flagged_field.py on lines 0..16
apps/jobs/migrations/0011_Change_submission_visibility_default_to_public.py on lines 0..16
apps/jobs/migrations/0016_add_ignore_submission_boolean_field_in_submission_model.py on lines 0..16
apps/web/migrations/0005_modified_default_attribute_of_visible_field_to_false.py on lines 0..16

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

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

Severity: Major
Found in apps/jobs/migrations/0007_add_is_flagged_field.py and 14 other locations - About 2 hrs to fix
apps/challenges/migrations/0004_challenge_is_disabled.py on lines 0..16
apps/challenges/migrations/0009_challengephase_is_public.py on lines 0..16
apps/challenges/migrations/0025_added_is_submission_pubblic_field.py on lines 0..16
apps/challenges/migrations/0030_add_boolean_field_in_star_model.py on lines 0..16
apps/challenges/migrations/0053_added_is_registration_open_field.py on lines 0..16
apps/challenges/migrations/0055_add_is_leaderboard_order_descending_in_phase_split_model.py on lines 0..16
apps/challenges/migrations/0058_add_show_leaderboard_by_latest_submission_field_in_challenge_phase_split_model.py on lines 0..21
apps/challenges/migrations/0064_add_is_restricted_to_select_one_submission_field_in_phase_model.py on lines 0..18
apps/challenges/migrations/0066_added_is_partial_submission_evaluation_enabled_field_in_phase_model.py on lines 0..21
apps/challenges/migrations/0073_add_inform_hosts_field.py on lines 0..18
apps/jobs/migrations/0011_Change_submission_visibility_default_to_public.py on lines 0..16
apps/jobs/migrations/0012_add_baseline_submission.py on lines 0..18
apps/jobs/migrations/0016_add_ignore_submission_boolean_field_in_submission_model.py on lines 0..16
apps/web/migrations/0005_modified_default_attribute_of_visible_field_to_false.py on lines 0..16

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

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

apps/challenges/migrations/0004_challenge_is_disabled.py on lines 0..16
apps/challenges/migrations/0009_challengephase_is_public.py on lines 0..16
apps/challenges/migrations/0025_added_is_submission_pubblic_field.py on lines 0..16
apps/challenges/migrations/0030_add_boolean_field_in_star_model.py on lines 0..16
apps/challenges/migrations/0053_added_is_registration_open_field.py on lines 0..16
apps/challenges/migrations/0055_add_is_leaderboard_order_descending_in_phase_split_model.py on lines 0..16
apps/challenges/migrations/0058_add_show_leaderboard_by_latest_submission_field_in_challenge_phase_split_model.py on lines 0..21
apps/challenges/migrations/0064_add_is_restricted_to_select_one_submission_field_in_phase_model.py on lines 0..18
apps/challenges/migrations/0066_added_is_partial_submission_evaluation_enabled_field_in_phase_model.py on lines 0..21
apps/challenges/migrations/0073_add_inform_hosts_field.py on lines 0..18
apps/jobs/migrations/0007_add_is_flagged_field.py on lines 0..16
apps/jobs/migrations/0011_Change_submission_visibility_default_to_public.py on lines 0..16
apps/jobs/migrations/0012_add_baseline_submission.py on lines 0..18
apps/web/migrations/0005_modified_default_attribute_of_visible_field_to_false.py on lines 0..16

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

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

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

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

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

Refactorings

Further Reading

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

apps/challenges/migrations/0102_challenge_ec2_storage.py on lines 0..16
apps/challenges/migrations/0110_challenge_ephemeral_storage.py on lines 0..16
apps/challenges/migrations/0111_alter_challenge_ephemeral_storage_default.py on lines 0..16

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

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

apps/challenges/migrations/0033_delete_unique_constraint_from_datasetsplit_table.py on lines 0..16
apps/challenges/migrations/0035_add_max_concurrent_submissions_allowed_field.py on lines 0..16
apps/challenges/migrations/0046_add_max_concurrent_submission_evaluation_in_challenge.py on lines 0..18
apps/web/migrations/0007_add_position_in_team_model.py on lines 0..16

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

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

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

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

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

Refactorings

Further Reading

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

        for participant_email in all_participants_email:
            if participant_email in challenge.banned_email_ids:
                message = "You're a part of {} team and it has been banned from this challenge. \
                Please contact the challenge host.".format(
                    participant_team.team_name
Severity: Major
Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
apps/jobs/views.py on lines 2602..2609
apps/jobs/views.py on lines 2775..2782
apps/jobs/views.py on lines 2891..2898

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

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

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

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

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

Refactorings

Further Reading

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

apps/challenges/migrations/0102_challenge_ec2_storage.py on lines 0..16
apps/challenges/migrations/0111_alter_challenge_ephemeral_storage_default.py on lines 0..16
apps/challenges/migrations/0112_challenge_sqs_retention_period.py on lines 0..16

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

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 (
                challenge_phase.is_restricted_to_select_one_submission
                and is_public
                and submissions_already_public.count() == 1
            ):
Severity: Major
Found in apps/jobs/views.py and 1 other location - About 2 hrs to fix
apps/jobs/views.py on lines 336..349

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

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

Severity: Major
Found in apps/challenges/migrations/0073_add_inform_hosts_field.py and 14 other locations - About 2 hrs to fix
apps/challenges/migrations/0004_challenge_is_disabled.py on lines 0..16
apps/challenges/migrations/0009_challengephase_is_public.py on lines 0..16
apps/challenges/migrations/0025_added_is_submission_pubblic_field.py on lines 0..16
apps/challenges/migrations/0030_add_boolean_field_in_star_model.py on lines 0..16
apps/challenges/migrations/0053_added_is_registration_open_field.py on lines 0..16
apps/challenges/migrations/0055_add_is_leaderboard_order_descending_in_phase_split_model.py on lines 0..16
apps/challenges/migrations/0058_add_show_leaderboard_by_latest_submission_field_in_challenge_phase_split_model.py on lines 0..21
apps/challenges/migrations/0064_add_is_restricted_to_select_one_submission_field_in_phase_model.py on lines 0..18
apps/challenges/migrations/0066_added_is_partial_submission_evaluation_enabled_field_in_phase_model.py on lines 0..21
apps/jobs/migrations/0007_add_is_flagged_field.py on lines 0..16
apps/jobs/migrations/0011_Change_submission_visibility_default_to_public.py on lines 0..16
apps/jobs/migrations/0012_add_baseline_submission.py on lines 0..18
apps/jobs/migrations/0016_add_ignore_submission_boolean_field_in_submission_model.py on lines 0..16
apps/web/migrations/0005_modified_default_attribute_of_visible_field_to_false.py on lines 0..16

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

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

apps/challenges/migrations/0004_challenge_is_disabled.py on lines 0..16
apps/challenges/migrations/0009_challengephase_is_public.py on lines 0..16
apps/challenges/migrations/0025_added_is_submission_pubblic_field.py on lines 0..16
apps/challenges/migrations/0030_add_boolean_field_in_star_model.py on lines 0..16
apps/challenges/migrations/0053_added_is_registration_open_field.py on lines 0..16
apps/challenges/migrations/0055_add_is_leaderboard_order_descending_in_phase_split_model.py on lines 0..16
apps/challenges/migrations/0058_add_show_leaderboard_by_latest_submission_field_in_challenge_phase_split_model.py on lines 0..21
apps/challenges/migrations/0064_add_is_restricted_to_select_one_submission_field_in_phase_model.py on lines 0..18
apps/challenges/migrations/0066_added_is_partial_submission_evaluation_enabled_field_in_phase_model.py on lines 0..21
apps/challenges/migrations/0073_add_inform_hosts_field.py on lines 0..18
apps/jobs/migrations/0007_add_is_flagged_field.py on lines 0..16
apps/jobs/migrations/0011_Change_submission_visibility_default_to_public.py on lines 0..16
apps/jobs/migrations/0012_add_baseline_submission.py on lines 0..18
apps/jobs/migrations/0016_add_ignore_submission_boolean_field_in_submission_model.py on lines 0..16

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

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

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

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

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

Refactorings

Further Reading

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

    for participant_email in all_participants_email:
        if participant_email in challenge.banned_email_ids:
            message = "You're a part of {} team and it has been banned from this challenge. \
            Please contact the challenge host.".format(
                participant_team.team_name
Severity: Major
Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
apps/jobs/views.py on lines 253..261
apps/jobs/views.py on lines 2602..2609
apps/jobs/views.py on lines 2891..2898

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

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

Severity: Major
Found in apps/web/migrations/0007_add_position_in_team_model.py and 4 other locations - About 2 hrs to fix
apps/challenges/migrations/0033_delete_unique_constraint_from_datasetsplit_table.py on lines 0..16
apps/challenges/migrations/0035_add_max_concurrent_submissions_allowed_field.py on lines 0..16
apps/challenges/migrations/0046_add_max_concurrent_submission_evaluation_in_challenge.py on lines 0..18
apps/challenges/migrations/0056_add_leaderboard_decimal_precision_field_in_phase_split_model.py on lines 0..21

Duplicated Code

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

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

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

Tuning

This issue has a mass of 53.

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