Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

Function storeMetadata has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Function load has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                        vm.load = function(url) {
                            // loader for loading submissions
                            vm.startLoader = loaderService.startLoader;
                            vm.startLoader("Loading Submissions");
                            if (url !== null) {
    Severity: Minor
    Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

      Function setRefreshJWT has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              vm.setRefreshJWT = function () {
                  var parameters = {};
                  parameters.url = 'accounts/user/get_auth_token';
                  parameters.method = 'GET';
                  parameters.token = utilities.getData('userKey');
      Severity: Minor
      Found in frontend/src/js/controllers/authCtrl.js - About 1 hr to fix

        Function dynHeaderController has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function dynHeaderController(utilities) {
            var vm = this;
        
            vm.user = {};
        
        
        Severity: Minor
        Found in frontend/src/js/directives/directives.js - About 1 hr to fix

          Function load has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                              vm.load = function(url) {
                                  // loader for existing teams
                                  vm.isExistLoader = true;
                                  vm.loaderTitle = '';
                                  vm.loaderContainer = angular.element('.exist-team-card');
          Severity: Minor
          Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 1 hr to fix

            Function load has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                                vm.load = function(url) {
                                    // loader for existing teams
                                    vm.isExistLoader = true;
                                    vm.loaderTitle = '';
                                    vm.loaderContainer = angular.element('.exist-team-card');
            Severity: Minor
            Found in frontend/src/js/controllers/teamsCtrl.js - About 1 hr to fix

              Function inviteOthers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      vm.inviteOthers = function(ev, hostTeamId) {
                          ev.stopPropagation();
                          // Appending dialog to document.body 
                          var confirm = $mdDialog.prompt()
                              .title('Add other members to your team')
              Severity: Minor
              Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 1 hr to fix

                Function editEvaluationCriteria has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  editEvaluationCriteria() {
                    const SELF = this;
                    SELF.apiCall = (params) => {
                      const BODY = JSON.stringify(params);
                      SELF.apiService

                  Function editTermsAndConditions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    editTermsAndConditions() {
                      const SELF = this;
                      SELF.apiCall = (params) => {
                        const BODY = JSON.stringify(params);
                        SELF.apiService

                    Function apiCall has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        SELF.apiCall = (params) => {
                          let BODY = JSON.parse(JSON.stringify(params));
                          if (this.selectedPhase.submission_meta_attributes !== null && this.selectedPhase.submission_meta_attributes !== undefined) {
                            BODY["submission_metadata"] = [] 
                            for (let idx=0; idx < this.selectedPhase.submission_meta_attributes.length; idx++) {

                      Function displayDockerSubmissionInstructions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        displayDockerSubmissionInstructions(challenge, isParticipated) {
                          if (isParticipated) {
                            const API_PATH = this.endpointsService.challengeSubmissionsRemainingURL(challenge);
                            const SELF = this;
                            this.apiService.getUrl(API_PATH).subscribe(

                        Function make_team_name_unique has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def make_team_name_unique():
                            participant_team_list = []
                            host_team_list = []
                            participant_team_iter = 1
                        
                        
                        Severity: Minor
                        Found in scripts/migration/set_team_name_unique.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 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 handle_submission_resume has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def handle_submission_resume(submission, updated_status):
                            """
                            Function to handle the submission resuming. It is handled in the following way -
                            1. Change the submissions status to resumed
                        
                        
                        Severity: Minor
                        Found in apps/jobs/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 setup_eks_cluster has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def setup_eks_cluster(challenge):
                            """
                            Creates EKS and NodeGroup ARN roles
                        
                            Arguments:
                        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 challenge_host_detail has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def challenge_host_detail(request, challenge_host_team_pk, pk):
                            try:
                                challenge_host_team = ChallengeHostTeam.objects.get(
                                    pk=challenge_host_team_pk
                                )
                        Severity: Minor
                        Found in apps/hosts/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 scale_workers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def scale_workers(queryset, num_of_tasks):
                            """
                            The function called by the admin action method to scale all the selected workers.
                        
                            Calls the service_manager method. Before calling, checks if the target scaling number is different than current.
                        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 delete_workers has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def delete_workers(queryset):
                            """
                            The function called by the admin action method to delete all the selected workers.
                        
                            Calls the delete_service_by_challenge_pk method. Before calling, verifies that the challenge is not new.
                        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 handle_submission_rerun has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def handle_submission_rerun(submission, updated_status):
                            """
                            Function to handle the submission re-running. It is handled in the following way -
                            1. Invalidate the old submission
                            2. Create a new submission object for the re-running submission
                        Severity: Minor
                        Found in apps/jobs/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 notify_users_about_challenge has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def notify_users_about_challenge(request):
                            """
                            Email New Challenge Details to EvalAI Users
                            """
                            if request.user.is_authenticated and request.user.is_superuser:
                        Severity: Minor
                        Found in apps/web/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

                        Severity
                        Category
                        Status
                        Source
                        Language