Showing 160 of 452 total issues
Function docMatchesFilterTokens
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
docMatchesFilterTokens(doc, filterTokens) {
for (let i=0; i < filterTokens.length; i++) {
let filter = filterTokens[i];
switch (filter.key) {
- 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 click .detailText
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click .detailText'(evt, tmpl) {
evt.preventDefault();
/** @type {TopicInfoItemListContext} */
const context = tmpl.data;
Function getDocumentData
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getDocumentData(context) {
let presentParticipants = context._participants.filter(participant => {
return participant.present;
});
Function click #btnDelInfoItem
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click #btnDelInfoItem'(evt, tmpl) {
/** @type {TopicInfoItemListContext} */
const context = tmpl.data;
performActionForItem(evt, tmpl, (item) => {
let isDeleteAllowed = item.isDeleteAllowed(context.getSeriesId(item._infoItemDoc._id));
Function submit #frmDlgEditMeetingSeries
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
'submit #frmDlgEditMeetingSeries': function(evt, tmpl) {
evt.preventDefault();
let saveButton = $('#btnMeetingSeriesSave');
let cancelButton = $('btnMeetinSeriesEditCancel');
saveButton.prop('disabled',true);
Function blur .detailInput
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
'blur .detailInput'(evt, tmpl) {
evt.preventDefault();
/** @type {TopicInfoItemListContext} */
const context = tmpl.data;
Function doImport
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
static doImport (db, msID, usrMap) {
return new Promise((resolve, reject) => {
const usrFile = msID + ExpImpUsers.FILENAME_POSTFIX;
let allUsersDoc = undefined;
try {
Function handleDemoUserAccount
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
let handleDemoUserAccount = function () {
if (GlobalSettings.createDemoAccount()) {
let demoUser = Meteor.users.findOne({$and: [{username: 'demo'}, {isDemoUser: true}]});
if (!demoUser) { // we don't have a demo user, but settings demand one
Accounts.createUser({username: 'demo', password: 'demo', email: '', profile: {name: 'Demo User'}});
- 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 blur .detailInput
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
'blur .detailInput'(evt, tmpl) {
evt.preventDefault();
/** @type {TopicInfoItemListContext} */
const context = tmpl.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"
Further reading
Function select2search
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function select2search(selectResponsibles, delayTime, freeTextValidator, minuteID, topicOrItem) {
let minute = new Minutes(minuteID);
let preparer = new ParticipantsPreparer(minute, topicOrItem, Meteor.users, freeTextValidator);
let participants = preparer.getPossibleResponsibles();
selectResponsibles.select2({
Function onBeforeUpload
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
onBeforeUpload: function (file) {
if (! GlobalSettings.getAttachmentsEnabled()) {
return 'Upload not allowed in settings.json';
}
// Check if this upload candidate is allowed by size and extension
Function onBeforeUpload
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
onBeforeUpload: function (file) {
if (! GlobalSettings.getAttachmentsEnabled()) {
return 'Upload not allowed in settings.json';
}
// Check if this upload candidate is allowed by size and extension
- 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 notifyOnRoleChange
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const notifyOnRoleChange = function(usersWithRolesAfterEdit, meetingSeriesId) {
function sendEmail (userId, oldRole, newRole, meetingSeriesId) {
Meteor.call('meetingseries.sendRoleChange', userId, oldRole, newRole, meetingSeriesId);
}
- 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 removeIsEditedMinute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function removeIsEditedMinute(minuteId, ignoreLock) {
let minute = new Minutes(minuteId);
for (let topic of minute.topics) {
if (ignoreLock === true) {
topic.isEditedBy = null;
Function docMatchesFilterTokens
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
docMatchesFilterTokens(doc, filterTokens) {
for (let i=0; i < filterTokens.length; i++) {
let filter = filterTokens[i];
switch (filter.key) {
Function preImportCheck
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
static preImportCheck (db, msID, force=false) {
return new Promise((resolve, reject) => {
db.collection('migrations')
.findOne()
.then(doc => {
Function responsiblesSearch
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
'responsiblesSearch' (partialName, participants) {
check(partialName, String);
let results_participants = []; // get all the participants for the minute
let foundPartipantsNames = [];
Function users.editProfile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
'users.editProfile'(userId, eMail, longName) {
check(eMail, String);
check(longName, String);
if (! Meteor.userId()) {
throw new Meteor.Error('Cannot edit profile', 'User not logged in.');
Function send
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
send() {
let emailFrom = this._moderator.emails;
let modFrom = (emailFrom && emailFrom.length > 0)
? emailFrom[0].address
: GlobalSettings.getDefaultEmailSenderAddress();
Function _fetchLDAPUsers
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
let _fetchLDAPUsers = function (connection) {
let client = connection.client,
settings = connection.settings,
base = settings.serverDn,
searchDn = _.get(settings, 'propertyMap.username', 'cn'),