Showing 80 of 302 total issues
Function revisionApproved
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
revisionApproved: function(revision) {
// We should actually be pulling the revision from the database
// to ensure the revision object itself hasn't been screwed up
// during transmision. For now, we'll leave it be.
- 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
File anime.js
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
Anime = new Meteor.Collection("anime");
AnimeSchema = new SimpleSchema({
canonicalTitle: {
type: String,
Function getMALUserList
has 167 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMALUserList: function(xmlContent) {
// The user must be logged in for this function
if (!Meteor.user())
throw new Meteor.Error('user-required', 'User must be logged in to import MAL list');
Function revisionApproved
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
revisionApproved: function(revision) {
// We should actually be pulling the revision from the database
// to ensure the revision object itself hasn't been screwed up
// during transmision. For now, we'll leave it be.
Function userFriendlyText
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
userFriendlyText: function() {
var userFriendlyText;
switch (this.event) {
Function userFriendlyText
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
userFriendlyText: function() {
var userFriendlyText;
switch (this.event) {
- 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 revisionsAnimeAddEdit
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
revisionsAnimeAddEdit: function(anime) {
// The edited version of the anime is sent
check(anime, AnimeRevisionsSchema);
- 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
File revisions.js
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
Meteor.methods({
revisionsAnimeAdd: function(anime) {
// Ensure integerity of data
check(anime, AnimeRevisionsSchema);
Function spoilerAlert
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.spoilerAlert = function(opts) {
opts = $.extend(defaults, opts || {})
var maxBlur = opts.max
var partialBlur = opts.partial
var hintText = opts.hintText
Function revisionsAnimeAddEdit
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
revisionsAnimeAddEdit: function(anime) {
// The edited version of the anime is sent
check(anime, AnimeRevisionsSchema);
Function keypress .create-comment textarea
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
'keypress .create-comment textarea' : function (event, template) {
// Only execute the below code if the enter key was pressed
if (event.keyCode == 13 && !event.shiftKey) {
var commentContent = $(event.target).val().trim();
var parent = template.data.parent;
Function created
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Template.homePageSchedule.created = function() {
var self = this;
self.ready = new ReactiveVar(false);
self.schedule = new ReactiveVar();
Function calculateAnimeRatingById
has 55 lines of code (exceeds 25 allowed). Consider refactoring. 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 = {
Function uploadImageFromUrl
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
uploadImageFromUrl: function(url, contentDirectory, typeDirectory, contentId) {
var options;
var request = Meteor.npmRequire('request');
options = {
Function click .libraryEntryIcons
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click .libraryEntryIcons' : function(event, template) {
var icon = $(event.target);
var libraryEntry = template.data;
var anime = libraryEntry.anime();
Function click .libraryEntryIcons
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click .libraryEntryIcons' : function(event, template) {
var icon = $(event.target);
var libraryEntry = template.data;
var anime = libraryEntry.anime();
Function friendlyText
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
friendlyText: function() {
var friendlyText = "";
// if it's a libraryEntry
var user = Meteor.users.findOne({_id: this.userId});
if (this.type === 'libraryEntry') {
- 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 representIcon
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
representIcon: function() {
var icon = 'fa fa-check';
if (this.type === 'libraryEntry') {
- 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 friendlyText
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
friendlyText: function() {
var friendlyText = "";
// if it's a libraryEntry
var user = Meteor.users.findOne({_id: this.userId});
if (this.type === 'libraryEntry') {
Function representIcon
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
representIcon: function() {
var icon = 'fa fa-check';
if (this.type === 'libraryEntry') {