server/methods/calculateAnimeRatingById.js
Function calculateAnimeRatingById
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
calculateAnimeRatingById: function(animeId) {
// Get all the library entries for an anime
// We only need the rating and episodes seen fields
var libraryEntries = LibraryEntries.find({animeId: animeId}, {fields: {status: 1, rating: 1, episodesSeen: 1}});
var ratingCounts = {