react-epfl/chachachat

View on GitHub
models/room.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function addMessage has 37 lines of code (exceeds 25 allowed). Consider refactoring.
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) {
Severity: Minor
Found in models/room.js - About 1 hr to fix

    Function createRoom has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      createRoom : function(userIds, cb) {
        var matches = userIds.map(function(userId) {
          return { "$elemMatch": { userId: ObjectId(userId) } }
        });
    
    
    Severity: Minor
    Found in models/room.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status