lib/gameplays.js
Function exports
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (function () {
var Q = require('q');
var Collection = require('easy-collections');
var gameplays = {};
Function startAttempt
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
gameplays.startAttempt = function (id, player, authToken) {
var g = new Collection(require('./db'), 'gameplays_' + id);
g.sort = { _id: -1 };
return gameplays.find(id, player).then(function (gameplay) {
return g.findAndUpdate(gameplay._id.toString(), {