Showing 160 of 452 total issues
Function generateNewParticipants
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
generateNewParticipants () {
if (this.isFinalized) {
throw new Error('generateNewParticipants () must not be called on finalized minutes');
}
let changed = false;
Function attachments.remove
has 27 lines of code (exceeds 25 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;
Function up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static up() {
MinutesSchema.getCollection().find().forEach(minute => {
MigrateV7._upgradeTopics(minute.topics);
Function change #btnUploadAttachment
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
'change #btnUploadAttachment': function (e, template) {
if (e.currentTarget.files && e.currentTarget.files[0]) {
// We upload only one file, in case
// multiple files were selected
const uploadFilename = e.currentTarget.files[0];
Function show.bs.modal #dlgEditMeetingSeries
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
'show.bs.modal #dlgEditMeetingSeries': function (evt, tmpl) {
const ms = new MeetingSeries(tmpl.data._id);
const element = ms;
Function upsertInfoItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async upsertInfoItem(topicItemDoc, saveChanges, insertPlacementTop = true) {
if (saveChanges === undefined) {
saveChanges = true;
}
let i = undefined;
Function minutes.update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
'minutes.update'(doc) {
// Make sure the user is logged in before changing collections
if (!Meteor.userId()) {
throw new Meteor.Error('not-authorized');
}
Function _doMigration
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_doMigration() {
MinutesSchema.getCollection().find().forEach(minute => {
this._migrateTopics(minute.topics);
// We switch off bypassCollection2 here, to skip .clean & .validate to allow empty string values
Function getUser
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getUser() {
UserFactory.counter += 1;
const username = "user_"+UserFactory.postfix+"_"+UserFactory.counter;
return {
_id: random.generate({
Function send
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
send() {
let emailFrom = this._moderator.emails;
let modFrom = (emailFrom && emailFrom.length > 0)
? emailFrom[0].address
: GlobalSettings.getDefaultEmailSenderAddress();
- 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 handleTemplatesGlobalKeyboardShortcuts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
let handleTemplatesGlobalKeyboardShortcuts = function(switchOn) {
if (switchOn) {
$(document).keydown( function(evt) {
if ($('.modal.in').length > 0) { // any modal dialog open?
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 createItem
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function createItem(itemDoc, parentTopic, minutesId, meetingSeries, type = 'infoItem', labels = []) {
itemDoc.labels = convertOrCreateLabelsFromStrings(labels, meetingSeries);
if (!itemDoc.createdInMinute) {
itemDoc.createdInMinute = minutesId;
- 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 e2e.resetMyApp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
'e2e.resetMyApp'(skipUsersCreation) {
console.log('-------------------------- E2E-METHOD: resetMyApp ');
AttachmentsCollection.remove({});
console.log('Count AttachmentsCollection after reset:'+AttachmentsCollection.find().count());
// remove the meeting series attachment 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 users.admin.changePassword
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
'users.admin.changePassword'(userId, password1, password2) {
if (Meteor.isServer) {
// #Security: Only logged in admin may invoke this method: users.admin.changePassword
console.log('users.admin.changePassword for user: '+Meteor.userId());
if (! Meteor.userId()) {
- 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 updateTopicSorting
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
let updateTopicSorting = function (event, ui) {
const draggedTopicID = $(ui.item).attr('data-id');
if (!draggedTopicID) {
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 users.admin.registerUser
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
'users.admin.registerUser'(username, longname, email, password1, password2, sendMail, sendPassword) {
Function convertOldPriority
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const convertOldPriority = (priority) => {
priority = (priority) ? priority.toUpperCase() : '';
if ( priority.startsWith('HIGH') || priority.startsWith('WICHTIG') || priority.startsWith('ASAP') ) {
return 1;
} else if ( priority.startsWith('MEDIUM') || priority.startsWith('MITTEL') ) {
- 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
Avoid deeply nested control flow statements. Open
if (detail.isEditedBy === Meteor.userId()) {
detail.isEditedBy = null;
detail.isEditedDate = null;
}
Function docMatchesSearchTokens
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
docMatchesSearchTokens(doc, searchTokens) {
for (let i=0; i < searchTokens.length; i++) {
let token = this._toUpper(searchTokens[i]);
let subject = this._toUpper(doc.subject);
let infos = (doc.details)
- 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 updateParticipantPresent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async updateParticipantPresent(userid, isPresent) {
let index = -1;
if (this.participants) {
for (let i=0; i < this.participants.length; i++) {
if (this.participants[i].userId === userid) {
- 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"