Showing 666 of 1,371 total issues
Function challenge_submission
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
def challenge_submission(request, challenge_id, challenge_phase_id):
"""API Endpoint for making a submission to a challenge"""
# check if the challenge exists or not
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
File models.py
has 608 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.core import serializers
from django.db.models.signals import pre_save
File utils.py
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import json
import logging
import random
import string
Function AnalyticsCtrl
has 224 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AnalyticsCtrl(utilities, $state, $rootScope) {
var vm = this;
vm.hostTeam = {};
vm.teamId = null;
File serializers.py
has 529 lines of code (exceeds 250 allowed). Consider refactoring. Open
from rest_framework import serializers
from accounts.serializers import UserDetailsSerializer
from hosts.serializers import ChallengeHostTeamSerializer
File seed.py
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Command to run : python manage.py shell < scripts/seed.py
import datetime
import json
import os
import random
File task_definitions.py
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
task_definition = """
{{
"family":"{queue_name}",
"executionRoleArn":"{EXECUTION_ROLE_ARN}",
"networkMode":"awsvpc",
File challengesubmit.component.ts
has 513 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit, QueryList, ViewChildren } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { NGXLogger } from 'ngx-logger';
// import service
File remote_submission_worker.py
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
EndpointsService
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class EndpointsService {
/**
* Categories of API paths
*/
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);
File utils.py
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
import datetime
import logging
import os
import requests
import tempfile
File views.py
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.contrib.auth.models import User
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import permissions, status
File challengesubmissions.component.ts
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit, QueryList, ViewChildren, Input, AfterViewInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { NGXLogger } from 'ngx-logger';
// import service
Function download_all_submissions
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
def download_all_submissions(
request, challenge_pk, challenge_phase_pk, file_type
):
"""
API endpoint to download all the submissions for a particular challenge as a csv
- 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_failed_jobs_and_send_logs
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def update_failed_jobs_and_send_logs(
api_instance,
core_v1_api_instance,
evalai,
job_name,
- 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 challengeviewallsubmissions.component.ts
has 454 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit, QueryList, ViewChildren, AfterViewInit } from '@angular/core';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { Router, ActivatedRoute } from '@angular/router';
import { NGXLogger } from 'ngx-logger';
Function invite_participant_to_team
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
def invite_participant_to_team(request, pk):
try:
participant_team = ParticipantTeam.objects.get(pk=pk)
except ParticipantTeam.DoesNotExist:
response_data = {"error": "Participant Team 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 FeaturedChallengeCtrl
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FeaturedChallengeCtrl(utilities, loaderService, $state, $stateParams, moment) {
var vm = this;
vm.challengeId = $stateParams.challengeId;
vm.phaseSplitId = $stateParams.phaseSplitId;
vm.phaseId = null;
Function calculate_distinct_sorted_leaderboard_data
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def calculate_distinct_sorted_leaderboard_data(
user, challenge_obj, challenge_phase_split, only_public_entries, order_by
):
"""
Function to calculate and return the sorted leaderboard data
- 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"