Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

Function validate_leaderboards has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_leaderboards(self, current_leaderboard_config_ids):
        leaderboard = self.yaml_file_data.get("leaderboard")
        if leaderboard:
            for data in leaderboard:
                error = False
Severity: Minor
Found in apps/challenges/challenge_config_utils.py - About 6 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 getResults has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        vm.getResults = function(phaseId) {
            // long polling (5s) for leaderboard
            vm.start = function() {
                vm.stopFetchingSubmissions();
                vm.poller = $interval(function() {
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js - About 6 hrs to fix

    File teamlist.component.ts has 437 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Component, OnInit, ViewChildren, QueryList, OnDestroy } from '@angular/core';
    import { ApiService } from '../../../services/api.service';
    import { GlobalService } from '../../../services/global.service';
    import { AuthService } from '../../../services/auth.service';
    import { Router, ActivatedRoute } from '@angular/router';

      File challengeleaderboard.component.ts has 436 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { Component, OnInit, QueryList, ViewChildren, AfterViewInit, OnDestroy } from '@angular/core';
      import { MatDialog } from '@angular/material/dialog';
      import { Router, ActivatedRoute } from '@angular/router';
      
      // import component

        Function main has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

        def main():
            killer = GracefulKiller()
            logger.info(
                "{} Using {} as temp directory to store data".format(
                    WORKER_LOGS_PREFIX, BASE_TEMP_DIR
        Severity: Minor
        Found in scripts/workers/submission_worker.py - About 6 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 main has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
        Open

        def main():
            killer = GracefulKiller()
            evalai = EvalAI_Interface(
                AUTH_TOKEN=AUTH_TOKEN,
                EVALAI_API_SERVER=EVALAI_API_SERVER,
        Severity: Minor
        Found in scripts/workers/code_upload_submission_worker.py - About 5 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 fetchOurTeamMembers has 142 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          fetchOurTeamMembers() {
            const API_PATH = this.endpointsService.ourTeamURL();
            const SELF = this;
            SELF.apiService.getUrl(API_PATH).subscribe(
              (data) => {
        Severity: Major
        Found in frontend_v2/src/app/components/our-team/our-team.component.ts - About 5 hrs to fix

          Function DashCtrl has 137 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function DashCtrl(utilities, $state, $rootScope) {
                  var vm = this;
          
                  // User has verified email or not
                  vm.isPrivileged = true;
          Severity: Major
          Found in frontend/src/js/controllers/dashCtrl.js - About 5 hrs to fix

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

                    vm.showChallengeAnalysis = function() {
                        if (vm.challengeId != null) {
                            parameters.url = 'challenges/challenge/' + vm.challengeId + '/challenge_phase';
                            parameters.method = 'GET';
                            parameters.token = userKey;
            Severity: Major
            Found in frontend/src/js/controllers/analyticsCtrl.js - About 5 hrs to fix

              File admin.py has 386 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              from django import forms
              from django.contrib import admin, messages
              
              from django.contrib.admin.helpers import ActionForm
              
              
              Severity: Minor
              Found in apps/challenges/admin.py - About 5 hrs to fix

                Function validateModalInput has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                Open

                  validateModalInput(e) {
                    this.inputErrorMessage = '';
                    if (e.target.name === 'challegenDeleteInput') {
                      this.isDisabled = e.target.value !== this.challenge.title;
                    } else if (e.target.name === 'editChallengeTitle') {
                Severity: Minor
                Found in frontend_v2/src/app/components/utility/modal/modal.component.ts - About 5 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 global.service.ts has 375 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { Injectable, Output, EventEmitter } from '@angular/core';
                import { BehaviorSubject } from 'rxjs';
                
                @Injectable()
                export class GlobalService {
                Severity: Minor
                Found in frontend_v2/src/app/services/global.service.ts - About 5 hrs to fix

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

                          vm.getLeaderboard = function(phaseSplitId) {
                              vm.stopLeaderboard = function() {
                                  $interval.cancel(vm.poller);
                              };
                              vm.stopLeaderboard();
                  Severity: Major
                  Found in frontend/src/js/controllers/challengeCtrl.js - About 4 hrs to fix

                    GlobalService has 37 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    @Injectable()
                    export class GlobalService {
                      scrolledStateDefault = false;
                      toastErrorCodes = [400, 500];
                      authStorageKey = 'authtoken';
                    Severity: Minor
                    Found in frontend_v2/src/app/services/global.service.ts - About 4 hrs to fix

                      Function utilities has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function utilities($http, EnvironmentConfig) {
                      
                              // factory for API calls
                              this.sendRequest = function(parameters, header, type) {
                                  var url = EnvironmentConfig.API + parameters.url;
                      Severity: Major
                      Found in frontend/src/js/services/services.js - About 4 hrs to fix

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

                                                onSuccess: function(response) {
                                                    var details = response.data;
                                                    vm.currentDate = details.datetime_now;
                                                    for (var i in details.challenge_participant_team_list) {
                                                        if (details.challenge_participant_team_list[i].challenge !== null && details.challenge_participant_team_list[i].challenge.id == vm.challengeId) {
                        Severity: Major
                        Found in frontend/src/js/controllers/challengeCtrl.js - About 4 hrs to fix

                          ChallengesettingsComponent has 36 functions (exceeds 20 allowed). Consider refactoring.
                          Open

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

                            Function updateProfileCtrl has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function run_submission has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def run_submission(
                                  challenge_id, challenge_phase, submission, user_annotation_file_path
                              ):
                                  """
                                  * receives a challenge id, phase id and user annotation file path
                              Severity: Minor
                              Found in scripts/workers/submission_worker.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 31 (exceeds 5 allowed). Consider refactoring.
                              Open

                                ngOnInit() {
                                  if (this.params) {
                                    if (this.params['title']) {
                                      this.title = this.params['title'];
                                    }

                              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