Showing 666 of 1,371 total issues
Function passwordStrength
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
passwordStrength(password) {
// Regular Expressions.
const REGEX = new Array();
REGEX.push('[A-Z]', '[a-z]', '[0-9]', '[$$!%*#?&]');
- 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 resetPassword
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.resetPassword = function(resetPassFormValid) {
if (resetPassFormValid) {
vm.startLoader("Sending Mail");
var parameters = {};
parameters.url = 'auth/password/reset/';
Function downloadSubmission
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
downloadSubmission() {
if (this.challenge['id'] && this.selectedPhase && this.fileSelected) {
const API_PATH = this.endpointsService.challengeSubmissionDownloadURL(
this.challenge['id'],
this.selectedPhase['id'],
Function editChallengeOverview
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
editChallengeOverview() {
const SELF = this;
SELF.apiCall = (params) => {
const BODY = JSON.stringify(params);
Function phaseSplitSelected
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
phaseSplitSelected(phaseSplit) {
const SELF = this;
SELF.selectedPhaseSplit = phaseSplit;
SELF.highlightedEntry = null;
Function requestLink
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
requestLink() {
const API_PATH = 'accounts/user/resend_email_verification/';
const SELF = this;
const token = this.authService.getUser['token'];
const EMAIL_BODY = JSON.stringify({
Function deleteTeamMemberWrapper
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
deleteTeamMemberWrapper() {
const SELF = this;
const deleteTeamMember = (team) => {
const deleteUrl = SELF.deleteMembersPath.replace('<team_id>', team.teamId);
SELF.apiCall = (params) => {
Function getDateDifferenceString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getDateDifferenceString(d1, d2) {
const DIFF_DAYS = this.getDateDifference(d1, d2);
if (DIFF_DAYS < 1) {
const DIFF_HOURS = DIFF_DAYS * 24;
if (DIFF_HOURS < 1) {
Function editSubmissionGuideline
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
editSubmissionGuideline() {
const SELF = this;
SELF.apiCall = (params) => {
const BODY = JSON.stringify(params);
SELF.apiService
Function setWorkerResources
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.setWorkerResources = function() {
parameters.url = "challenges/" + vm.challengeId + "/scale_resources/";
parameters.method = 'PUT';
parameters.data = {
"worker_cpu_cores": vm.selectedWorkerResources[0],
Function onError
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onError: function(response) {
if (response.status == 400) {
vm.stopLoader();
vm.isFormError = true;
var non_field_errors, isUsername_valid, isEmail_valid, isPassword1_valid, isPassword2_valid;
Function PermCtrl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PermCtrl(utilities, $rootScope) {
var vm = this;
// message for not verified users
vm.emailError = utilities.getData('emailError');
Function load
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.load = function(url) {
// loader for existing teams
vm.isExistLoader = true;
vm.loaderTitle = '';
vm.loaderContainer = angular.element('.exist-team-card');
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
Function deregister
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
vm.deregister = function(deregisterformvalid) {
if (deregisterformvalid) {
parameters.url = 'challenges/challenge/' + vm.challengeId + '/deregister/';
parameters.method = 'POST';
parameters.data = {};
Function onError
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onError: function(response) {
if (response.status == 400) {
vm.errorResponse = response;
vm.stopLoader();
vm.isFormError = true;
Function run_submission
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run_submission(
challenge_id, challenge_phase, submission, user_annotation_file_path
):
"""
* receives a challenge id, phase id and user annotation file path
Function run_submission
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def run_submission(
challenge_pk,
challenge_phase,
submission,
user_annotation_file_path,
Function calculate_distinct_sorted_leaderboard_data
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function apiCall
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SELF.apiCall = () => {
const BODY = JSON.stringify({
published: isPublished,
});
SELF.apiService