Showing 160 of 452 total issues
Function click #btnDelTopic
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click #btnDelTopic'(evt) {
evt.preventDefault();
if (!this.minutesID) {
return;
Function documentgeneration.createHTML
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
'documentgeneration.createHTML'(minuteID) {
if (Meteor.isClient) {
return;
}
Function submit #frmDlgChangePassword
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
'submit #frmDlgChangePassword'(evt, tmpl) {
evt.preventDefault();
if (!Meteor.user()) {
return;
}
Function patchUsers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static patchUsers(minDoc, usrMap) {
let minIDs = [];
for (let m = 0; m<minDoc.length; m++) { // iterate all minutes
minIDs.push(minDoc[m]._id);
for (let i=0; minDoc[m].visibleFor&&i<minDoc[m].visibleFor.length; i++) {
- 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 attachments.remove
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
'attachments.remove'(attachmentID) {
if (Meteor.isServer && attachmentID) {
if (! this.userId) {
console.log('Attachment removal prohibited. User not logged in.');
return 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 patchUsers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static patchUsers(topicDoc, usrMap) {
// patch topic-responsibles
for (let i=0; topicDoc.responsibles&&i<topicDoc.responsibles.length; i++) {
if (usrMap[topicDoc.responsibles[i]]) { // may be "free text" user
topicDoc.responsibles[i] = usrMap[topicDoc.responsibles[i]];
- 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 _addLabelToken
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
_addLabelToken(token) {
let completeLabel;
if (this.newLabel) {
if (null !== this.currentLabel) {
this._addCompleteLabelToken();
- 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 minutes.sendAgenda
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
'minutes.sendAgenda'(id) {
check(id, String);
// Make sure the user is logged in before changing collections
if (!Meteor.userId()) {
throw new Meteor.Error('not-authorized');
- 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 upsertInfoItem
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async upsertInfoItem(topicItemDoc, saveChanges, insertPlacementTop = true) {
if (saveChanges === undefined) {
saveChanges = true;
}
let i = undefined;
- 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 doImport
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
static doImport (db, msID, usrMap) {
return new Promise((resolve, reject) => {
const minFile = msID + ExpImpMinutes.FILENAME_POSTFIX;
let minDoc = undefined;
try {
Function submit #frmDlgEditProfile
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
'submit #frmDlgEditProfile'(evt, tmpl) {
evt.preventDefault();
if (!Meteor.user()) {
return;
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (ldapSettings, userData) {
ldapSettings.propertyMap = ldapSettings.propertyMap || {};
const usernameAttribute = ldapSettings.searchDn || ldapSettings.propertyMap.username || 'cn',
longnameAttribute = ldapSettings.propertyMap.longname,
mailAttribute = ldapSettings.propertyMap.email || 'mail';
Function handleDemoUserAccount
has 29 lines of code (exceeds 25 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'}});
Function meetingseries.update
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
'meetingseries.update'(doc) {
if (!doc) {
console.log('meetingseries.update: no data given');
return;
}
Function meetingseries.insert
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
'meetingseries.insert'(doc, optimisticUICallback) {
console.log('meetingseries.insert');
// Make sure the user is logged in before changing collections
if (!Meteor.userId()) {
Function resolveEmailAddressesForResponsibles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
static resolveEmailAddressesForResponsibles(responsibleList) {
if (Meteor.isClient || !responsibleList || responsibleList.length === 0) {
return [];
}
Function click #btnRegisterUserSave
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click #btnRegisterUserSave'(evt, tmpl) {
if (! Meteor.user().isAdmin) {
return;
}
Function bindValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
LDAP.bindValue = function (usernameOrEmail, isEmailAddress) {
if (!LdapSettings.ldapEnabled()) {
return '';
}
- 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 workflow.addMinutes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
'workflow.addMinutes'(doc, clientCallback) {
checkUserAvailableAndIsModeratorOf(doc.meetingSeries_id);
// It is not allowed to insert new minutes if the last minute was not finalized
check(doc.meetingSeries_id, String);
- 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 setVisibleAndInformedUsers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
setVisibleAndInformedUsers(newVisibleForArray, newInformedUsersArray) {
if (!this._id) {
throw new Meteor.Error('MeetingSeries not saved.', 'Call save() before using addVisibleUser()');
}
if (!$.isArray(newVisibleForArray)) {