Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

File teamsCtrl.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Invoking IIFE for teams
(function() {

    'use strict';

Severity: Minor
Found in frontend/src/js/controllers/teamsCtrl.js - About 4 hrs to fix

    Function validate_challenge_phase_splits has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def validate_challenge_phase_splits(self, current_phase_split_ids):
            challenge_phase_splits = self.yaml_file_data.get(
                "challenge_phase_splits"
            )
            # Check for duplicate combinations
    Severity: Minor
    Found in apps/challenges/challenge_config_utils.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 validate_dataset_splits has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        def validate_dataset_splits(self, current_dataset_config_ids):
            dataset_splits = self.yaml_file_data.get("dataset_splits")
            dataset_split_codenames = []
            self.dataset_splits_ids = []
            if dataset_splits:
    Severity: Minor
    Found in apps/challenges/challenge_config_utils.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 add_participant_team_to_challenge has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    def add_participant_team_to_challenge(
        request, challenge_pk, participant_team_pk
    ):
    
        try:
    Severity: Minor
    Found in apps/challenges/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 onSuccess has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                        onSuccess: function(response) {
                            var status = response.status;
                            var details = response.data;
                            parameters.url = 'analytics/challenge/' + vm.challengeId + '/team/count';
                            parameters.method = 'GET';
    Severity: Major
    Found in frontend/src/js/controllers/analyticsCtrl.js - About 4 hrs to fix

      File challengeHostTeamsCtrl.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Invoking IIFE for teams
      (function() {
      
          'use strict';
      
      
      Severity: Minor
      Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 4 hrs to fix

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

          ngOnInit() {
            if (this.params) {
              if (this.params['title']) {
                this.title = this.params['title'];
              }
        Severity: Minor
        Found in frontend_v2/src/app/components/utility/modal/modal.component.ts - 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 editSubmission has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          editSubmission(submission) {
            const SELF = this;
            SELF.apiCall = (params) => {
              let BODY = JSON.parse(JSON.stringify(params));
              if (this.selectedPhase.submission_meta_attributes !== null && this.selectedPhase.submission_meta_attributes !== undefined) {

          File authCtrl.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Invoking IIFE for auth
          (function() {
          
              'use strict';
          
          
          Severity: Minor
          Found in frontend/src/js/controllers/authCtrl.js - About 3 hrs to fix

            Function getAllSubmissionResults has 97 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    vm.getAllSubmissionResults = function(phaseId) {
                        vm.stopFetchingSubmissions = function() {
                            $interval.cancel(vm.poller);
                        };
            
            
            Severity: Major
            Found in frontend/src/js/controllers/challengeCtrl.js - About 3 hrs to fix

              File profileCtrl.js has 325 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              // Invoking IIFE for profile view
              
              (function() {
              
                  'use strict';
              Severity: Minor
              Found in frontend/src/js/controllers/profileCtrl.js - About 3 hrs to fix

                Function userSignUp has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        vm.userSignUp = function(signupFormValid) {
                            if (signupFormValid) {
                                vm.startLoader("Setting up your details!");
                                // call utility service
                                var parameters = {};
                Severity: Major
                Found in frontend/src/js/controllers/authCtrl.js - About 3 hrs to fix

                  Function makeSubmission has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          vm.makeSubmission = function() {
                              if (vm.isParticipated && vm.eligible_to_submit) {
                                  var fileVal = angular.element(".file-path").val();
                                  if ((fileVal === null || fileVal === "") && (vm.fileUrl === null || vm.fileUrl === "")) {
                                      vm.subErrors.msg = "Please upload file or enter submission URL!";
                  Severity: Major
                  Found in frontend/src/js/controllers/challengeCtrl.js - About 3 hrs to fix

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

                    import csv
                    
                    from datetime import timedelta
                    
                    from django.http import HttpResponse
                    Severity: Minor
                    Found in apps/analytics/views.py - About 3 hrs to fix

                      Function invite_users_to_challenge has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def invite_users_to_challenge(request, challenge_pk):
                      
                          challenge = get_challenge_model(challenge_pk)
                      
                          if not challenge.is_active or not challenge.approved_by_admin:
                      Severity: Minor
                      Found in apps/challenges/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

                      File common.py has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """
                      Django settings for evalai project.
                      
                      Generated by 'django-admin startproject' using Django 1.10.2.
                      
                      
                      Severity: Minor
                      Found in settings/common.py - About 3 hrs to fix

                        File urls.py has 315 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        from django.conf.urls import url
                        
                        from . import views
                        
                        urlpatterns = [
                        Severity: Minor
                        Found in apps/challenges/urls.py - About 3 hrs to fix

                          Function restart_workers_signal_callback has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def restart_workers_signal_callback(sender, instance, field_name, **kwargs):
                              """
                              Called when either evaluation_script or test_annotation_script for challenge
                              is updated, to restart the challenge workers.
                              """
                          Severity: Minor
                          Found in apps/challenges/aws_utils.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 getAllEntriesOnPublicLeaderboard has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  vm.getAllEntriesOnPublicLeaderboard = function(phaseSplitId) {
                                      vm.stopLeaderboard = function() {
                                          $interval.cancel(vm.poller);
                                      };
                                      vm.stopLeaderboard();
                          Severity: Major
                          Found in frontend/src/js/controllers/challengeCtrl.js - About 3 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language