Cloud-CV/EvalAI

View on GitHub
frontend/src/js/controllers/challengeCtrl.js

Summary

Maintainability
F
2 mos
Test Coverage

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 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

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

                  onSuccess: function(response) {
                      var details = response.data;
                      vm.page = details;
                      var offset = new Date(vm.page.start_date).getTimezoneOffset();
                      vm.page.time_zone = moment.tz.zone(timezone).abbr(offset);
      Severity: Major
      Found in frontend/src/js/controllers/challengeCtrl.js - About 7 hrs to fix

        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

          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

            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

              Function getAllSubmissionResults has 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      vm.getAllSubmissionResults = function(phaseId) {
                          vm.stopFetchingSubmissions = function() {
                              $interval.cancel(vm.poller);
                          };
              
              
              Severity: Major
              Found in frontend/src/js/controllers/challengeCtrl.js - About 3 hrs to fix

                Function makeSubmission has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        vm.makeSubmission = function() {
                            if (vm.isParticipated && vm.eligible_to_submit) {
                                var fileVal = angular.element(".file-path").val();
                                if ((fileVal === null || fileVal === "") && (vm.fileUrl === null || vm.fileUrl === "")) {
                                    vm.subErrors.msg = "Please upload file or enter submission URL!";
                Severity: Major
                Found in frontend/src/js/controllers/challengeCtrl.js - About 3 hrs to fix

                  Function getAllEntriesOnPublicLeaderboard has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    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 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

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

                                        onSuccess: function(response) {
                                            var details = response.data;
                        
                                            for (var i = 0; i < details.results.length; i++) {
                                                vm.submissionVisibility[details.results[i].id] = details.results[i].is_public;
                        Severity: Major
                        Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

                                          onSuccess: function(response) {
                                              var details = response.data;
                                              vm.submissionResult = details;
                          
                                              if (Array.isArray(vm.submissionResult.results)) {
                          Severity: Major
                          Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

                                            onSuccess: function(response) {
                                                var details = response.data;
                                                vm.leaderboard = details.results;
                            
                                                // setting last_submission time
                            Severity: Major
                            Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

                              Function showRemainingSubmissions has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      vm.showRemainingSubmissions = function(phaseID) {
                                          vm.remainingSubmissions = {};
                                          vm.remainingTime = {};
                                          vm.showClock = false;
                                          vm.showSubmissionNumbers = false;
                              Severity: Major
                              Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

                                            onSuccess: function(response) {
                                                var details = response.data;
                                                vm.phases = details;
                                                for (var i=0; i<details.count; i++) {
                                                    if (details.results[i].is_public == false) {
                                Severity: Major
                                Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

                                  Function createNewTeam has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          vm.createNewTeam = function() {
                                              vm.isLoader = true;
                                              vm.loaderTitle = '';
                                              vm.newContainer = angular.element('.new-team-card');
                                  
                                  
                                  Severity: Major
                                  Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

                                                vm.displayDockerSubmissionInstructions = function (isDockerBased, isParticipated) {
                                                // get remaining submission for docker based challenge
                                                if (isDockerBased && isParticipated == true && vm.eligible_to_submit) {
                                                    parameters.url = 'jobs/' + vm.challengeId + '/remaining_submissions/';
                                                    parameters.method = 'GET';
                                    Severity: Major
                                    Found in frontend/src/js/controllers/challengeCtrl.js - About 2 hrs to fix

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

                                              vm.editChallengePhase = function(editChallengePhaseForm) {
                                                  if (editChallengePhaseForm) {
                                                      vm.challengePhaseId = vm.page.challenge_phase.id;
                                                      parameters.url = "challenges/challenge/" + vm.challengeId + "/challenge_phase/" + vm.challengePhaseId;
                                                      parameters.method = 'PATCH';
                                      Severity: Major
                                      Found in frontend/src/js/controllers/challengeCtrl.js - 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 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 onSuccess has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                            onSuccess: function(response) {
                                                                var status = response.status;
                                                                for (var phase in response.data.phases) {
                                                                    if (response.data.phases[phase].id == phaseID) {
                                                                       var details = response.data.phases[phase].limits;
                                            Severity: Minor
                                            Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                              Function changeSubmissionVisibility has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                      vm.changeSubmissionVisibility = function(submission_id, submissionVisibility) {
                                                          parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" + vm.phaseId + "/submission/" + submission_id;
                                                          parameters.method = 'PATCH';
                                                          parameters.data = {
                                                              "is_public": submissionVisibility
                                              Severity: Minor
                                              Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                Function editChallengeDate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                        vm.editChallengeDate = function(editChallengeDateForm) {
                                                            if (editChallengeDateForm) {
                                                                var challengeHostList = utilities.getData("challengeCreator");
                                                                for (var challenge in challengeHostList) {
                                                                    if (challenge == vm.challengeId) {
                                                Severity: Minor
                                                Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                  Function ChallengeCtrl has 13 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      function ChallengeCtrl(utilities, loaderService, $scope, $state, $http, $stateParams, $rootScope, $interval, $mdDialog, moment, $location, $anchorScroll, $timeout) {
                                                  Severity: Major
                                                  Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

                                                                        onSuccess: function (response) {
                                                                            vm.phaseRemainingSubmissions = response.data;
                                                                            var details = vm.phaseRemainingSubmissions.phases;
                                                                            for (var i = 0; i < details.length; i++) {
                                                                                if (details[i].limits.submission_limit_exceeded === true) {
                                                    Severity: Minor
                                                    Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                      Function toggleParticipation has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                              vm.toggleParticipation = function (ev, isRegistrationOpen) {
                                                                  // ev.stopPropagation();
                                                                  var participationState;
                                                                  var participationModalText;
                                                                  if (isRegistrationOpen) {
                                                      Severity: Minor
                                                      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                        Function editEvalScript has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                                vm.editEvalScript = function(editEvaluationCriteriaForm) {
                                                                    if (editEvaluationCriteriaForm) {
                                                                        if (vm.editEvaluationScript === undefined || vm.editEvaluationScript === null
                                                                             || vm.editEvaluationScript === "") {
                                                                            var error = "Please upload a valid evaluation script!";
                                                        Severity: Minor
                                                        Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                          Function check_approval_status has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                                  vm.check_approval_status = function(challengeId, participant_team_id, approved_status, formvalid){
                                                                      var parameters = {};
                                                                      parameters.token = utilities.getData('userKey');
                                                                      parameters.method = 'POST';
                                                                      if(approved_status) {
                                                          Severity: Minor
                                                          Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                            Function publishChallenge has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                                    vm.publishChallenge = function(ev) {
                                                                        ev.stopPropagation();
                                                                        vm.toggleChallengeState = null;
                                                                        vm.publishDesc = null;
                                                                        if (vm.isPublished)
                                                            Severity: Minor
                                                            Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                              Function editChallengeTag has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                      vm.editChallengeTag = function(editChallengeTagDomainForm) {
                                                                          var new_tags;
                                                                          if (!editChallengeTagDomainForm) {
                                                                              $mdDialog.hide();
                                                                              return;
                                                              Severity: Minor
                                                              Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                Function startLoadingLogs has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                        vm.startLoadingLogs = function () {
                                                                            vm.logs_poller = $interval(function () {
                                                                                if (vm.evaluation_module_error) {
                                                                                    vm.workerLogs = [];
                                                                                    vm.workerLogs.push(vm.evaluation_module_error);
                                                                Severity: Minor
                                                                Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

                                                                                  onSuccess: function() {
                                                                                      $rootScope.notify("success", "Team " + vm.team.name + " has been created successfully!");
                                                                                      vm.team.error = false;
                                                                                      vm.stopLoader();
                                                                                      vm.team = {};
                                                                  Severity: Minor
                                                                  Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

                                                                                    onSuccess: function(response) {
                                                                                        var details = response.data;
                                                                                        vm.submissionResult = details;
                                                                    
                                                                                        if (vm.submissionResult.count === 0) {
                                                                    Severity: Minor
                                                                    Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                      Function start has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                                  vm.start = function() {
                                                                                      vm.stopFetchingSubmissions();
                                                                                      vm.poller = $interval(function() {
                                                                                          parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" + vm.phaseId + "/submission/?page=" + Math.ceil(vm.currentPage);
                                                                                          parameters.method = 'GET';
                                                                      Severity: Minor
                                                                      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                        Function editEvaluationCriteria has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                                vm.editEvaluationCriteria = function(editEvaluationCriteriaForm) {
                                                                                    if (editEvaluationCriteriaForm) {
                                                                                        var challengeHostList = utilities.getData("challengeCreator");
                                                                                        for (var challenge in challengeHostList) {
                                                                                            if (challenge == vm.challengeId) {
                                                                        Severity: Minor
                                                                        Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                          Function editChallengeTitle has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                                  vm.editChallengeTitle = function(editChallengeTitleForm) {
                                                                                      if (editChallengeTitleForm) {
                                                                                          var challengeHostList = utilities.getData("challengeCreator");
                                                                                          for (var challenge in challengeHostList) {
                                                                                              if (challenge == vm.challengeId) {
                                                                          Severity: Minor
                                                                          Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

                                                                                    vm.editSubmissionGuideline = function(editSubmissionGuidelinesForm) {
                                                                                        if (editSubmissionGuidelinesForm) {
                                                                                            var challengeHostList = utilities.getData("challengeCreator");
                                                                                            for (var challenge in challengeHostList) {
                                                                                                if (challenge == vm.challengeId) {
                                                                            Severity: Minor
                                                                            Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                              Function editTermsAndConditions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                      vm.editTermsAndConditions = function(editTermsAndConditionsForm) {
                                                                                          if (editTermsAndConditionsForm) {
                                                                                              var challengeHostList = utilities.getData("challengeCreator");
                                                                                              for (var challenge in challengeHostList) {
                                                                                                  if (challenge == vm.challengeId) {
                                                                              Severity: Minor
                                                                              Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

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

                                                                                        vm.editChallengeOverview = function(editChallengeOverviewForm) {
                                                                                            if (editChallengeOverviewForm) {
                                                                                                var challengeHostList = utilities.getData("challengeCreator");
                                                                                                for (var challenge in challengeHostList) {
                                                                                                    if (challenge == vm.challengeId) {
                                                                                Severity: Minor
                                                                                Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                                  Function logs_poller has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                              vm.logs_poller = $interval(function () {
                                                                                                  if (vm.evaluation_module_error) {
                                                                                                      vm.workerLogs = [];
                                                                                                      vm.workerLogs.push(vm.evaluation_module_error);
                                                                                                  }
                                                                                  Severity: Minor
                                                                                  Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                                    Function fetchRefreshJWTToken has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                    Open

                                                                                            vm.fetchRefreshJWTToken = function () {
                                                                                                if (userKey) {
                                                                                                    var parameters = {};
                                                                                                    parameters.url = 'accounts/user/get_auth_token';
                                                                                                    parameters.method = 'GET';
                                                                                    Severity: Minor
                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                                      Function updateSubmissionMetaData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                              vm.updateSubmissionMetaData = function(updateSubmissionMetaDataForm) {
                                                                                                  if (updateSubmissionMetaDataForm) {
                                                                                                      parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" + vm.phaseId + "/submission/" + vm.submissionId;
                                                                                                      parameters.method = 'PATCH';
                                                                                                      parameters.data = {
                                                                                      Severity: Minor
                                                                                      Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                                        Function poller has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                                        vm.poller = $interval(function() {
                                                                                                            parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" + vm.phaseId + "/submission/?page=" + Math.ceil(vm.currentPage);
                                                                                                            parameters.method = 'GET';
                                                                                                            parameters.data = {};
                                                                                                            parameters.callback = {
                                                                                        Severity: Minor
                                                                                        Found in frontend/src/js/controllers/challengeCtrl.js - About 1 hr to fix

                                                                                          Function load has 30 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 load has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                                                vm.load = function(url) {
                                                                                                                    // loader for loading submissions
                                                                                                                    vm.startLoader = loaderService.startLoader;
                                                                                                                    vm.startLoader("Loading Submissions");
                                                                                                                    if (url !== null) {
                                                                                            Severity: Minor
                                                                                            Found in frontend/src/js/controllers/challengeCtrl.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 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 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

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                                                            if (vm.existTeam.previous === null) {
                                                                                                                                                                vm.isPrev = 'disabled';
                                                                                                                                                            } else {
                                                                                                                                                                vm.isPrev = '';
                                                                                                                                                            }
                                                                                                    Severity: Major
                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                                  if (days.toFixed(0)==1) {
                                                                                                                                      vm.leaderboard[i].timeSpan = 'day';
                                                                                                                                  } else {
                                                                                                                                      vm.leaderboard[i].timeSpan = 'days';
                                                                                                                                  }
                                                                                                      Severity: Major
                                                                                                      Found in frontend/src/js/controllers/challengeCtrl.js - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                    if (days.toFixed(0) == 1) {
                                                                                                                                        vm.leaderboard[i].timeSpan = 'day';
                                                                                                                                    } else {
                                                                                                                                        vm.leaderboard[i].timeSpan = 'days';
                                                                                                                                    }
                                                                                                        Severity: Major
                                                                                                        Found in frontend/src/js/controllers/challengeCtrl.js - About 45 mins to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                                                                  if (vm.existTeam.next === null) {
                                                                                                                                                                      vm.isNext = 'disabled';
                                                                                                                                                                      vm.currentPage = vm.existTeam.count / 10;
                                                                                                                                                                  } else {
                                                                                                                                                                      vm.isNext = '';
                                                                                                          Severity: Major
                                                                                                          Found in frontend/src/js/controllers/challengeCtrl.js - About 45 mins to fix

                                                                                                            Avoid deeply nested control flow statements.
                                                                                                            Open

                                                                                                                                    } else if (duration._data.hours != 0) {
                                                                                                                                        var hours = duration.asHours();
                                                                                                                                        vm.leaderboard[i].submission__submitted_at = hours;
                                                                                                                                        if (hours.toFixed(0) == 1) {
                                                                                                                                            vm.leaderboard[i].timeSpan = 'hour';
                                                                                                            Severity: Major
                                                                                                            Found in frontend/src/js/controllers/challengeCtrl.js - About 45 mins to fix

                                                                                                              Avoid deeply nested control flow statements.
                                                                                                              Open

                                                                                                                                      else if (duration._data.hours !=0) {
                                                                                                                                          var hours = duration.asHours();
                                                                                                                                          vm.leaderboard[i].submission__submitted_at = hours;
                                                                                                                                          if (hours.toFixed(0)==1) {
                                                                                                                                              vm.leaderboard[i].timeSpan = 'hour';
                                                                                                              Severity: Major
                                                                                                              Found in frontend/src/js/controllers/challengeCtrl.js - About 45 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                                return key.submission__execution_time;
                                                                                                                Severity: Major
                                                                                                                Found in frontend/src/js/controllers/challengeCtrl.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                              return 0;
                                                                                                                  Severity: Major
                                                                                                                  Found in frontend/src/js/controllers/challengeCtrl.js - About 30 mins to fix

                                                                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                            if (duration._data.years != 0) {
                                                                                                                                                var years = duration.asYears();
                                                                                                                                                vm.leaderboard[i].submission__submitted_at = years;
                                                                                                                                                if (years.toFixed(0) == 1) {
                                                                                                                                                    vm.leaderboard[i].timeSpan = 'year';
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 4 days to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1113..1166
                                                                                                                    frontend/src/js/controllers/featuredChallengeCtrl.js on lines 136..189

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 683.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                            if (duration._data.years != 0) {
                                                                                                                                                var years = duration.asYears();
                                                                                                                                                vm.leaderboard[i].submission__submitted_at = years;
                                                                                                                                                if (years.toFixed(0)==1) {
                                                                                                                                                    vm.leaderboard[i].timeSpan = 'year';
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 4 days to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1597..1645
                                                                                                                    frontend/src/js/controllers/featuredChallengeCtrl.js on lines 136..189

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 683.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.editSubmissionGuideline = function(editSubmissionGuidelinesForm) {
                                                                                                                                if (editSubmissionGuidelinesForm) {
                                                                                                                                    var challengeHostList = utilities.getData("challengeCreator");
                                                                                                                                    for (var challenge in challengeHostList) {
                                                                                                                                        if (challenge == vm.challengeId) {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2432..2468
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2571..2607
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2680..2714

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 326.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.editEvaluationCriteria = function(editEvaluationCriteriaForm) {
                                                                                                                                if (editEvaluationCriteriaForm) {
                                                                                                                                    var challengeHostList = utilities.getData("challengeCreator");
                                                                                                                                    for (var challenge in challengeHostList) {
                                                                                                                                        if (challenge == vm.challengeId) {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2432..2468
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2521..2557
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2680..2714

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 326.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.editChallengeOverview = function(editChallengeOverviewForm) {
                                                                                                                                if (editChallengeOverviewForm) {
                                                                                                                                    var challengeHostList = utilities.getData("challengeCreator");
                                                                                                                                    for (var challenge in challengeHostList) {
                                                                                                                                        if (challenge == vm.challengeId) {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2521..2557
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2571..2607
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2680..2714

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 326.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 4 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.editTermsAndConditions = function(editTermsAndConditionsForm) {
                                                                                                                                if (editTermsAndConditionsForm) {
                                                                                                                                    var challengeHostList = utilities.getData("challengeCreator");
                                                                                                                                    for (var challenge in challengeHostList) {
                                                                                                                                        if (challenge == vm.challengeId) {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 1 day to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2432..2468
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2521..2557
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2571..2607

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 326.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                            if (url !== null) {
                                                                                                                    
                                                                                                                                                //store the header data in a variable
                                                                                                                                                var headers = {
                                                                                                                                                    'Authorization': "Token " + userKey
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 1 day to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1854..1887

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 316.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                            if (url !== null) {
                                                                                                                    
                                                                                                                                                //store the header data in a variable
                                                                                                                                                var headers = {
                                                                                                                                                    'Authorization': "Token " + userKey
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 1 day to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1362..1395

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 316.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        parameters.callback = {
                                                                                                                                            onSuccess: function(response) {
                                                                                                                                                var status = response.status;
                                                                                                                                                var details = response.data;
                                                                                                                                                if (status == 200) {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 1 day to fix
                                                                                                                    frontend/src/js/controllers/challengeHostTeamsCtrl.js on lines 247..279
                                                                                                                    frontend/src/js/controllers/teamsCtrl.js on lines 199..231

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 259.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        for (var i = 0; i < details.results.length; i++) {
                                                                                                                                            vm.submissionVisibility[details.results[i].id] = details.results[i].is_public;
                                                                                                                                            vm.baselineStatus[details.results[i].id] = details.results[i].is_baseline;
                                                                                                                                            vm.verifiedStatus[details.results[i].id] = details.results[i].is_verified_by_host;
                                                                                                                                        }
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 5 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1221..1225

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 150.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                                for (var i = 0; i < details.results.length; i++) {
                                                                                                                                                    vm.submissionVisibility[details.results[i].id] = details.results[i].is_public;
                                                                                                                                                    vm.baselineStatus[details.results[i].id] = details.results[i].is_baseline;
                                                                                                                                                    vm.verifiedStatus[details.results[i].id] = details.results[i].is_verified_by_host;
                                                                                                                                                }
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 5 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1464..1468

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 150.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    if (vm.has_sponsors) {
                                                                                                                                        parameters.url = 'challenges/challenge/' + vm.challengeId + '/sponsors/';
                                                                                                                                        parameters.method = 'GET';
                                                                                                                                        parameters.data = {};
                                                                                                                                        parameters.callback = {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 408..422

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 133.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    if (vm.hasPrizes) {
                                                                                                                                        parameters.url = 'challenges/challenge/' + vm.challengeId + '/prizes/';
                                                                                                                                        parameters.method = 'GET';
                                                                                                                                        parameters.data = {};
                                                                                                                                        parameters.callback = {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 426..440

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 133.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        parameters.callback = {
                                                                                                                                            onSuccess: function(response) {
                                                                                                                                                var details = response.data;
                                                                                                                                                var anchor = angular.element('<a/>');
                                                                                                                                                anchor.attr({
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2178..2191

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 128.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        parameters.callback = {
                                                                                                                                            onSuccess: function(response) {
                                                                                                                                                var details = response.data;
                                                                                                                                                var anchor = angular.element('<a/>');
                                                                                                                                                anchor.attr({
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2203..2216

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 128.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        onError: function (response) {
                                                                                                                                            if (response.status == 400) {
                                                                                                                                                vm.isFormError = true;
                                                                                                                                                var non_field_errors;
                                                                                                                                                try {
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
                                                                                                                    frontend/src/js/controllers/authCtrl.js on lines 203..216

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 125.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        if (vm.submissionResult.next !== null) {
                                                                                                                                            vm.currentPage = vm.submissionResult.next.split('page=')[1] - 1;
                                                                                                                                            vm.currentRefPage = Math.ceil(vm.currentPage);
                                                                                                                                        } else {
                                                                                                                                            vm.currentPage = 1;
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1347..1353

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 115.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        if (vm.submissionResult.next !== null) {
                                                                                                                                            vm.currentPage = vm.submissionResult.next.split('page=')[1] - 1;
                                                                                                                                            vm.currentRefPage = Math.ceil(vm.currentPage);
                                                                                                                                        } else {
                                                                                                                                            vm.currentPage = 1;
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 4 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1842..1848

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 115.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    parameters.callback = {
                                                                                                                                        onSuccess: function(response) {
                                                                                                                                            var details = response.data;
                                                                                                                                            vm.phases = details;
                                                                                                                                            utilities.hideLoader();
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 3 hrs to fix
                                                                                                                    frontend/src/js/controllers/featuredChallengeCtrl.js on lines 95..107

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 114.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    parameters.callback = {
                                                                                                                                        onSuccess: function(response) {
                                                                                                                                            var status = response.status;
                                                                                                                                            if (status === 204){
                                                                                                                                                $mdDialog.hide();
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 3 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2285..2298

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 111.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                parameters.callback = {
                                                                                                                                    onSuccess: function(response) {
                                                                                                                                        var status = response.status;
                                                                                                                                        if (status === 200) {
                                                                                                                                            $mdDialog.hide();
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 3 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2488..2501

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 111.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                parameters.callback = {
                                                                                                                                    onSuccess: function(response) {
                                                                                                                                        $rootScope.notify("success", response.data.success);
                                                                                                                                        submissionObject.classList = [''];
                                                                                                                                    },
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 3 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1506..1516

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 103.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                parameters.callback = {
                                                                                                                                    onSuccess: function(response) {
                                                                                                                                        $rootScope.notify("success", response.data.success);
                                                                                                                                        submissionObject.classList2 = [''];
                                                                                                                                    },
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 3 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1487..1497

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 103.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                if (vm.filter_my_submission_by_team_name === '') {
                                                                                                                                    parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" +
                                                                                                                                    vm.phaseId + "/submission/";
                                                                                                                                } else {
                                                                                                                                    parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" +
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 3 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1802..1808

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 97.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                if (vm.filter_all_submission_by_team_name === '') {
                                                                                                                                    parameters.url = "challenges/" + vm.challengeId + "/challenge_phase/" +
                                                                                                                                    vm.phaseId + "/submissions";
                                                                                                                                } else {
                                                                                                                                    parameters.url = "challenges/" + vm.challengeId + "/challenge_phase/" +
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 3 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1300..1306

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 97.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.evaluationCriteriaDialog = function(ev) {
                                                                                                                                vm.tempEvaluationCriteria = vm.page.evaluation_details;
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 5 other locations - About 2 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2421..2430
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2510..2519
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2611..2620
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2669..2678
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2717..2726

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 75.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.challengeTitleDialog = function(ev) {
                                                                                                                                vm.tempChallengeTitle = vm.page.title;
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 5 other locations - About 2 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2421..2430
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2510..2519
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2560..2569
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2611..2620
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2669..2678

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 75.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.termsAndConditionsDialog = function(ev) {
                                                                                                                                vm.tempTermsAndConditions = vm.page.terms_and_conditions;
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 5 other locations - About 2 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2421..2430
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2510..2519
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2560..2569
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2611..2620
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2717..2726

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 75.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.submissionGuidelinesDialog = function(ev) {
                                                                                                                                vm.tempSubmissionGuidelines = vm.page.submission_guidelines;
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 5 other locations - About 2 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2421..2430
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2560..2569
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2611..2620
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2669..2678
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2717..2726

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 75.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.overviewDialog = function(ev) {
                                                                                                                                vm.tempDesc = vm.page.description;
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 5 other locations - About 2 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2510..2519
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2560..2569
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2611..2620
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2669..2678
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2717..2726

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 75.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 6 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.evaluationScriptDialog = function(ev) {
                                                                                                                                vm.tempEvaluationCriteria = vm.page.evaluation_details;
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 5 other locations - About 2 hrs to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2421..2430
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2510..2519
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2560..2569
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2669..2678
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2717..2726

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 75.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                                                if (vm.existTeam.next !== null) {
                                                                                                                                                                    vm.currentPage = vm.existTeam.next.split('page=')[1] - 1;
                                                                                                                                                                } else {
                                                                                                                                                                    vm.currentPage = 1;
                                                                                                                                                                }
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 1 hr to fix
                                                                                                                    frontend/src/js/controllers/challengeHostTeamsCtrl.js on lines 79..83
                                                                                                                    frontend/src/js/controllers/teamsCtrl.js on lines 76..80

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 71.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.deleteChallengeDialog = function(ev) {
                                                                                                                                vm.titleInput = "";
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 1 hr to fix
                                                                                                                    frontend/src/js/controllers/profileCtrl.js on lines 126..135

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 67.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    onError: function(response) {
                                                                                                                                        utilities.hideLoader();
                                                                                                                                        $mdDialog.hide();
                                                                                                                                        var error = response.data;
                                                                                                                                        $rootScope.notify("error", error);
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 55 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2809..2814
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2925..2930

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 54.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                            onError: function(response) {
                                                                                                                                                utilities.hideLoader();
                                                                                                                                                $mdDialog.hide();
                                                                                                                                                var error = response.data;
                                                                                                                                                $rootScope.notify("error", error);
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 55 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2809..2814
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2984..2989

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 54.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        onError: function(response) {
                                                                                                                                            utilities.hideLoader();
                                                                                                                                            $mdDialog.hide();
                                                                                                                                            var error = response.data;
                                                                                                                                            $rootScope.notify("error", error);
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 55 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2925..2930
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 2984..2989

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 54.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.deregisterdialog = function(ev) {
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                                    targetEvent: ev,
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 55 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 3034..3042

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 54.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                            vm.termsAndConditionDialog = function (ev) {
                                                                                                                                $mdDialog.show({
                                                                                                                                    scope: $scope,
                                                                                                                                    preserveScope: true,
                                                                                                                                    targetEvent: ev,
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 55 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 3059..3067

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 54.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" + vm.phaseId + "/submission/?page=" + Math.ceil(vm.currentPage);
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 50 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1426..1426

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 51.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                parameters.url = "jobs/challenge/" + vm.challengeId + "/challenge_phase/" + vm.phaseId + "/submission/?page=" + Math.ceil(vm.currentPage);
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 50 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1213..1213

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 51.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                            vm.allowedSubmissionFileTypes.push({
                                                                                                                                                "phaseId": details.results[k].id,
                                                                                                                                                "allowedSubmissionFileTypes": details.results[k].allowed_submission_file_types
                                                                                                                                            });
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 45 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 836..839

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 50.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                        vm.phaseLeaderboardPublic.push({
                                                                                                                                            "phaseId": details.results[k].id,
                                                                                                                                            "leaderboardPublic": details.results[k].leaderboard_public
                                                                                                                                        });
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 45 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 812..815

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 50.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 4 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    onError: function(response) {
                                                                                                                                        var error = response.data;
                                                                                                                                        vm.leaderboard.error = error;
                                                                                                                                        vm.stopLoader();
                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1173..1177
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1532..1536
                                                                                                                    frontend/src/js/controllers/featuredChallengeCtrl.js on lines 194..198

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 47.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 4 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    onError: function(response) {
                                                                                                                                        var error = response.data;
                                                                                                                                        vm.leaderboard.error = error;
                                                                                                                                        vm.stopLoader();
                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1173..1177
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1652..1656
                                                                                                                    frontend/src/js/controllers/featuredChallengeCtrl.js on lines 194..198

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 47.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 3 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                                                if (vm.existTeam.next === null) {
                                                                                                                                                                    vm.isNext = 'disabled';
                                                                                                                                                                } else {
                                                                                                                                                                    vm.isNext = '';
                                                                                                                                                                }
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 2 other locations - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeHostTeamsCtrl.js on lines 68..72
                                                                                                                    frontend/src/js/controllers/teamsCtrl.js on lines 65..69

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 47.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 4 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    onError: function(response) {
                                                                                                                                        var error = response.data;
                                                                                                                                        vm.leaderboard.error = error;
                                                                                                                                        vm.stopLoader();
                                                                                                                                    }
                                                                                                                    Severity: Major
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 3 other locations - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1532..1536
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1652..1656
                                                                                                                    frontend/src/js/controllers/featuredChallengeCtrl.js on lines 194..198

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 47.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    onError: function (response) {
                                                                                                                                        var error = response.data;
                                                                                                                                        vm.stopLoader();
                                                                                                                                        $rootScope.notify("error", error);
                                                                                                                                        return false;
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1555..1560

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 47.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                    onError: function (response) {
                                                                                                                                        var error = response.data;
                                                                                                                                        vm.stopLoader();
                                                                                                                                        $rootScope.notify("error", error);
                                                                                                                                        return false;
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 1074..1079

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 47.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                vm.currentPhaseMetaAttributesVisibility = vm.defaultSubmissionMetaAttributes.find(function(element) {
                                                                                                                                    return element["phaseId"] == phaseId;
                                                                                                                                }).defaultAttributes;
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 854..856

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 46.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                    Open

                                                                                                                                vm.metaAttributesforCurrentSubmission = vm.submissionMetaAttributes.find(function(element){
                                                                                                                                    return element["phaseId"] == phaseId;
                                                                                                                                }).attributes;
                                                                                                                    Severity: Minor
                                                                                                                    Found in frontend/src/js/controllers/challengeCtrl.js and 1 other location - About 35 mins to fix
                                                                                                                    frontend/src/js/controllers/challengeCtrl.js on lines 861..863

                                                                                                                    Duplicated Code

                                                                                                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                    Tuning

                                                                                                                    This issue has a mass of 46.

                                                                                                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                    Refactorings

                                                                                                                    Further Reading

                                                                                                                    There are no issues that match your filters.

                                                                                                                    Category
                                                                                                                    Status