Cloud-CV/EvalAI

View on GitHub

Showing 666 of 1,371 total issues

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

  passwordStrength(password) {
    // Regular Expressions.
    const REGEX = new Array();
    REGEX.push('[A-Z]', '[a-z]', '[0-9]', '[$$!%*#?&]');

Severity: Minor
Found in frontend_v2/src/app/services/auth.service.ts - 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 resetPassword has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        vm.resetPassword = function(resetPassFormValid) {
            if (resetPassFormValid) {
                vm.startLoader("Sending Mail");
                var parameters = {};
                parameters.url = 'auth/password/reset/';
Severity: Minor
Found in frontend/src/js/controllers/authCtrl.js - About 1 hr to fix

    Function downloadSubmission has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      downloadSubmission() {
        if (this.challenge['id'] && this.selectedPhase && this.fileSelected) {
          const API_PATH = this.endpointsService.challengeSubmissionDownloadURL(
            this.challenge['id'],
            this.selectedPhase['id'],

      Function editChallengeOverview has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function phaseSplitSelected has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          phaseSplitSelected(phaseSplit) {
            const SELF = this;
            SELF.selectedPhaseSplit = phaseSplit;
            SELF.highlightedEntry = null;
        
        

          Function requestLink has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            requestLink() {
              const API_PATH = 'accounts/user/resend_email_verification/';
              const SELF = this;
              const token = this.authService.getUser['token'];
              const EMAIL_BODY = JSON.stringify({

            Function deleteTeamMemberWrapper has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              deleteTeamMemberWrapper() {
                const SELF = this;
                const deleteTeamMember = (team) => {
                  const deleteUrl = SELF.deleteMembersPath.replace('<team_id>', team.teamId);
                  SELF.apiCall = (params) => {

              Function getDateDifferenceString has 27 lines of code (exceeds 25 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 1 hr to fix

                Function editSubmissionGuideline has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function setWorkerResources has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          vm.setWorkerResources = function() {
                              parameters.url = "challenges/" + vm.challengeId + "/scale_resources/";
                              parameters.method = 'PUT';
                              parameters.data = {
                                  "worker_cpu_cores": vm.selectedWorkerResources[0],
                  Severity: Minor
                  Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                    Function onError has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                        onError: function(response) {
                                            if (response.status == 400) {
                                                vm.stopLoader();
                                                vm.isFormError = true;
                                                var non_field_errors, isUsername_valid, isEmail_valid, isPassword1_valid, isPassword2_valid;
                    Severity: Minor
                    Found in frontend/src/js/controllers/authCtrl.js - About 1 hr to fix

                      Function PermCtrl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function PermCtrl(utilities, $rootScope) {
                              var vm = this;
                      
                              // message for not verified users
                              vm.emailError = utilities.getData('emailError');
                      Severity: Minor
                      Found in frontend/src/js/controllers/permissionCtrl.js - About 1 hr to fix

                        Function load has 26 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/challengeCtrl.js - About 1 hr to fix

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

                          module.exports = function (config) {
                            config.set({
                              basePath: '',
                              frameworks: ['jasmine', '@angular-devkit/build-angular'],
                              plugins: [
                          Severity: Minor
                          Found in frontend_v2/karma.conf.js - About 1 hr to fix

                            Function deregister has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    vm.deregister = function(deregisterformvalid) {
                                        if (deregisterformvalid) {
                                            parameters.url = 'challenges/challenge/' + vm.challengeId + '/deregister/';
                                            parameters.method = 'POST';
                                            parameters.data = {};
                            Severity: Minor
                            Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                              Function onError has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                                  onError: function(response) {
                                                      if (response.status == 400) {
                                                          vm.errorResponse = response;
                                                          vm.stopLoader();
                                                          vm.isFormError = true;
                              Severity: Minor
                              Found in frontend/src/js/controllers/updateProfileCtrl.js - About 1 hr to fix

                                Function run_submission has 26 lines of code (exceeds 25 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 1 hr to fix

                                  Function run_submission has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  def run_submission(
                                      challenge_pk,
                                      challenge_phase,
                                      submission,
                                      user_annotation_file_path,
                                  Severity: Minor
                                  Found in scripts/workers/remote_submission_worker.py - About 1 hr to fix

                                    Function calculate_distinct_sorted_leaderboard_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    def calculate_distinct_sorted_leaderboard_data(
                                        user, challenge_obj, challenge_phase_split, only_public_entries, order_by
                                    ):
                                        """
                                        Function to calculate and return the sorted leaderboard data
                                    Severity: Minor
                                    Found in apps/jobs/utils.py - About 1 hr to fix

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

                                          SELF.apiCall = () => {
                                            const BODY = JSON.stringify({
                                              published: isPublished,
                                            });
                                            SELF.apiService
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language