Showing 666 of 1,371 total issues
Function storeMetadata
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
storeMetadata(data) {
for (let i = 0; i < data.count; i++) {
if (data.results[i].submission_meta_attributes) {
const attributes = data.results[i].submission_meta_attributes;
attributes.forEach(function (attribute) {
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) {
Function setRefreshJWT
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.setRefreshJWT = function () {
var parameters = {};
parameters.url = 'accounts/user/get_auth_token';
parameters.method = 'GET';
parameters.token = utilities.getData('userKey');
Function dynHeaderController
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dynHeaderController(utilities) {
var vm = this;
vm.user = {};
Function load
has 28 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');
Function load
has 28 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');
Function inviteOthers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.inviteOthers = function(ev, hostTeamId) {
ev.stopPropagation();
// Appending dialog to document.body
var confirm = $mdDialog.prompt()
.title('Add other members to your team')
Function editEvaluationCriteria
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
editEvaluationCriteria() {
const SELF = this;
SELF.apiCall = (params) => {
const BODY = JSON.stringify(params);
SELF.apiService
Function editTermsAndConditions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
editTermsAndConditions() {
const SELF = this;
SELF.apiCall = (params) => {
const BODY = JSON.stringify(params);
SELF.apiService
Function apiCall
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
SELF.apiCall = (params) => {
let BODY = JSON.parse(JSON.stringify(params));
if (this.selectedPhase.submission_meta_attributes !== null && this.selectedPhase.submission_meta_attributes !== undefined) {
BODY["submission_metadata"] = []
for (let idx=0; idx < this.selectedPhase.submission_meta_attributes.length; idx++) {
Function displayDockerSubmissionInstructions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
displayDockerSubmissionInstructions(challenge, isParticipated) {
if (isParticipated) {
const API_PATH = this.endpointsService.challengeSubmissionsRemainingURL(challenge);
const SELF = this;
this.apiService.getUrl(API_PATH).subscribe(
Function make_team_name_unique
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_team_name_unique():
participant_team_list = []
host_team_list = []
participant_team_iter = 1
- 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_submission_meta
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_submission_meta(request, challenge_pk, submission_pk):
"""
Common API Endpoint for updating the submission meta data for hosts and participants.
"""
- 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 handle_submission_resume
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def handle_submission_resume(submission, updated_status):
"""
Function to handle the submission resuming. It is handled in the following way -
1. Change the submissions status to resumed
- 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 setup_eks_cluster
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def setup_eks_cluster(challenge):
"""
Creates EKS and NodeGroup ARN roles
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 challenge_host_detail
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def challenge_host_detail(request, challenge_host_team_pk, 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 scale_workers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def scale_workers(queryset, num_of_tasks):
"""
The function called by the admin action method to scale all the selected workers.
Calls the service_manager method. Before calling, checks if the target scaling number is different than current.
- 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 delete_workers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def delete_workers(queryset):
"""
The function called by the admin action method to delete all the selected workers.
Calls the delete_service_by_challenge_pk method. Before calling, verifies that the challenge is not new.
- 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 handle_submission_rerun
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def handle_submission_rerun(submission, updated_status):
"""
Function to handle the submission re-running. It is handled in the following way -
1. Invalidate the old submission
2. Create a new submission object for the re-running submission
- 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 notify_users_about_challenge
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def notify_users_about_challenge(request):
"""
Email New Challenge Details to EvalAI Users
"""
if request.user.is_authenticated and request.user.is_superuser:
- 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"