Showing 666 of 1,371 total issues
Function challenge_phase_detail
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def challenge_phase_detail(request, challenge_pk, pk):
try:
challenge = Challenge.objects.get(pk=challenge_pk)
except Challenge.DoesNotExist:
response_data = {"error": "Challenge does not exist"}
- 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 challenge_detail
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def challenge_detail(request, challenge_host_team_pk, challenge_pk):
try:
challenge_host_team = ChallengeHostTeam.objects.get(
pk=challenge_host_team_pk
)
- 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_prizes_to_challenge
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_prizes_to_challenge(yaml_file_data, challenge):
if "prizes" in yaml_file_data:
prizes_data = yaml_file_data['prizes']
rank_set = set()
for prize in prizes_data:
- 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 60 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;
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;
Function createNewTeam
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.createNewTeam = function() {
vm.isExistLoader = true;
vm.loaderTitle = '';
vm.loaderContainer = angular.element('.new-team-card');
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) {
Function updateProfile
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.updateProfile = function(resetconfirmFormValid, editid) {
if (resetconfirmFormValid) {
vm.user.github_url = vm.user.github_url === null ? "" : vm.user.github_url;
vm.user.google_scholar_url = vm.user.google_scholar_url === null ? "" : vm.user.google_scholar_url;
vm.user.linkedin_url = vm.user.linkedin_url === null ? "" : vm.user.linkedin_url;
EvalAI_Interface
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class EvalAI_Interface:
def __init__(self, AUTH_TOKEN, EVALAI_API_SERVER):
self.AUTH_TOKEN = AUTH_TOKEN
self.EVALAI_API_SERVER = EVALAI_API_SERVER
TeamlistComponent
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-teamlist',
templateUrl: './teamlist.component.html',
styleUrls: ['./teamlist.component.scss'],
})
Function validateModalInput
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateModalInput(e) {
this.inputErrorMessage = '';
if (e.target.name === 'challegenDeleteInput') {
this.isDisabled = e.target.value !== this.challenge.title;
} else if (e.target.name === 'editChallengeTitle') {
Function toggleLeaderboardVisibility
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleLeaderboardVisibility() {
const SELF = this;
let toggleLeaderboardVisibilityState, visibility, phaseIsPublic;
for (let i = 0; i < SELF.filteredPhases.length; i++) {
if (SELF.filteredPhases[i]['name'] === SELF.selectedPhaseSplit['challenge_phase_name']) {
Function run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def run(*args):
try:
NUMBER_OF_CHALLENGES = int(args[0])
status = check_database()
if status is False:
- 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 change_submission_data_and_visibility
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def change_submission_data_and_visibility(
request, challenge_pk, challenge_phase_pk, submission_pk
):
"""
API Endpoint for updating the submission meta data
- 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 update_allowed_email_ids
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def update_allowed_email_ids(request, challenge_pk, phase_pk):
"""
API to GET/UPDATE/DELETE email ids from challenge phase allowed email ids
Arguments:
challenge_pk {int} -- Challenge primary key
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
ngOnInit() {
if (!this.type || this.type === 'email') {
if (this.type === 'email') {
this.isEmail = true;
}
- 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 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');
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';
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';
Function ngOnInit
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.router.events.subscribe((event: Event) => {
if (event instanceof NavigationEnd) {
this.currentRoutePath = event.url; // current url path
}