models/room.js
Function addMessage
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addMessage: function(message, cb) {
this.messages.push(message);
this.color = message.color; // the user will have a color of the last sent message
this.save(function(err, room) {
Function createRoom
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createRoom : function(userIds, cb) {
var matches = userIds.map(function(userId) {
return { "$elemMatch": { userId: ObjectId(userId) } }
});