Showing 80 of 302 total issues
Function click #signInButton
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
'click #signInButton': function(event, template) {
event.preventDefault();
// Get input
// We are using toLowerCase to ensure any version of the username will
Function discourseLogout
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
discourseLogout: function() {
var user = Meteor.user();
if (!user) {
throw new Meteor.Error('user-unavailable', 'User must be logged in to perform this action');
Function formatContent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatContent: function(text) {
// We first want to escape all the html if there is any
var text = _.escape(text);
var returnedHtml = "";
Function custom
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
custom: function() {
// We should ensure that the count here is the same as the length of
// the likes array.
// We can't use this.field("likes").value because it grabs the modified
- 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 custom
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
custom: function() {
// We should ensure that the count here is the same as the length of
// the likes array.
// We can't use this.field("likes").value because it grabs the modified
- 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 click .status-item
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
'click .status-item' : function(event, template) {
var status = $(event.target).text();
- 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 click .status-item
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
'click .status-item' : function(event, template) {
var status = $(event.target).text();
- 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 uploadImage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
uploadImage: function(image, imageName, imageSize, imageType, contentDirectory, typeDirectory, contentId) {
Avoid deeply nested control flow statements. Open
if (revision.content[key] === null) {
unsetProperties[key] = "";
delete revision.content[key];
}
Avoid deeply nested control flow statements. Open
if (error) {
console.log(error.reason);
throw new Meteor.Error(400, error.reason);
}
Avoid deeply nested control flow statements. Open
if (error) {
throw new Meteor.Error(403, error.reason);
}
Avoid deeply nested control flow statements. Open
if (!anime.startDate || moment(anime.startDate).year() == 0)
updateObj.startDate = moment(malAnime.start_date[0]).toDate();
Avoid deeply nested control flow statements. Open
if (animeId && coverImageUrl) {
console.log('We\'re about to upload the image');
Meteor.call("uploadImageFromUrl", coverImageUrl, 'anime', 'cover', animeId, function(error, result) {
if (error) {
throw new Meteor.Error(403, error.reason);
Avoid deeply nested control flow statements. Open
if (!anime.endDate || moment(anime.endDate).year() == 0)
updateObj.endDate = moment(malAnime.end_date[0]).toDate();
Avoid deeply nested control flow statements. Open
if (error) {
throw new Meteor.Error(403, error.reason);
}
Function coverImageUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
coverImageUrl: function() {
// If revisionId exists then we're using the new upload system
// so we should use animeId in the url
if (this.newImageURLFormat) {
if (this.coverImage) {
- 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
Avoid deeply nested control flow statements. Open
if (LibraryEntries.simpleSchema().namedContext().validate(libraryEntry) === false) {
// if validation failed, we should continue on with adding the entries, but we should push the invalid keys object into an array.
importStats.failedImports++;
var invalidKeys = LibraryEntries.simpleSchema().namedContext().invalidKeys();
Function custom
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
custom: function() {
// this is how we're defining the max value
// We'll need to do this in a roundabout way for now
// since we can't get a field's value if it wasn't updated
// together with episodesSeen
- 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 revisionsAnimeUpdate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
revisionsAnimeUpdate: function(anime) {
// Ensure integerity of data
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
Function custom
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
custom: function() {
if (this.isInsert || !this.docId)
return
- 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"