Showing 666 of 1,371 total issues
File teamsCtrl.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Invoking IIFE for teams
(function() {
'use strict';
Function validate_dataset_splits
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def validate_dataset_splits(self, current_dataset_config_ids):
dataset_splits = self.yaml_file_data.get("dataset_splits")
dataset_split_codenames = []
self.dataset_splits_ids = []
if dataset_splits:
- 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 validate_challenge_phase_splits
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def validate_challenge_phase_splits(self, current_phase_split_ids):
challenge_phase_splits = self.yaml_file_data.get(
"challenge_phase_splits"
)
# Check for duplicate combinations
- 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 add_participant_team_to_challenge
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def add_participant_team_to_challenge(
request, challenge_pk, participant_team_pk
):
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 onSuccess
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
onSuccess: function(response) {
var status = response.status;
var details = response.data;
parameters.url = 'analytics/challenge/' + vm.challengeId + '/team/count';
parameters.method = 'GET';
File challengeHostTeamsCtrl.js
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Invoking IIFE for teams
(function() {
'use strict';
Function get_submission_file_presigned_url
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def get_submission_file_presigned_url(request, challenge_phase_pk):
"""
API to generate a presigned url to upload a submission 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 ngOnInit
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
ngOnInit() {
if (this.params) {
if (this.params['title']) {
this.title = this.params['title'];
}
- 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 editSubmission
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
editSubmission(submission) {
const SELF = this;
SELF.apiCall = (params) => {
let BODY = JSON.parse(JSON.stringify(params));
if (this.selectedPhase.submission_meta_attributes !== null && this.selectedPhase.submission_meta_attributes !== undefined) {
File authCtrl.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Invoking IIFE for auth
(function() {
'use strict';
Function getAllSubmissionResults
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.getAllSubmissionResults = function(phaseId) {
vm.stopFetchingSubmissions = function() {
$interval.cancel(vm.poller);
};
File profileCtrl.js
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Invoking IIFE for profile view
(function() {
'use strict';
Function userSignUp
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.userSignUp = function(signupFormValid) {
if (signupFormValid) {
vm.startLoader("Setting up your details!");
// call utility service
var parameters = {};
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!";
File views.py
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import csv
from datetime import timedelta
from django.http import HttpResponse
Function invite_users_to_challenge
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def invite_users_to_challenge(request, challenge_pk):
challenge = get_challenge_model(challenge_pk)
if not challenge.is_active or not challenge.approved_by_admin:
- 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
File common.py
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Django settings for evalai project.
Generated by 'django-admin startproject' using Django 1.10.2.
File urls.py
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.conf.urls import url
from . import views
urlpatterns = [
Function restart_workers_signal_callback
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def restart_workers_signal_callback(sender, instance, field_name, **kwargs):
"""
Called when either evaluation_script or test_annotation_script for challenge
is updated, to restart the challenge workers.
"""
- 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 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();