Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

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

                                    onSuccess: function(response) {
                                        var status = response.status;
                                        var details = response.data;
                                        if (status == 200) {
                                            vm.existTeam = details;
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js - About 3 hrs to fix

    Function getLeaderboard has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            vm.getLeaderboard = function(phaseSplitId) {
                vm.isResult = true;
                vm.phaseSplitId = phaseSplitId;
                // loader for existing teams
                vm.isExistLoader = true;
    Severity: Major
    Found in frontend/src/js/controllers/featuredChallengeCtrl.js - About 3 hrs to fix

      Function runFunc has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function runFunc($rootScope, $state, utilities, $window, $location, toaster) {
              // setting timout for token (7days)
              // var getTokenTime = utilities.getData('tokenTime');
              // var timeNow = (new Date()).getTime();
              // .getTime() returns milliseconds, so for 7 days 1000 * 60 * 60 * 24 * 7 = 7 days
      Severity: Major
      Found in frontend/src/js/route-config/route-config.js - About 3 hrs to fix

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

                        onSuccess: function(response) {
                            var details = response.data;
                            vm.leaderboard = details.results;
                            for (var j=0; j<vm.showPrivateIds.length; j++) {
                                if (vm.showPrivateIds[j] == vm.phaseSplitId) {
        Severity: Major
        Found in frontend/src/js/controllers/challengeCtrl.js - About 3 hrs to fix

          File directives.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // define directives here
          (function() {
              'use strict';
              // dynamic header directive
              angular
          Severity: Minor
          Found in frontend/src/js/directives/directives.js - About 3 hrs to fix

            Function register_task_def_by_challenge_pk has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

            def register_task_def_by_challenge_pk(client, queue_name, challenge):
                """
                Registers the task definition of the worker for a challenge, before creating a service.
            
                Parameters:
            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 validateInput has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
            Open

              validateInput(e) {
                this.isDirty = true;
                this.value = e;
                e === '' ? (this.isEmpty = true) : (this.isEmpty = false);
                if (e === '' && this.isRequired) {
            Severity: Minor
            Found in frontend_v2/src/app/components/utility/input/input.component.ts - 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 onSuccess has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        onSuccess: function(response) {
                            var status = response.status;
                            var details = response.data;
                            if (status == 200) {
                                vm.existTeam = details;
            Severity: Major
            Found in frontend/src/js/controllers/teamsCtrl.js - About 3 hrs to fix

              Function ChallengeListCtrl has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function ChallengeListCtrl(utilities, $window, moment) {
                      var vm = this;
                      var userKey = utilities.getData('userKey');
                      var gmtOffset = moment().utcOffset();
                      var gmtSign = gmtOffset >= 0 ? '+' : '-';
              Severity: Major
              Found in frontend/src/js/controllers/challengeListCtrl.js - About 3 hrs to fix

                ChallengeleaderboardComponent has 27 functions (exceeds 20 allowed). Consider refactoring.
                Open

                @Component({
                  selector: 'app-challengeleaderboard',
                  templateUrl: './challengeleaderboard.component.html',
                  styleUrls: ['./challengeleaderboard.component.scss'],
                })

                  Function updateUserDetails has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    updateUserDetails() {
                      const firstName = this.user['first_name'] === '-' ? '' : this.user['first_name'];
                      const lastName = this.user['last_name'] === '-' ? '' : this.user['last_name'];
                      const affiliation = this.user['affiliation'] === '-' ? '' : this.user['affiliation'];
                      const googleScholarUrl = this.user['google_scholar_url'] === '-' ? '' : this.user['google_scholar_url'];
                  Severity: Major
                  Found in frontend_v2/src/app/components/profile/profile.component.ts - About 3 hrs to fix

                    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 ChangePwdCtrl has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function ChangePwdCtrl(utilities, $state, $rootScope) {
                            var vm = this;
                            var userKey = utilities.getData('userKey');
                            vm.wrnMsg = {};
                            vm.isValid = {};
                    Severity: Major
                    Found in frontend/src/js/controllers/changePwdCtrl.js - About 2 hrs to fix

                      Function updateProfile has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              vm.updateProfile = function(resetconfirmFormValid) {
                                  if (resetconfirmFormValid) {
                                      vm.user.github_url = vm.user.github_url === null ? "" : vm.user.github_url;
                                      vm.user.google_scholar_url = vm.user.google_scholar_url === null ? "" : vm.user.google_scholar_url;
                                      vm.user.linkedin_url = vm.user.linkedin_url === null ? "" : vm.user.linkedin_url;
                      Severity: Major
                      Found in frontend/src/js/controllers/updateProfileCtrl.js - About 2 hrs to fix

                        Function formSubmit has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          formSubmit(self) {
                            self.submissionError = '';
                            let metaValue = true;
                            const submissionFile = self.globalService.formItemForLabel(self.components, 'input_file').fileValue;
                            const submissionProjectUrl = self.globalService.formValueForLabel(self.components, 'project_url');

                          Function challenge_approval_callback has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def challenge_approval_callback(sender, instance, field_name, **kwargs):
                              """This is to check if a challenge has been approved or disapproved since last time.
                          
                              On approval of a challenge, it launches a worker on Fargate.
                              On disapproval, it scales down the workers to 0, and deletes the challenge's service on Fargate.
                          Severity: Minor
                          Found in apps/challenges/aws_utils.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 add_sponsors_to_challenge has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def add_sponsors_to_challenge(yaml_file_data, challenge):
                              if "sponsors" in yaml_file_data:
                                  sponsors_data = yaml_file_data['sponsors']
                                  sponsor_name_set = set()
                          
                          
                          Severity: Minor
                          Found in apps/challenges/utils.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 editSubmission has a Cognitive Complexity of 21 (exceeds 5 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) {

                          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 contactUsCtrl has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function contactUsCtrl(utilities, loaderService, $state, $rootScope) {
                                  var vm = this;
                                  var userKey = utilities.getData('userKey');
                                  vm.wrnMsg = {};
                                  vm.isValid = {};
                          Severity: Major
                          Found in frontend/src/js/controllers/contactUsCtrl.js - About 2 hrs to fix

                            Function showChallengeAnalysis has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              showChallengeAnalysis() {
                                this.globalService.startLoader('');
                                let API_PATH = this.endpointService.teamCountAnalyticsURL(this.challengeId);
                                this.apiService.getUrl(API_PATH).subscribe(
                                  (response) => {
                              Severity
                              Category
                              Status
                              Source
                              Language