Cloud-CV/EvalAI

View on GitHub
apps/jobs/views.py

Summary

Maintainability
F
1 mo
Test Coverage

File views.py has 2694 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import botocore
import datetime
import json
import logging
import os
Severity: Major
Found in apps/jobs/views.py - About 1 wk to fix

    Function update_partially_evaluated_submission has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_partially_evaluated_submission(request, challenge_pk):
        """
        API endpoint to update submission related attributes
    
        Query Parameters:
    Severity: Minor
    Found in apps/jobs/views.py - About 2 days 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_submission has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_submission(request, challenge_pk):
        """
        API endpoint to update submission related attributes
    
        Query Parameters:
    Severity: Minor
    Found in apps/jobs/views.py - About 1 day 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 challenge_submission has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
    Open

    def challenge_submission(request, challenge_id, challenge_phase_id):
        """API Endpoint for making a submission to a challenge"""
    
        # check if the challenge exists or not
        try:
    Severity: Minor
    Found in apps/jobs/views.py - About 1 day 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 get_submission_file_presigned_url has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_submission_file_presigned_url(request, challenge_phase_pk):
        """
        API to generate a presigned url to upload a submission file
    
        Arguments:
    Severity: Minor
    Found in apps/jobs/views.py - About 4 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 finish_submission_file_upload has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    def finish_submission_file_upload(request, challenge_phase_pk, submission_pk):
        """
        API to complete multipart upload of presigned url submission
    
        Arguments:
    Severity: Minor
    Found in apps/jobs/views.py - About 3 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_leaderboard_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_leaderboard_data(request, leaderboard_data_pk):
        """API endpoint to update a metric in leaderboard data
    
        Arguments:
            request {HttpRequest} -- The request object
    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 send_submission_message has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def send_submission_message(request, challenge_phase_pk, submission_pk):
        """
        API to send a submisison message to the challenge specific SQS queue
    
        Arguments:
    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 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_submission_meta has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def update_submission_meta(request, challenge_pk, submission_pk):
        """
        Common API Endpoint for updating the submission meta data for hosts and participants.
        """
    
    
    Severity: Minor
    Found in apps/jobs/views.py - About 1 hr 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 get_submission_by_pk has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_submission_by_pk(request, submission_id):
        """
        API endpoint to fetch the details of a submission.
        Only the submission owner or the challenge hosts are allowed.
        """
    Severity: Minor
    Found in apps/jobs/views.py - About 55 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

    Avoid deeply nested control flow statements.
    Open

                        if metric not in leaderboard_metrics:
                            missing_metrics.append(metric)
    
    
    Severity: Major
    Found in apps/jobs/views.py - About 45 mins to fix

      Function resume_submission has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def resume_submission(request, submission_pk):
          """
          API endpoint to resume a submission from failed or partially evaluated state.
          Only challenge host has access to this endpoint.
          """
      Severity: Minor
      Found in apps/jobs/views.py - About 45 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

      Avoid deeply nested control flow statements.
      Open

                          if submission_serializer.is_valid():
                              submission_serializer.save()
      
              # Override submission visibility if leaderboard_public = False for a challenge phase
              if not challenge_phase.leaderboard_public:
      Severity: Major
      Found in apps/jobs/views.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if metric not in leaderboard_metrics:
                                missing_metrics.append(metric)
        
        
        Severity: Major
        Found in apps/jobs/views.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if not (
                                  isinstance(value, float) or isinstance(value, int)
                              ):
                                  malformed_metrics.append((metric, type(value)))
          
          
          Severity: Major
          Found in apps/jobs/views.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if not (
                                    isinstance(value, float) or isinstance(value, int)
                                ):
                                    malformed_metrics.append((metric, type(value)))
            
            
            Severity: Major
            Found in apps/jobs/views.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if metric not in leaderboard_metrics:
                                      missing_metrics.append(metric)
              
              
              Severity: Major
              Found in apps/jobs/views.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if not (
                                        isinstance(value, float) or isinstance(value, int)
                                    ):
                                        malformed_metrics.append((metric, type(value)))
                                    updated_result[metric] = value
                Severity: Major
                Found in apps/jobs/views.py - About 45 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return Response(response_data, status=status.HTTP_401_UNAUTHORIZED)
                  Severity: Major
                  Found in apps/jobs/views.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                    Severity: Major
                    Found in apps/jobs/views.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                      Severity: Major
                      Found in apps/jobs/views.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return Response(
                        Severity: Major
                        Found in apps/jobs/views.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                          Severity: Major
                          Found in apps/jobs/views.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                            Severity: Major
                            Found in apps/jobs/views.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                              Severity: Major
                              Found in apps/jobs/views.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return Response(response_data, status=status.HTTP_200_OK)
                                Severity: Major
                                Found in apps/jobs/views.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return Response(
                                  Severity: Major
                                  Found in apps/jobs/views.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                    return Response(response_data, status=status.HTTP_200_OK)
                                    Severity: Major
                                    Found in apps/jobs/views.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return Response(
                                      Severity: Major
                                      Found in apps/jobs/views.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                        Severity: Major
                                        Found in apps/jobs/views.py - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                  return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                          Severity: Major
                                          Found in apps/jobs/views.py - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return Response(serializer.data, status=status.HTTP_200_OK)
                                            Severity: Major
                                            Found in apps/jobs/views.py - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                              return Response(
                                              Severity: Major
                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                                    return Response(
                                                Severity: Major
                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                          return Response(response_data, status=status.HTTP_200_OK)
                                                  Severity: Major
                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                    return Response(
                                                    Severity: Major
                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                          return Response(
                                                      Severity: Major
                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                    return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                        Severity: Major
                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
                                                          Severity: Major
                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                                return Response(
                                                            Severity: Major
                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                          return Response(response_data, status=status.HTTP_200_OK)
                                                              Severity: Major
                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                        return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                Severity: Major
                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                          return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                  Severity: Major
                                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                                return Response(
                                                                    Severity: Major
                                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                              return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                      Severity: Major
                                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                    return Response(
                                                                        Severity: Major
                                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                                  return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                          Severity: Major
                                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                    return Response(response_data, status=status.HTTP_200_OK)
                                                                            Severity: Major
                                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                              return Response(
                                                                              Severity: Major
                                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                                    return Response(
                                                                                Severity: Major
                                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                      return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                  Severity: Major
                                                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                        return response
                                                                                    Severity: Major
                                                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                                      return Response(
                                                                                      Severity: Major
                                                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                    return Response(
                                                                                        Severity: Major
                                                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                  return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                          Severity: Major
                                                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                        return Response(
                                                                                            Severity: Major
                                                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                                  return Response(
                                                                                              Severity: Major
                                                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                                return Response(
                                                                                                Severity: Major
                                                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                  Severity: Major
                                                                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
                                                                                                    Severity: Major
                                                                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                                      return Response(
                                                                                                      Severity: Major
                                                                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                                return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                        Severity: Major
                                                                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                  return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                          Severity: Major
                                                                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                        return Response(
                                                                                                            Severity: Major
                                                                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                                  return Response(
                                                                                                              Severity: Major
                                                                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                                return Response(
                                                                                                                Severity: Major
                                                                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                          return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                                                  Severity: Major
                                                                                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                                    return Response(
                                                                                                                    Severity: Major
                                                                                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                                      return Response(
                                                                                                                      Severity: Major
                                                                                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                                        return Response(serializer.data, status=status.HTTP_200_OK)
                                                                                                                        Severity: Major
                                                                                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                                              return Response(
                                                                                                                          Severity: Major
                                                                                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                    return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                            Severity: Major
                                                                                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                      return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                              Severity: Major
                                                                                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                                return Response(
                                                                                                                                Severity: Major
                                                                                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                  Open

                                                                                                                                                      return Response(
                                                                                                                                  Severity: Major
                                                                                                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                    Open

                                                                                                                                                return Response(serializer.data, status=status.HTTP_200_OK)
                                                                                                                                    Severity: Major
                                                                                                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                                          return Response(
                                                                                                                                      Severity: Major
                                                                                                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                            return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                        Severity: Major
                                                                                                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                              return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                          Severity: Major
                                                                                                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                    return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                            Severity: Major
                                                                                                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                      return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                                                                              Severity: Major
                                                                                                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                        return response
                                                                                                                                                Severity: Major
                                                                                                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                                  return Response(
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                                    return Response(
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                                  return Response(response_data, status=status.HTTP_201_CREATED)
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                                return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                          return Response(
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                                return Response(
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                      return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                        return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                              return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                                return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                                  return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                        Open

                                                                                                                                                                                            return Response(
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                          Open

                                                                                                                                                                                              return Response(
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                        return Response(
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                              Open

                                                                                                                                                                                  return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                Open

                                                                                                                                                                                        return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in apps/jobs/views.py - About 30 mins to fix

                                                                                                                                                                                  Function get_signed_url_for_submission_related_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                  Open

                                                                                                                                                                                  def get_signed_url_for_submission_related_file(request):
                                                                                                                                                                                      """Returns S3 signed URL for a particular file residing on S3 bucket
                                                                                                                                                                                  
                                                                                                                                                                                      Arguments:
                                                                                                                                                                                          request {object} -- Request object
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in apps/jobs/views.py - About 25 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

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

                                                                                                                                                                                  @swagger_auto_schema(
                                                                                                                                                                                      methods=["put"],
                                                                                                                                                                                      manual_parameters=[
                                                                                                                                                                                          openapi.Parameter(
                                                                                                                                                                                              name="challenge_pk",
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 4 days to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1341..1465

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

                                                                                                                                                                                  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

                                                                                                                                                                                  @swagger_auto_schema(
                                                                                                                                                                                      methods=["put"],
                                                                                                                                                                                      manual_parameters=[
                                                                                                                                                                                          openapi.Parameter(
                                                                                                                                                                                              name="challenge_pk",
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 4 days to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 955..1079

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

                                                                                                                                                                                  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 not is_user_a_host_of_challenge(request.user, challenge.pk):
                                                                                                                                                                                          # Check if challenge phase is public and accepting solutions
                                                                                                                                                                                          if not challenge_phase.is_public:
                                                                                                                                                                                              response_data = {
                                                                                                                                                                                                  "error": "Sorry, cannot accept submissions since challenge phase is not public"
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 1 day to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2566..2589
                                                                                                                                                                                  apps/jobs/views.py on lines 2857..2878

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

                                                                                                                                                                                  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 not is_user_a_host_of_challenge(request.user, challenge.pk):
                                                                                                                                                                                          # Check if challenge phase is public and accepting solutions
                                                                                                                                                                                          if not challenge_phase.is_public:
                                                                                                                                                                                              response_data = {
                                                                                                                                                                                                  "error": "Sorry, cannot accept submissions since challenge phase is not public"
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 1 day to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2739..2762
                                                                                                                                                                                  apps/jobs/views.py on lines 2857..2878

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

                                                                                                                                                                                  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 not is_user_a_host_of_challenge(request.user, challenge.pk):
                                                                                                                                                                                          if not challenge_phase.is_public:
                                                                                                                                                                                              response_data = {
                                                                                                                                                                                                  "error": "Sorry, cannot accept submissions since challenge phase is not public"
                                                                                                                                                                                              }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 1 day to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2566..2589
                                                                                                                                                                                  apps/jobs/views.py on lines 2739..2762

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

                                                                                                                                                                                  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

                                                                                                                                                                                  @swagger_auto_schema(
                                                                                                                                                                                      methods=["post"],
                                                                                                                                                                                      manual_parameters=[
                                                                                                                                                                                          openapi.Parameter(
                                                                                                                                                                                              name="challenge_id",
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 111..129

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

                                                                                                                                                                                  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

                                                                                                                                                                                  @swagger_auto_schema(
                                                                                                                                                                                      methods=["get"],
                                                                                                                                                                                      manual_parameters=[
                                                                                                                                                                                          openapi.Parameter(
                                                                                                                                                                                              name="challenge_id",
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 4 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 91..109

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

                                                                                                                                                                                  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

                                                                                                                                                                                              try:
                                                                                                                                                                                                  with transaction.atomic():
                                                                                                                                                                                                      for serializer in leaderboard_data_list:
                                                                                                                                                                                                          serializer.save()
                                                                                                                                                                                              except IntegrityError:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 3 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1250..1266
                                                                                                                                                                                  apps/jobs/views.py on lines 1646..1662

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  for metric, value in accuracies.items():
                                                                                                                                                                                                      if metric not in leaderboard_metrics:
                                                                                                                                                                                                          missing_metrics.append(metric)
                                                                                                                                                                                  
                                                                                                                                                                                                      if not (
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 3 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1575..1582
                                                                                                                                                                                  apps/jobs/views.py on lines 2342..2347

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

                                                                                                                                                                                  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

                                                                                                                                                                                              try:
                                                                                                                                                                                                  with transaction.atomic():
                                                                                                                                                                                                      for serializer in leaderboard_data_list:
                                                                                                                                                                                                          serializer.save()
                                                                                                                                                                                              except IntegrityError:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 3 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1646..1662
                                                                                                                                                                                  apps/jobs/views.py on lines 1834..1850

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  for metric, value in accuracies.items():
                                                                                                                                                                                                      if metric not in leaderboard_metrics:
                                                                                                                                                                                                          missing_metrics.append(metric)
                                                                                                                                                                                  
                                                                                                                                                                                                      if not (
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 3 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1184..1191
                                                                                                                                                                                  apps/jobs/views.py on lines 2342..2347

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

                                                                                                                                                                                  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

                                                                                                                                                                                              try:
                                                                                                                                                                                                  with transaction.atomic():
                                                                                                                                                                                                      for serializer in leaderboard_data_list:
                                                                                                                                                                                                          serializer.save()
                                                                                                                                                                                              except IntegrityError:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 3 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1250..1266
                                                                                                                                                                                  apps/jobs/views.py on lines 1834..1850

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      for metric, value in data.items():
                                                                                                                                                                                          if metric not in leaderboard_metrics:
                                                                                                                                                                                              extra_metrics.append(metric)
                                                                                                                                                                                  
                                                                                                                                                                                          if not (isinstance(value, float) or isinstance(value, int)):
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 3 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1184..1191
                                                                                                                                                                                  apps/jobs/views.py on lines 1575..1582

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

                                                                                                                                                                                  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 leaderboard_data is not None:
                                                                                                                                                                                                      serializer = CreateLeaderboardDataSerializer(
                                                                                                                                                                                                          leaderboard_data,
                                                                                                                                                                                                          data=data,
                                                                                                                                                                                                          partial=True,
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1615..1632

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

                                                                                                                                                                                  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 leaderboard_data is not None:
                                                                                                                                                                                                      serializer = CreateLeaderboardDataSerializer(
                                                                                                                                                                                                          leaderboard_data,
                                                                                                                                                                                                          data=data,
                                                                                                                                                                                                          partial=True,
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1219..1236

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

                                                                                                                                                                                  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

                                                                                                                                                                                                  try:
                                                                                                                                                                                                      challenge_phase_split = ChallengePhaseSplit.objects.get(
                                                                                                                                                                                                          challenge_phase__pk=challenge_phase_pk,
                                                                                                                                                                                                          dataset_split__codename=split,
                                                                                                                                                                                                      )
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1556..1567
                                                                                                                                                                                  apps/jobs/views.py on lines 1744..1755

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

                                                                                                                                                                                  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

                                                                                                                                                                                                  try:
                                                                                                                                                                                                      challenge_phase_split = ChallengePhaseSplit.objects.get(
                                                                                                                                                                                                          challenge_phase__pk=challenge_phase_pk,
                                                                                                                                                                                                          dataset_split__codename=split,
                                                                                                                                                                                                      )
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1165..1176
                                                                                                                                                                                  apps/jobs/views.py on lines 1556..1567

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

                                                                                                                                                                                  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

                                                                                                                                                                                                  try:
                                                                                                                                                                                                      challenge_phase_split = ChallengePhaseSplit.objects.get(
                                                                                                                                                                                                          challenge_phase__pk=challenge_phase_pk,
                                                                                                                                                                                                          dataset_split__codename=split,
                                                                                                                                                                                                      )
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1165..1176
                                                                                                                                                                                  apps/jobs/views.py on lines 1744..1755

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

                                                                                                                                                                                  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

                                                                                                                                                                                              try:
                                                                                                                                                                                                  results = json.loads(submission_result)
                                                                                                                                                                                              except (ValueError, TypeError) as exc:
                                                                                                                                                                                                  response_data = {
                                                                                                                                                                                                      "error": "`result` key contains invalid data with error {}."
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1147..1155
                                                                                                                                                                                  apps/jobs/views.py on lines 1725..1733
                                                                                                                                                                                  apps/jobs/views.py on lines 2326..2333

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

                                                                                                                                                                                  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

                                                                                                                                                                                              try:
                                                                                                                                                                                                  results = json.loads(submission_result)
                                                                                                                                                                                              except (ValueError, TypeError) as exc:
                                                                                                                                                                                                  response_data = {
                                                                                                                                                                                                      "error": "`result` key contains invalid data with error {}."
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1538..1546
                                                                                                                                                                                  apps/jobs/views.py on lines 1725..1733
                                                                                                                                                                                  apps/jobs/views.py on lines 2326..2333

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

                                                                                                                                                                                  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

                                                                                                                                                                                      try:
                                                                                                                                                                                          data = json.loads(data)
                                                                                                                                                                                      except (ValueError, TypeError) as exc:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "`leaderboard_data` key contains invalid data with error {}."
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1147..1155
                                                                                                                                                                                  apps/jobs/views.py on lines 1538..1546
                                                                                                                                                                                  apps/jobs/views.py on lines 1725..1733

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

                                                                                                                                                                                  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

                                                                                                                                                                                              try:
                                                                                                                                                                                                  results = json.loads(submission_result)
                                                                                                                                                                                              except (ValueError, TypeError) as exc:
                                                                                                                                                                                                  response_data = {
                                                                                                                                                                                                      "error": "`result` key contains invalid data with error {}."
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1147..1155
                                                                                                                                                                                  apps/jobs/views.py on lines 1538..1546
                                                                                                                                                                                  apps/jobs/views.py on lines 2326..2333

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

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

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

                                                                                                                                                                                                  if submissions_already_public.count() == 1:
                                                                                                                                                                                                      # Case when the phase is restricted to make only one submission as public
                                                                                                                                                                                                      submission_serializer = SubmissionSerializer(
                                                                                                                                                                                                          submissions_already_public[0],
                                                                                                                                                                                                          data={"is_public": False},
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 466..483

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

                                                                                                                                                                                      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

                                                                                                                                                                                      try:
                                                                                                                                                                                          challenge = Challenge.objects.get(queue=queue_name)  # noqa
                                                                                                                                                                                      except Challenge.DoesNotExist:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Challenge with queue name {} does not exist".format(
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 913..919
                                                                                                                                                                                  apps/jobs/views.py on lines 1883..1889
                                                                                                                                                                                  apps/jobs/views.py on lines 1930..1936
                                                                                                                                                                                  apps/jobs/views.py on lines 2190..2198

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

                                                                                                                                                                                  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

                                                                                                                                                                                      try:
                                                                                                                                                                                          submission = Submission.objects.get(pk=submission_id)
                                                                                                                                                                                      except Submission.DoesNotExist:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Submission {} does not exist".format(submission_id)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1883..1889
                                                                                                                                                                                  apps/jobs/views.py on lines 1930..1936
                                                                                                                                                                                  apps/jobs/views.py on lines 2103..2111
                                                                                                                                                                                  apps/jobs/views.py on lines 2190..2198

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

                                                                                                                                                                                  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

                                                                                                                                                                                      try:
                                                                                                                                                                                          submission = Submission.objects.get(pk=submission_pk)
                                                                                                                                                                                      except Submission.DoesNotExist:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Submission {} does not exist".format(submission_pk)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 913..919
                                                                                                                                                                                  apps/jobs/views.py on lines 1930..1936
                                                                                                                                                                                  apps/jobs/views.py on lines 2103..2111
                                                                                                                                                                                  apps/jobs/views.py on lines 2190..2198

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

                                                                                                                                                                                  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

                                                                                                                                                                                      try:
                                                                                                                                                                                          challenge = Challenge.objects.get(queue=queue_name)
                                                                                                                                                                                      except Challenge.DoesNotExist:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Challenge with queue name {} does not exists".format(
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 913..919
                                                                                                                                                                                  apps/jobs/views.py on lines 1883..1889
                                                                                                                                                                                  apps/jobs/views.py on lines 1930..1936
                                                                                                                                                                                  apps/jobs/views.py on lines 2103..2111

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

                                                                                                                                                                                  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

                                                                                                                                                                                      try:
                                                                                                                                                                                          submission = Submission.objects.get(pk=submission_pk)
                                                                                                                                                                                      except Submission.DoesNotExist:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Submission {} does not exist".format(submission_pk)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 913..919
                                                                                                                                                                                  apps/jobs/views.py on lines 1883..1889
                                                                                                                                                                                  apps/jobs/views.py on lines 2103..2111
                                                                                                                                                                                  apps/jobs/views.py on lines 2190..2198

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

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

                                                                                                                                                                                      if serializer.is_valid():
                                                                                                                                                                                          serializer.save()
                                                                                                                                                                                          response_data = serializer.data
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                                                                      else:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 5 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 101..107
                                                                                                                                                                                  apps/hosts/views.py on lines 200..206
                                                                                                                                                                                  apps/jobs/views.py on lines 498..503
                                                                                                                                                                                  apps/jobs/views.py on lines 2969..2975
                                                                                                                                                                                  apps/jobs/views.py on lines 3002..3008

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

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

                                                                                                                                                                                          if serializer.is_valid():
                                                                                                                                                                                              serializer.save()
                                                                                                                                                                                              response_data = serializer.data
                                                                                                                                                                                              return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                                                                          else:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 5 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 101..107
                                                                                                                                                                                  apps/hosts/views.py on lines 200..206
                                                                                                                                                                                  apps/jobs/views.py on lines 498..503
                                                                                                                                                                                  apps/jobs/views.py on lines 2940..2945
                                                                                                                                                                                  apps/jobs/views.py on lines 2969..2975

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

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

                                                                                                                                                                                          if serializer.is_valid():
                                                                                                                                                                                              serializer.save()
                                                                                                                                                                                              response_data = serializer.data
                                                                                                                                                                                              return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                                                                          else:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 5 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 101..107
                                                                                                                                                                                  apps/hosts/views.py on lines 200..206
                                                                                                                                                                                  apps/jobs/views.py on lines 498..503
                                                                                                                                                                                  apps/jobs/views.py on lines 2940..2945
                                                                                                                                                                                  apps/jobs/views.py on lines 3002..3008

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

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

                                                                                                                                                                                      if serializer.is_valid():
                                                                                                                                                                                          serializer.save()
                                                                                                                                                                                          response_data = serializer.data
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                                                                      else:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 5 other locations - About 2 hrs to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 101..107
                                                                                                                                                                                  apps/hosts/views.py on lines 200..206
                                                                                                                                                                                  apps/jobs/views.py on lines 2940..2945
                                                                                                                                                                                  apps/jobs/views.py on lines 2969..2975
                                                                                                                                                                                  apps/jobs/views.py on lines 3002..3008

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not challenge.allow_participants_resubmissions and not is_user_a_staff_or_host(request.user, challenge.pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Only challenge hosts or admins are allowed to re-run a submission"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1960..1964

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not challenge.allow_participants_resubmissions and not is_user_a_host_of_challenge(request.user, challenge.pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Only challenge hosts are allowed to resume a submission"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 2 hrs to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1901..1905

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

                                                                                                                                                                                  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

                                                                                                                                                                                      try:
                                                                                                                                                                                          leaderboard_data = LeaderboardData.objects.get(pk=leaderboard_data_pk, is_disabled=False)
                                                                                                                                                                                      except LeaderboardData.DoesNotExist:
                                                                                                                                                                                          response_data = {"error": "Leaderboard data does not exist"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_404_NOT_FOUND)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 146..152

                                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 49.

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          challenge_phase = ChallengePhase.objects.get(
                                                                                                                                                                                              pk=challenge_phase_id, challenge=challenge
                                                                                                                                                                                          )
                                                                                                                                                                                      except ChallengePhase.DoesNotExist:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2305..2309

                                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 49.

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          message = queue.Message(receipt_handle)
                                                                                                                                                                                          message.delete()
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "success": "Message deleted successfully from the queue: {}".format(
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2120..2143

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

                                                                                                                                                                                  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

                                                                                                                                                                                      try:
                                                                                                                                                                                          messages = queue.receive_messages()
                                                                                                                                                                                          if len(messages):
                                                                                                                                                                                              message_receipt_handle = messages[0].receipt_handle
                                                                                                                                                                                              message_body = json.loads(messages[0].body)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2215..2229

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

                                                                                                                                                                                  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 len(missing_metrics) and not is_partial_evaluation_phase:
                                                                                                                                                                                                      response_data = {
                                                                                                                                                                                                          "error": "Following metrics are missing in the"
                                                                                                                                                                                                          "leaderboard data: {} of challenge phase: {}".format(
                                                                                                                                                                                                              missing_metrics, challenge_phase_pk
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1587..1595

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          participant_team = ParticipantTeam.objects.get(pk=participant_team_id)
                                                                                                                                                                                      except ParticipantTeam.DoesNotExist:
                                                                                                                                                                                          response_data = {"error": "You haven't participated in the challenge"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 11 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 75..79
                                                                                                                                                                                  apps/hosts/views.py on lines 117..123
                                                                                                                                                                                  apps/hosts/views.py on lines 165..171
                                                                                                                                                                                  apps/hosts/views.py on lines 268..272
                                                                                                                                                                                  apps/hosts/views.py on lines 275..281
                                                                                                                                                                                  apps/jobs/views.py on lines 139..143
                                                                                                                                                                                  apps/jobs/views.py on lines 235..243
                                                                                                                                                                                  apps/jobs/views.py on lines 438..442
                                                                                                                                                                                  apps/jobs/views.py on lines 2768..2772
                                                                                                                                                                                  apps/jobs/views.py on lines 2884..2888
                                                                                                                                                                                  apps/jobs/views.py on lines 2925..2931

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          participant_team = ParticipantTeam.objects.get(pk=participant_team_id)
                                                                                                                                                                                      except ParticipantTeam.DoesNotExist:
                                                                                                                                                                                          response_data = {"error": "You haven't participated in the challenge"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 11 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 75..79
                                                                                                                                                                                  apps/hosts/views.py on lines 117..123
                                                                                                                                                                                  apps/hosts/views.py on lines 165..171
                                                                                                                                                                                  apps/hosts/views.py on lines 268..272
                                                                                                                                                                                  apps/hosts/views.py on lines 275..281
                                                                                                                                                                                  apps/jobs/views.py on lines 139..143
                                                                                                                                                                                  apps/jobs/views.py on lines 235..243
                                                                                                                                                                                  apps/jobs/views.py on lines 438..442
                                                                                                                                                                                  apps/jobs/views.py on lines 2595..2599
                                                                                                                                                                                  apps/jobs/views.py on lines 2768..2772
                                                                                                                                                                                  apps/jobs/views.py on lines 2925..2931

                                                                                                                                                                                  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

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

                                                                                                                                                                                                  if len(missing_metrics) and not is_partial_evaluation_phase:
                                                                                                                                                                                                      response_data = {
                                                                                                                                                                                                          "error": "Following metrics are missing in the"
                                                                                                                                                                                                          "leaderboard data: {} of challenge phase: {}".format(
                                                                                                                                                                                                              missing_metrics, challenge_phase_pk
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1792..1800

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          participant_team = ParticipantTeam.objects.get(pk=participant_team_pk)
                                                                                                                                                                                      except ParticipantTeam.DoesNotExist:
                                                                                                                                                                                          response_data = {"error": "You haven't participated in the challenge"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 11 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 75..79
                                                                                                                                                                                  apps/hosts/views.py on lines 117..123
                                                                                                                                                                                  apps/hosts/views.py on lines 165..171
                                                                                                                                                                                  apps/hosts/views.py on lines 268..272
                                                                                                                                                                                  apps/hosts/views.py on lines 275..281
                                                                                                                                                                                  apps/jobs/views.py on lines 139..143
                                                                                                                                                                                  apps/jobs/views.py on lines 235..243
                                                                                                                                                                                  apps/jobs/views.py on lines 2595..2599
                                                                                                                                                                                  apps/jobs/views.py on lines 2768..2772
                                                                                                                                                                                  apps/jobs/views.py on lines 2884..2888
                                                                                                                                                                                  apps/jobs/views.py on lines 2925..2931

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          submission = Submission.objects.get(
                                                                                                                                                                                              id=submission_pk,
                                                                                                                                                                                          )
                                                                                                                                                                                      except Submission.DoesNotExist:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 11 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 75..79
                                                                                                                                                                                  apps/hosts/views.py on lines 117..123
                                                                                                                                                                                  apps/hosts/views.py on lines 165..171
                                                                                                                                                                                  apps/hosts/views.py on lines 268..272
                                                                                                                                                                                  apps/hosts/views.py on lines 275..281
                                                                                                                                                                                  apps/jobs/views.py on lines 139..143
                                                                                                                                                                                  apps/jobs/views.py on lines 235..243
                                                                                                                                                                                  apps/jobs/views.py on lines 438..442
                                                                                                                                                                                  apps/jobs/views.py on lines 2595..2599
                                                                                                                                                                                  apps/jobs/views.py on lines 2768..2772
                                                                                                                                                                                  apps/jobs/views.py on lines 2884..2888

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          challenge = Challenge.objects.get(pk=challenge_id)
                                                                                                                                                                                      except Challenge.DoesNotExist:
                                                                                                                                                                                          response_data = {"error": "Challenge does not exist"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 11 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 75..79
                                                                                                                                                                                  apps/hosts/views.py on lines 117..123
                                                                                                                                                                                  apps/hosts/views.py on lines 165..171
                                                                                                                                                                                  apps/hosts/views.py on lines 268..272
                                                                                                                                                                                  apps/hosts/views.py on lines 275..281
                                                                                                                                                                                  apps/jobs/views.py on lines 235..243
                                                                                                                                                                                  apps/jobs/views.py on lines 438..442
                                                                                                                                                                                  apps/jobs/views.py on lines 2595..2599
                                                                                                                                                                                  apps/jobs/views.py on lines 2768..2772
                                                                                                                                                                                  apps/jobs/views.py on lines 2884..2888
                                                                                                                                                                                  apps/jobs/views.py on lines 2925..2931

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

                                                                                                                                                                                          try:
                                                                                                                                                                                              participant_team = ParticipantTeam.objects.get(
                                                                                                                                                                                                  pk=participant_team_id
                                                                                                                                                                                              )
                                                                                                                                                                                          except ParticipantTeam.DoesNotExist:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 11 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 75..79
                                                                                                                                                                                  apps/hosts/views.py on lines 117..123
                                                                                                                                                                                  apps/hosts/views.py on lines 165..171
                                                                                                                                                                                  apps/hosts/views.py on lines 268..272
                                                                                                                                                                                  apps/hosts/views.py on lines 275..281
                                                                                                                                                                                  apps/jobs/views.py on lines 139..143
                                                                                                                                                                                  apps/jobs/views.py on lines 438..442
                                                                                                                                                                                  apps/jobs/views.py on lines 2595..2599
                                                                                                                                                                                  apps/jobs/views.py on lines 2768..2772
                                                                                                                                                                                  apps/jobs/views.py on lines 2884..2888
                                                                                                                                                                                  apps/jobs/views.py on lines 2925..2931

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

                                                                                                                                                                                      try:
                                                                                                                                                                                          participant_team = ParticipantTeam.objects.get(pk=participant_team_id)
                                                                                                                                                                                      except ParticipantTeam.DoesNotExist:
                                                                                                                                                                                          response_data = {"error": "You haven't participated in the challenge"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_403_FORBIDDEN)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 11 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 75..79
                                                                                                                                                                                  apps/hosts/views.py on lines 117..123
                                                                                                                                                                                  apps/hosts/views.py on lines 165..171
                                                                                                                                                                                  apps/hosts/views.py on lines 268..272
                                                                                                                                                                                  apps/hosts/views.py on lines 275..281
                                                                                                                                                                                  apps/jobs/views.py on lines 139..143
                                                                                                                                                                                  apps/jobs/views.py on lines 235..243
                                                                                                                                                                                  apps/jobs/views.py on lines 438..442
                                                                                                                                                                                  apps/jobs/views.py on lines 2595..2599
                                                                                                                                                                                  apps/jobs/views.py on lines 2884..2888
                                                                                                                                                                                  apps/jobs/views.py on lines 2925..2931

                                                                                                                                                                                  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

                                                                                                                                                                                      if (
                                                                                                                                                                                          submissions_in_progress
                                                                                                                                                                                          >= challenge_phase.max_concurrent_submissions_allowed
                                                                                                                                                                                      ):
                                                                                                                                                                                          message = "You have {} submissions that are being processed. \
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 278..286

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

                                                                                                                                                                                  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

                                                                                                                                                                                          if (
                                                                                                                                                                                              submissions_in_progress
                                                                                                                                                                                              >= challenge_phase.max_concurrent_submissions_allowed
                                                                                                                                                                                          ):
                                                                                                                                                                                              message = "You have {} submissions that are being processed. \
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2625..2632

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

                                                                                                                                                                                  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

                                                                                                                                                                                          try:
                                                                                                                                                                                              ParticipantTeam.objects.get(pk=participant_team_id)
                                                                                                                                                                                          except ParticipantTeam.DoesNotExist:
                                                                                                                                                                                              response_data = {
                                                                                                                                                                                                  "error": "You haven't participated in the challenge"
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 246..250

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

                                                                                                                                                                                  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

                                                                                                                                                                                          if submission_status not in [
                                                                                                                                                                                              Submission.FAILED,
                                                                                                                                                                                              Submission.CANCELLED,
                                                                                                                                                                                              Submission.FINISHED,
                                                                                                                                                                                          ]:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1689..1695

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

                                                                                                                                                                                  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

                                                                                                                                                                                          if submission_status not in [
                                                                                                                                                                                              Submission.RUNNING,
                                                                                                                                                                                              Submission.PARTIALLY_EVALUATED,
                                                                                                                                                                                              Submission.FINISHED,
                                                                                                                                                                                          ]:
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 1 other location - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1138..1144

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not challenge.is_active:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Challenge {} is not active".format(challenge.title)
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1907..1911
                                                                                                                                                                                  apps/jobs/views.py on lines 1972..1976
                                                                                                                                                                                  apps/jobs/views.py on lines 1978..1982

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not challenge.allow_resuming_submissions:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Challenge {} does not allow resuming submissions.".format(challenge.title)
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1907..1911
                                                                                                                                                                                  apps/jobs/views.py on lines 1966..1970
                                                                                                                                                                                  apps/jobs/views.py on lines 1972..1976

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not challenge.is_active:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Challenge {} is not active".format(challenge.title)
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1966..1970
                                                                                                                                                                                  apps/jobs/views.py on lines 1972..1976
                                                                                                                                                                                  apps/jobs/views.py on lines 1978..1982

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not challenge.remote_evaluation:
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Challenge {} is not remote. Resuming is only supported for remote challenges.".format(challenge.title)
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_406_NOT_ACCEPTABLE)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 3 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1907..1911
                                                                                                                                                                                  apps/jobs/views.py on lines 1966..1970
                                                                                                                                                                                  apps/jobs/views.py on lines 1978..1982

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      if request.data.get("upload_id") is None:
                                                                                                                                                                                          response_data = {"error": "Uploaded file UploadId is missing"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 290..293
                                                                                                                                                                                  apps/jobs/views.py on lines 2784..2786

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              if request.data.get("file_url") is None:
                                                                                                                                                                                                  response_data = {"error": "The file URL is missing!"}
                                                                                                                                                                                                  return Response(
                                                                                                                                                                                                      response_data, status=status.HTTP_400_BAD_REQUEST
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2784..2786
                                                                                                                                                                                  apps/jobs/views.py on lines 2788..2790

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      if request.data.get("parts") is None:
                                                                                                                                                                                          response_data = {"error": "Uploaded file Parts metadata is missing"}
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 290..293
                                                                                                                                                                                  apps/jobs/views.py on lines 2788..2790

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not is_user_a_host_of_challenge(request.user, challenge.pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Sorry, you are not authorized to access this resource"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_401_UNAUTHORIZED)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 803..807
                                                                                                                                                                                  apps/jobs/views.py on lines 2315..2319
                                                                                                                                                                                  apps/jobs/views.py on lines 2405..2409
                                                                                                                                                                                  apps/jobs/views.py on lines 2509..2513

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not is_user_a_host_of_challenge(request.user, challenge.pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Sorry, you are not authorized to make this request!"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 803..807
                                                                                                                                                                                  apps/jobs/views.py on lines 2113..2117
                                                                                                                                                                                  apps/jobs/views.py on lines 2405..2409
                                                                                                                                                                                  apps/jobs/views.py on lines 2509..2513

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not is_user_a_staff_or_host(request.user, challenge_obj.pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Sorry, you are not authorized to make this request!"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 2113..2117
                                                                                                                                                                                  apps/jobs/views.py on lines 2315..2319
                                                                                                                                                                                  apps/jobs/views.py on lines 2405..2409
                                                                                                                                                                                  apps/jobs/views.py on lines 2509..2513

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not is_user_a_host_of_challenge(request.user, challenge.pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Sorry, you are not authorized to make this request"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_401_UNAUTHORIZED)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 803..807
                                                                                                                                                                                  apps/jobs/views.py on lines 2113..2117
                                                                                                                                                                                  apps/jobs/views.py on lines 2315..2319
                                                                                                                                                                                  apps/jobs/views.py on lines 2405..2409

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

                                                                                                                                                                                  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

                                                                                                                                                                                      if not is_user_a_host_of_challenge(request.user, challenge.id):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Sorry, you are not authorized to make this request!"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 4 other locations - About 1 hr to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 803..807
                                                                                                                                                                                  apps/jobs/views.py on lines 2113..2117
                                                                                                                                                                                  apps/jobs/views.py on lines 2315..2319
                                                                                                                                                                                  apps/jobs/views.py on lines 2509..2513

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      if not is_user_a_host_of_challenge(request.user, challenge_pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Sorry, you are not authorized to access this resource"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_401_UNAUTHORIZED)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 55 mins to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 284..286
                                                                                                                                                                                  apps/jobs/views.py on lines 1503..1507

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      if not is_user_a_host_of_challenge(request.user, challenge_pk):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Sorry, you are not authorized to make this request!"
                                                                                                                                                                                          }
                                                                                                                                                                                          return Response(response_data, status=status.HTTP_400_BAD_REQUEST)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 55 mins to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 284..286
                                                                                                                                                                                  apps/jobs/views.py on lines 2208..2212

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      if len(missing_metrics):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Following metrics are missing in the "
                                                                                                                                                                                              "leaderboard data: {}".format(missing_metrics)
                                                                                                                                                                                          }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 6 other locations - About 50 mins to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1193..1199
                                                                                                                                                                                  apps/jobs/views.py on lines 1202..1208
                                                                                                                                                                                  apps/jobs/views.py on lines 1598..1604
                                                                                                                                                                                  apps/jobs/views.py on lines 1803..1809
                                                                                                                                                                                  apps/jobs/views.py on lines 2363..2368
                                                                                                                                                                                  apps/jobs/views.py on lines 2370..2375

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  if len(malformed_metrics):
                                                                                                                                                                                                      response_data = {
                                                                                                                                                                                                          "error": "Values for following metrics are not of"
                                                                                                                                                                                                          "float/int: {}".format(malformed_metrics)
                                                                                                                                                                                                      }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 6 other locations - About 50 mins to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1193..1199
                                                                                                                                                                                  apps/jobs/views.py on lines 1598..1604
                                                                                                                                                                                  apps/jobs/views.py on lines 1803..1809
                                                                                                                                                                                  apps/jobs/views.py on lines 2356..2361
                                                                                                                                                                                  apps/jobs/views.py on lines 2363..2368
                                                                                                                                                                                  apps/jobs/views.py on lines 2370..2375

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      if len(malformed_metrics):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Values for following metrics are not of"
                                                                                                                                                                                              "float/int: {}".format(malformed_metrics)
                                                                                                                                                                                          }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 6 other locations - About 50 mins to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1193..1199
                                                                                                                                                                                  apps/jobs/views.py on lines 1202..1208
                                                                                                                                                                                  apps/jobs/views.py on lines 1598..1604
                                                                                                                                                                                  apps/jobs/views.py on lines 1803..1809
                                                                                                                                                                                  apps/jobs/views.py on lines 2356..2361
                                                                                                                                                                                  apps/jobs/views.py on lines 2363..2368

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                      if len(extra_metrics):
                                                                                                                                                                                          response_data = {
                                                                                                                                                                                              "error": "Following metrics are invalid in the "
                                                                                                                                                                                              "leaderboard data: {}".format(extra_metrics)
                                                                                                                                                                                          }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 6 other locations - About 50 mins to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1193..1199
                                                                                                                                                                                  apps/jobs/views.py on lines 1202..1208
                                                                                                                                                                                  apps/jobs/views.py on lines 1598..1604
                                                                                                                                                                                  apps/jobs/views.py on lines 1803..1809
                                                                                                                                                                                  apps/jobs/views.py on lines 2356..2361
                                                                                                                                                                                  apps/jobs/views.py on lines 2370..2375

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  if len(malformed_metrics):
                                                                                                                                                                                                      response_data = {
                                                                                                                                                                                                          "error": "Values for following metrics are not of"
                                                                                                                                                                                                          "float/int: {}".format(malformed_metrics)
                                                                                                                                                                                                      }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 6 other locations - About 50 mins to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1193..1199
                                                                                                                                                                                  apps/jobs/views.py on lines 1202..1208
                                                                                                                                                                                  apps/jobs/views.py on lines 1598..1604
                                                                                                                                                                                  apps/jobs/views.py on lines 2356..2361
                                                                                                                                                                                  apps/jobs/views.py on lines 2363..2368
                                                                                                                                                                                  apps/jobs/views.py on lines 2370..2375

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  if len(missing_metrics):
                                                                                                                                                                                                      response_data = {
                                                                                                                                                                                                          "error": "Following metrics are missing in the"
                                                                                                                                                                                                          "leaderboard data: {}".format(missing_metrics)
                                                                                                                                                                                                      }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 6 other locations - About 50 mins to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1202..1208
                                                                                                                                                                                  apps/jobs/views.py on lines 1598..1604
                                                                                                                                                                                  apps/jobs/views.py on lines 1803..1809
                                                                                                                                                                                  apps/jobs/views.py on lines 2356..2361
                                                                                                                                                                                  apps/jobs/views.py on lines 2363..2368
                                                                                                                                                                                  apps/jobs/views.py on lines 2370..2375

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  if len(malformed_metrics):
                                                                                                                                                                                                      response_data = {
                                                                                                                                                                                                          "error": "Values for following metrics are not of"
                                                                                                                                                                                                          "float/int: {}".format(malformed_metrics)
                                                                                                                                                                                                      }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 6 other locations - About 50 mins to fix
                                                                                                                                                                                  apps/jobs/views.py on lines 1193..1199
                                                                                                                                                                                  apps/jobs/views.py on lines 1202..1208
                                                                                                                                                                                  apps/jobs/views.py on lines 1803..1809
                                                                                                                                                                                  apps/jobs/views.py on lines 2356..2361
                                                                                                                                                                                  apps/jobs/views.py on lines 2363..2368
                                                                                                                                                                                  apps/jobs/views.py on lines 2370..2375

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

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              if serializer.is_valid():
                                                                                                                                                                                                  serializer.save()
                                                                                                                                                                                                  response_data = serializer.data
                                                                                                                                                                                                  return Response(response_data, status=status.HTTP_200_OK)
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 45 mins to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 63..66
                                                                                                                                                                                  apps/hosts/views.py on lines 153..156

                                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 35.

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                  @api_view(["GET", "DELETE"])
                                                                                                                                                                                  @throttle_classes([UserRateThrottle])
                                                                                                                                                                                  @permission_classes((permissions.IsAuthenticated, HasVerifiedEmail))
                                                                                                                                                                                  @authentication_classes((JWTAuthentication, ExpiringTokenAuthentication))
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in apps/jobs/views.py and 2 other locations - About 40 mins to fix
                                                                                                                                                                                  apps/hosts/views.py on lines 32..38
                                                                                                                                                                                  apps/hosts/views.py on lines 111..114

                                                                                                                                                                                  Duplicated Code

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

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

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

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 34.

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

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

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

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

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

                                                                                                                                                                                  Similar blocks of code found in 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

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

                                                                                                                                                                                  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

                                                                                                                                                                                  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(["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 1239..1243
                                                                                                                                                                                  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 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(["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(["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 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(["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(["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(["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 2917..2920

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

                                                                                                                                                                                  There are no issues that match your filters.

                                                                                                                                                                                  Category
                                                                                                                                                                                  Status