Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

Function ChallengeCtrl has 2776 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function ChallengeCtrl(utilities, loaderService, $scope, $state, $http, $stateParams, $rootScope, $interval, $mdDialog, moment, $location, $anchorScroll, $timeout) {
        var vm = this;
        vm.areSubmissionsFailing = false;
        vm.getAllEntriesTestOption = "Include private submissions";
        vm.showPrivateIds = [];
Severity: Major
Found in frontend/src/js/controllers/challengeCtrl.js - About 1 wk to fix

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

    import csv
    import json
    import logging
    import os
    import pytz
    Severity: Major
    Found in apps/challenges/views.py - About 1 wk to fix

      File challengeCtrl.js has 2785 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // Invoking IIFE for challenge page
      (function() {
      
          'use strict';
          angular
      Severity: Major
      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 wk to fix

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

        import botocore
        import datetime
        import json
        import logging
        import os
        Severity: Major
        Found in apps/jobs/views.py - About 1 wk to fix

          File aws_utils.py has 1597 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import json
          import logging
          import os
          import random
          import string
          Severity: Major
          Found in apps/challenges/aws_utils.py - About 4 days to fix

            Function create_challenge_using_zip_file has a Cognitive Complexity of 203 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_challenge_using_zip_file(request, challenge_host_team_pk):
                """
                Creates a challenge using a zip file.
                """
                challenge_host_team = get_challenge_host_team_model(challenge_host_team_pk)
            Severity: Minor
            Found in apps/challenges/views.py - About 4 days 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 create_or_update_github_challenge has a Cognitive Complexity of 199 (exceeds 5 allowed). Consider refactoring.
            Open

            def create_or_update_github_challenge(request, challenge_host_team_pk):
                try:
                    challenge_host_team = get_challenge_host_team_model(
                        challenge_host_team_pk
                    )
            Severity: Minor
            Found in apps/challenges/views.py - About 4 days 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 challengesettings.component.ts has 1176 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { Component, OnInit, OnDestroy, QueryList, ViewChildren } from '@angular/core';
            import { COMMA, ENTER } from '@angular/cdk/keycodes';
            import { MatChipInputEvent } from '@angular/material/chips';
            import { Router } from '@angular/router';
            import { NGXLogger } from 'ngx-logger';

              Function configure has 578 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function configure($stateProvider, $urlRouterProvider, $locationProvider, $urlMatcherFactoryProvider) {
              
                      //in order to prevent 404 for trailing '/' in urls
                      $urlMatcherFactoryProvider.strictMode(false);
              
              
              Severity: Major
              Found in frontend/src/js/route-config/route-config.js - About 2 days to fix

                Function update_partially_evaluated_submission has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
                Open

                def update_partially_evaluated_submission(request, challenge_pk):
                    """
                    API endpoint to update submission related attributes
                
                    Query Parameters:
                Severity: Minor
                Found in apps/jobs/views.py - About 2 days 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 challenge_config_utils.py has 1029 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import logging
                import requests
                import zipfile
                import yaml
                
                
                Severity: Major
                Found in apps/challenges/challenge_config_utils.py - About 2 days to fix

                  File submission_worker.py has 771 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  from __future__ import (absolute_import, division, print_function,
                                          unicode_literals)
                  
                  import contextlib
                  import importlib
                  Severity: Major
                  Found in scripts/workers/submission_worker.py - About 1 day to fix

                    Function TeamsCtrl has 347 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function TeamsCtrl(utilities,loaderService, $scope, $state, $http, $rootScope, $mdDialog) {
                            var vm = this;
                            var userKey = utilities.getData('userKey');
                            var challengePk = 1;
                    
                    
                    Severity: Major
                    Found in frontend/src/js/controllers/teamsCtrl.js - About 1 day to fix

                      File code_upload_submission_worker.py has 729 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import json
                      import logging
                      import os
                      import signal
                      import sys
                      Severity: Major
                      Found in scripts/workers/code_upload_submission_worker.py - About 1 day to fix

                        Function ChallengeHostTeamsCtrl has 328 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function ChallengeHostTeamsCtrl(utilities, loaderService, $scope, $state, $http, $rootScope, $mdDialog) {
                                var vm = this;
                                var userKey = utilities.getData('userKey');
                        
                                utilities.showLoader();
                        Severity: Major
                        Found in frontend/src/js/controllers/challengeHostTeamsCtrl.js - About 1 day to fix

                          Function AuthCtrl has 320 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function AuthCtrl(utilities, $state, $rootScope) {
                                  var vm = this;
                                  // condition for showing password strength
                                  vm.showPasswordStrength = false;
                                  vm.isRem = false;
                          Severity: Major
                          Found in frontend/src/js/controllers/authCtrl.js - About 1 day to fix

                            Function update_submission has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def update_submission(request, challenge_pk):
                                """
                                API endpoint to update submission related attributes
                            
                                Query Parameters:
                            Severity: Minor
                            Found in apps/jobs/views.py - About 1 day 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 profileCtrl has 316 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function profileCtrl(utilities, $rootScope, $scope, $mdDialog, moment, $state) {
                                    var vm = this;
                            
                                    vm.user = {};
                                    vm.countLeft = 0;
                            Severity: Major
                            Found in frontend/src/js/controllers/profileCtrl.js - About 1 day to fix

                              File route-config.js has 680 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /**
                               * Config for the router
                               */
                              
                              (function () {
                              Severity: Major
                              Found in frontend/src/js/route-config/route-config.js - About 1 day to fix

                                Function validate_challenge_phases has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    def validate_challenge_phases(self, current_phase_config_ids):
                                        challenge_phases_data = self.yaml_file_data.get("challenge_phases")
                                        if not challenge_phases_data:
                                            message = self.error_messages_dict["missing_challenge_phases"]
                                            self.error_messages.append(message)
                                Severity: Minor
                                Found in apps/challenges/challenge_config_utils.py - About 1 day 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