Showing 666 of 1,371 total issues
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
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;
Function changePassword
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.changePassword = function(resetconfirmFormValid) {
if(resetconfirmFormValid){
vm.startLoader("Changing Your Password");
Function resetPasswordConfirm
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.resetPasswordConfirm = function(resetconfirmFormValid) {
if (resetconfirmFormValid) {
vm.startLoader("Resetting Your Password");
var parameters = {};
parameters.url = 'auth/password/reset/confirm/';
Function changePassword
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.changePassword = function(resetconfirmFormValid) {
if(resetconfirmFormValid){
var parameters = {};
parameters.url = 'auth/password/change/';
parameters.method = 'POST';
Function fetchRemainingSubmissions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchRemainingSubmissions(challenge, phase) {
const API_PATH = this.endpointsService.challengeSubmissionsRemainingURL(challenge);
const SELF = this;
clearInterval(SELF.timer);
SELF.isClockStarted = false;
Function fetchSubmissions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchSubmissions(challenge, phase) {
const SELF = this;
let API_PATH;
API_PATH = SELF.endpointsService.challengeSubmissionURL(challenge, phase);
SELF.apiService.getUrl(API_PATH).subscribe(
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) {
Function editPhaseDetailsUpload
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
editPhaseDetailsUpload() {
const SELF = this;
SELF.apiCall = (params) => {
const FORM_DATA: FormData = new FormData();
FORM_DATA.append('phase_description_file', params['phase_description_file']);
Function ngOnInit
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.routerPublic = this.router;
if (!this.authService.isLoggedIn()) {
this.router.navigate([this.authRoutePath]);
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) {
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) {
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!";
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) {
Function get_or_create_sqs_queue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_or_create_sqs_queue(queue_name, challenge=None):
"""
Returns:
Returns the SQS Queue object
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function remove_participant_team_from_approved_list
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def remove_participant_team_from_approved_list(request, challenge_pk, participant_team_pk):
"""
Remove participant team from approved list
"""
try:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function restart_workers
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def restart_workers(queryset):
"""
The function called by the admin action method to restart all the selected workers.
Calls the service_manager method. Before calling, verifies that the challenge worker(s) is(are) active.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function finish_annotation_file_upload
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def finish_annotation_file_upload(request, challenge_phase_pk):
"""
API to complete multipart upload for a test annotation file
Arguments:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function handleFormError
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
handleFormError(form, err, toast = true) {
const ERR = err.error;
if (this.toastErrorCodes.indexOf(err.status) > -1 && ERR !== null && typeof ERR === 'object') {
console.error(err);
for (const KEY in ERR) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function check_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) {