Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

Function ngOnInit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  ngOnInit() {
    if (this.authService.isLoggedIn()) {
      this.isLoggedIn = true;
    }
    this.routerPublic = this.router;

    Function onSuccess has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                        onSuccess: function() {
    
                            vm.team.error = false;
                            $rootScope.notify("info", "You have removed yourself successfully");
    
    
    Severity: Minor
    Found in frontend/src/js/controllers/teamsCtrl.js - About 1 hr to fix

      Function onSuccess has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          onSuccess: function() {
                              vm.team.error = false;
                              $rootScope.notify("info", "You have removed yourself successfully");
      
                              var parameters = {};
      Severity: Minor
      Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 1 hr to fix

        Function create_static_code_upload_submission_job_object has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def create_static_code_upload_submission_job_object(message, challenge):
            """Function to create the static code upload pod AWS EKS Job object
        
            Arguments:
                message {[dict]} -- Submission message from AWS SQS queue
        Severity: Minor
        Found in scripts/workers/code_upload_submission_worker.py - About 1 hr to fix

          Function ngOnInit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            ngOnInit() {
              this.challengeService.currentChallenge.subscribe((challenge) => {
                this.challenge = challenge;
              });
          
          

            Function stopParticipation has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              stopParticipation(event) {
                event.preventDefault();
                const participationState = this.challenge['is_registration_open'] ? 'Close' : 'Open';
                const closeParticipationMsg = 'Participation is closed successfully';
                const openParticipationMsg = 'Participation is opened successfully';

              Function editEvaluationScript has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                editEvaluationScript() {
                  const SELF = this;
                  SELF.apiCall = (params) => {
                    const FORM_DATA: FormData = new FormData();
                    FORM_DATA.append('evaluation_script', params['evaluation_script']);

                Function ngOnInit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  ngOnInit() {
                    if (this.authService.isLoggedIn()) {
                      this.isLoggedIn = true;
                    }
                    this.routerPublic = this.router;

                  Function start_job has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def start_job():
                  
                      # Get metrics
                      staff_evalai_interface = create_evalai_interface(STAFF_AUTH_TOKEN)
                  
                  
                  Severity: Minor
                  Found in scripts/monitoring/auto_scale_eks_nodes.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 stop_workers_for_challenges has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def stop_workers_for_challenges(response):
                      for challenge in response["results"]:
                          challenge_id = challenge["id"]
                          workers = challenge["workers"]
                          approved_by_admin = challenge["approved_by_admin"]
                  Severity: Minor
                  Found in scripts/monitoring/auto_stop_workers.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 remove_participant_team_from_challenge has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def remove_participant_team_from_challenge(
                      request, challenge_pk, participant_team_pk
                  ):
                      """
                      API to remove the participant team from a challenge
                  Severity: Minor
                  Found in apps/participants/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 manage_ec2_instance has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def manage_ec2_instance(request, challenge_pk, action):
                      if not request.user.is_staff:
                          response_data = {
                              "error": "Sorry, you are not authorized for access EC2 operations."
                          }
                  Severity: Minor
                  Found in apps/challenges/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 star_challenge has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def star_challenge(request, challenge_pk):
                      """
                      API endpoint for starring and unstarring
                      a challenge.
                      """
                  Severity: Minor
                  Found in apps/challenges/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 create_service_by_challenge_pk has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def create_service_by_challenge_pk(client, challenge, client_token):
                      """
                      Creates the worker service for a challenge, and sets the number of workers to one.
                  
                      Parameters:
                  Severity: Minor
                  Found in apps/challenges/aws_utils.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 __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def __init__(self, *args, **kwargs):
                          super(ChallengePhaseCreateSerializer, self).__init__(*args, **kwargs)
                          context = kwargs.get("context")
                          if context:
                              challenge = context.get("challenge")
                  Severity: Minor
                  Found in apps/challenges/serializers.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 selectPhaseSplitId has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    selectPhaseSplitId(id, self) {
                      let i = 0;
                      for (i = 0; i < self.filteredPhaseSplits.length; i++) {
                        if (parseInt(id, 10) === self.filteredPhaseSplits[i]['id']) {
                          self.selectedPhaseSplit = self.filteredPhaseSplits[i];

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function onSuccess has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  onSuccess: function() {
                                      $rootScope.notify("success", "Team " + vm.team.name + " has been created successfully!");
                                      vm.team.error = false;
                                      vm.stopLoader();
                                      vm.team = {};
                  Severity: Minor
                  Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                    Function startLoadingLogs has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            vm.startLoadingLogs = function () {
                                vm.logs_poller = $interval(function () {
                                    if (vm.evaluation_module_error) {
                                        vm.workerLogs = [];
                                        vm.workerLogs.push(vm.evaluation_module_error);
                    Severity: Minor
                    Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                      Function getAllChallenges has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              vm.getAllChallenges = function(parameters, counter){
                                  parameters.callback = {
                                      onSuccess: function(response) {
                                          var status = response.status;
                                          var details = response.data;
                      Severity: Minor
                      Found in frontend/src/js/controllers/dashCtrl.js - About 1 hr to fix

                        Function editChallengeTitle has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          editChallengeTitle() {
                            const SELF = this;
                        
                            SELF.apiCall = (params) => {
                              const BODY = JSON.stringify(params);
                          Severity
                          Category
                          Status
                          Source
                          Language