Showing 122 of 2,019 total issues
Function findPublicSurveysByUserLogin
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Survey.findPublicSurveysByUserLogin = function(login, status, query, tag, order, pageSize, pageNr) {
Function findPublicSurveys
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Survey.findPublicSurveys = function(userId, status, query, tag, order, pageSize, pageNr) {
Function getScopes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Survey.getScopes = function(userId, onlyPublic, status, query, tag, order) {
Function transformImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
transformImage: function(input, width, height, upscale, format, outputFile) {
Avoid deeply nested control flow statements. Open
Open
if (!qstnFound) {
continue;
}
Avoid deeply nested control flow statements. Open
Open
if (!/^[A-Za-z0-9_.\-~]+$/.test(req.body.login)) {
req.session.error = 'username_invalid_error_msg';
Utils.copyAttributes({
userFormData: req.body
}, res.locals);
Avoid deeply nested control flow statements. Open
Open
if (!(('option_' + i + '_other') in req.body) || req.body['option_' + i + '_other'].trim() === '') {
break;
}
Avoid deeply nested control flow statements. Open
Open
if (ansId === questions[l].Answers[m].sortorder) {
ans = questions[l].Answers[m].answer;
}
Avoid deeply nested control flow statements. Open
Open
if (questions[j].Answers[l].sortorder === -1) {
otherAns = questions[j].Answers[l];
break;
}
Avoid deeply nested control flow statements. Open
Open
for (var i = 0, iLen = questions.length; i<iLen; i++) {
if (questions[i].legend_question && questions[i].question_order === q) {
qstnFound = true;
break;
}
Avoid deeply nested control flow statements. Open
Open
if (answerImg === null && oldAnswers !== null) {
// If not and we have old answers, we recycle the image previously used for this answer
if (!isNaN(req.body['id_' + i + '_' + j])) {
var originalId = parseInt(req.body['id_' + i + '_' + j], 10);
images:
Avoid deeply nested control flow statements. Open
Open
if (answers[i].sortorder === -1) {
otherAnswer = answers[i];
continue;
}
Avoid deeply nested control flow statements. Open
Open
if (!(Utils.isImage(fs.readFileSync(req.files['img_' + i + '_' + j].path)))) {
return Promise.reject({
message: "invalid image for question nr " + i + " answer nr " + j + ": selected file is not an image.",
code: 'answer_img_invalid'
});
Avoid deeply nested control flow statements. Open
Open
if (!(('option_' + i + '_other') in req.body) || req.body['option_' + i + '_other'].trim() === '') {
break;
}
Avoid deeply nested control flow statements. Open
Open
if (err && err.name === 'SequelizeUniqueConstraintError' &&
((err.errors && err.errors.constructor === Array && err.errors[0].path === 'login') ||
(err.message.indexOf('users_login_key') > -1))) {
req.session.error = 'username_duplicated_error_msg';
logger.debug('Login already in use: ' + err);
Avoid deeply nested control flow statements. Open
Open
if ('q' + questions[q].question_order === l) {
question = questions[q];
break;
}
Avoid deeply nested control flow statements. Open
Open
if (question !== null) {
var answer = null;
for (var n = 0, nLen = answers[question.question_order].length; n<nLen; n++) {
if (answers[question.question_order][n].sortorder === orderedVotes[l][m].name.split('_')[1]) {
answer = answers[question.question_order][n];
Avoid deeply nested control flow statements. Open
Open
if (ansId === questions[j].Answers[l].sortorder) {
ans = questions[j].Answers[l].answer;
}
Avoid deeply nested control flow statements. Open
Open
} else if (req.body.preferences) {
// Other preferences update
req.user.accept_info_email = req.body.accept_info_email = 'accept_info_email' in req.body
req.user.save().then(function(user) {
req.session.success = 'update_preferences_success_msg';
Avoid deeply nested control flow statements. Open
Open
if (answers[questions[j].question_order][k].sortorder === parseInt(results[i]['q' + questions[j].question_order + '.id'], 10)) {
answer = answers[questions[j].question_order][k];
break;
}