Cloud-CV/EvalAI

View on GitHub

Showing 1,371 of 1,371 total issues

Function phaseSplitSelected has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  phaseSplitSelected(phaseSplit) {
    const SELF = this;
    SELF.selectedPhaseSplit = phaseSplit;
    SELF.highlightedEntry = null;

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 countDownTimer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  countDownTimer(SELF, eachPhase) {
    if (!SELF.isClockStarted) {
      SELF.remainingTime = parseInt(eachPhase.limits.remaining_time, 10);
    }
    SELF.days = Math.floor(SELF.remainingTime / 24 / 60 / 60);

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 add_tags_to_challenge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def add_tags_to_challenge(yaml_file_data, challenge):
    if "tags" in yaml_file_data:
        tags_data = yaml_file_data["tags"]
        new_tags = set(tags_data)
        # Remove tags not present in the YAML file
Severity: Minor
Found in apps/challenges/utils.py - About 35 mins 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 storeMetadata has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  storeMetadata(data) {
    for (let i = 0; i < data.count; i++) {
      if (data.results[i].submission_meta_attributes) {
        const attributes = data.results[i].submission_meta_attributes;
        attributes.forEach(function (attribute) {

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 ngAfterViewInit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  ngAfterViewInit() {
    if(window && 'IntersectionObserver' in window) {
      const obs = new IntersectionObserver(entries => {
        entries.forEach(({ isIntersecting }) => {
          if (isIntersecting) {
Severity: Minor
Found in frontend_v2/src/app/Directives/image.lazyload.ts - About 35 mins 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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, *args, **kwargs):
        super(ZipChallengeSerializer, self).__init__(*args, **kwargs)

        context = kwargs.get("context")
        if context:
Severity: Minor
Found in apps/challenges/serializers.py - About 35 mins 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 fetchChallenges has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  fetchChallenges(filter = null, callback = null, approved_status = "approved", visibility = "public") {
    if (!filter) {
      const ALL_PATHS = Object.values(this.apiPathMapping);
      const ALL_KEYS = Object.keys(this.apiPathMapping);
      for (let i = 0; i < ALL_PATHS.length; i++) {

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 fetchMyParticipatedChallenges has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  fetchMyParticipatedChallenges(filter = null, callback = null) {
    const SELF = this;
    if (!filter) {
      const ALL_PATHS = Object.values(SELF.newApiPathMapping);
      const ALL_KEYS = Object.keys(SELF.newApiPathMapping);

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 updateView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  updateView() {
    this.teamView['team_name'] = this.team['team_name'];
    this.teamView['created_by'] = this.team['created_by'];
    this.teamView['team_url'] = this.team['team_url'];
    this.teamView['id'] = this.team['id'];

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 processUserDetails has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  processUserDetails() {
    let countLeft = 0;
    let count = 0;
    for (const i in this.user) {
      if (this.user.hasOwnProperty(i)) {
Severity: Minor
Found in frontend_v2/src/app/components/profile/profile.component.ts - About 35 mins 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 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 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 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(["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 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 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(["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 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(["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

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/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 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(["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 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 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

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

Severity
Category
Status
Source
Language