Showing 666 of 1,371 total issues
Function validate_leaderboards
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def validate_leaderboards(self, current_leaderboard_config_ids):
leaderboard = self.yaml_file_data.get("leaderboard")
if leaderboard:
for data in leaderboard:
error = 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 getResults
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.getResults = function(phaseId) {
// long polling (5s) for leaderboard
vm.start = function() {
vm.stopFetchingSubmissions();
vm.poller = $interval(function() {
File teamlist.component.ts
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit, ViewChildren, QueryList, OnDestroy } from '@angular/core';
import { ApiService } from '../../../services/api.service';
import { GlobalService } from '../../../services/global.service';
import { AuthService } from '../../../services/auth.service';
import { Router, ActivatedRoute } from '@angular/router';
File challengeleaderboard.component.ts
has 436 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit, QueryList, ViewChildren, AfterViewInit, OnDestroy } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Router, ActivatedRoute } from '@angular/router';
// import component
Function main
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def main():
killer = GracefulKiller()
logger.info(
"{} Using {} as temp directory to store data".format(
WORKER_LOGS_PREFIX, BASE_TEMP_DIR
- 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 main
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def main():
killer = GracefulKiller()
evalai = EvalAI_Interface(
AUTH_TOKEN=AUTH_TOKEN,
EVALAI_API_SERVER=EVALAI_API_SERVER,
- 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 fetchOurTeamMembers
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchOurTeamMembers() {
const API_PATH = this.endpointsService.ourTeamURL();
const SELF = this;
SELF.apiService.getUrl(API_PATH).subscribe(
(data) => {
Function DashCtrl
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DashCtrl(utilities, $state, $rootScope) {
var vm = this;
// User has verified email or not
vm.isPrivileged = true;
Function showChallengeAnalysis
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.showChallengeAnalysis = function() {
if (vm.challengeId != null) {
parameters.url = 'challenges/challenge/' + vm.challengeId + '/challenge_phase';
parameters.method = 'GET';
parameters.token = userKey;
File admin.py
has 386 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django import forms
from django.contrib import admin, messages
from django.contrib.admin.helpers import ActionForm
Function validateModalInput
has a Cognitive Complexity of 34 (exceeds 5 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') {
- 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 global.service.ts
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Injectable, Output, EventEmitter } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
@Injectable()
export class GlobalService {
Function getLeaderboard
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
vm.getLeaderboard = function(phaseSplitId) {
vm.stopLeaderboard = function() {
$interval.cancel(vm.poller);
};
vm.stopLeaderboard();
GlobalService
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class GlobalService {
scrolledStateDefault = false;
toastErrorCodes = [400, 500];
authStorageKey = 'authtoken';
Function utilities
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
function utilities($http, EnvironmentConfig) {
// factory for API calls
this.sendRequest = function(parameters, header, type) {
var url = EnvironmentConfig.API + parameters.url;
Function onSuccess
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
onSuccess: function(response) {
var details = response.data;
vm.currentDate = details.datetime_now;
for (var i in details.challenge_participant_team_list) {
if (details.challenge_participant_team_list[i].challenge !== null && details.challenge_participant_team_list[i].challenge.id == vm.challengeId) {
ChallengesettingsComponent
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'app-challengesettings',
templateUrl: './challengesettings.component.html',
styleUrls: ['./challengesettings.component.scss'],
})
Function updateProfileCtrl
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateProfileCtrl(utilities, $state, $rootScope) {
var vm = this;
var userKey = utilities.getData('userKey');
vm.wrnMsg = {};
vm.isValid = {};
Function run_submission
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def run_submission(
challenge_id, challenge_phase, submission, user_annotation_file_path
):
"""
* receives a challenge id, phase id and user annotation file path
- 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 31 (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"