Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

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

  userSignUp(signupFormValid) {
    if (signupFormValid) {
      let email = this.authService.regUser['email'];
      this.globalService.startLoader('Setting up your details!');
      const SIGNUP_BODY = JSON.stringify({
Severity: Major
Found in frontend_v2/src/app/components/auth/signup/signup.component.ts - About 2 hrs to fix

    ChallengeService has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @Injectable()
    export class ChallengeService {
      private defaultChallenge: any = { creator: {} };
      private defaultStars: any = { count: 0, is_starred: false };
      private defaultPublishChallenge: any = {
    Severity: Minor
    Found in frontend_v2/src/app/services/challenge.service.ts - About 2 hrs to fix

      Function refreshSubmissionData has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              vm.refreshSubmissionData = function() {
      
                  // get submissions of a particular challenge phase
      
                  if (!vm.isResult) {
      Severity: Major
      Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

        Function challengeCreate has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                vm.challengeCreate = function() {
                    if (vm.hostTeamId) {
                        var fileVal = angular.element(".file-path").val();
        
                        if (fileVal === null || fileVal === "") {
        Severity: Major
        Found in frontend/src/js/controllers/challengeCreate.js - About 2 hrs to fix

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

          import { Component, HostListener, Inject, OnInit } from '@angular/core';
          import { ApiService } from '../../../services/api.service';
          import { GlobalService } from '../../../services/global.service';
          import { AuthService } from '../../../services/auth.service';
          import { EndpointsService } from '../../../services/endpoints.service';

            Function delete_old_temp_directories has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            def delete_old_temp_directories(prefix='tmp'):
                temp_dir = tempfile.gettempdir()
            
                dir_creation_times = {}
            
            
            Severity: Minor
            Found in scripts/workers/submission_worker.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 getDateDifferenceString has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

              getDateDifferenceString(d1, d2) {
                const DIFF_DAYS = this.getDateDifference(d1, d2);
                if (DIFF_DAYS < 1) {
                  const DIFF_HOURS = DIFF_DAYS * 24;
                  if (DIFF_HOURS < 1) {
            Severity: Minor
            Found in frontend_v2/src/app/services/global.service.ts - 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 updatePassword has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              updatePassword() {
                const SELF = this;
                SELF.apiCall = (params) => {
                  const BODY = JSON.stringify(params);
                  SELF.apiService.postUrl(SELF.endpointsService.changePasswordURL(), BODY).subscribe(
            Severity: Major
            Found in frontend_v2/src/app/components/profile/profile.component.ts - About 2 hrs to fix

              File gulpfile.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              var gulp = require('gulp'),
                  del = require('del'),
                  _ = require('lodash'),
                  fs = require('fs'),
                  path = require('path'),
              Severity: Minor
              Found in gulpfile.js - About 2 hrs to fix

                Function ChallengeInviteCtrl has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function ChallengeInviteCtrl(utilities, $state, $rootScope, $stateParams) {
                
                        var vm = this;
                        vm.invitationKey = $stateParams.invitationKey;
                
                
                Severity: Major
                Found in frontend/src/js/controllers/ChallengeInviteCtrl.js - About 2 hrs to fix

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

                    ngOnInit() {
                      if (this.params) {
                        if (this.params['title']) {
                          this.title = this.params['title'];
                        }
                  Severity: Major
                  Found in frontend_v2/src/app/components/utility/modal/modal.component.ts - About 2 hrs to fix

                    Function challengeDateDialog has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      challengeDateDialog() {
                        const SELF = this;
                        SELF.apiCall = (params) => {
                          if (new Date(params.start_date).valueOf() < new Date(params.end_date).valueOf()) {
                            const BODY = JSON.stringify({

                      Function editTeamWrapper has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        editTeamWrapper() {
                          const SELF = this;
                          let TeamUrl;
                          const editTeam = (team) => {
                            const teamId = team['id'];

                        Function toggleSubmissionVisibility has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          toggleSubmissionVisibility() {
                            const SELF = this;
                            if (SELF.isLeaderboardPublic === true) {
                              let toggleSubmissionVisibilityState, isSubmissionPublic;
                              if (SELF.submissionVisibility.state === 'Public') {

                          Function downloadChallengeSubmissions has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  vm.downloadChallengeSubmissions = function() {
                                      if (vm.phaseId) {
                                          parameters.url = "challenges/" + vm.challengeId + "/phase/" + vm.phaseId + "/download_all_submissions/" + vm.fileSelected + "/";
                                          if (vm.fieldsToGet === undefined || vm.fieldsToGet.length === 0) {
                                              parameters.method = "GET";
                          Severity: Minor
                          Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                            Function exports has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            module.exports = function(config) {
                              var configuration = {
                            
                                // base path that will be used to resolve all patterns (eg. files, exclude)
                                basePath: '',
                            Severity: Minor
                            Found in karma.conf.js - About 1 hr to fix

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

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

                                Function deregister_participant_team_from_challenge has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def deregister_participant_team_from_challenge(request, challenge_pk):
                                    """
                                    Deregister a participant team from a challenge
                                    Arguments:
                                        challenge_pk {int} -- Challenge primary key
                                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 get_or_create_sqs_queue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                def get_or_create_sqs_queue(queue_name, challenge=None):
                                    """
                                    Args:
                                        queue_name: Name of the SQS Queue
                                    Returns:
                                Severity: Minor
                                Found in apps/jobs/sender.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 check_prizes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def check_prizes(self):
                                        # Verify Prizes are correct
                                        if "prizes" in self.yaml_file_data:
                                            rank_set = set()
                                            for prize in self.yaml_file_data["prizes"]:
                                Severity: Minor
                                Found in apps/challenges/challenge_config_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

                                Severity
                                Category
                                Status
                                Source
                                Language