Function users.editProfile
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
'users.editProfile'(userId, eMail, longName) {
check(eMail, String);
check(longName, String);
if (! Meteor.userId()) {
throw new Meteor.Error('Cannot edit profile', 'User not logged in.');
- 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 users.editProfile
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
'users.editProfile'(userId, eMail, longName) {
check(eMail, String);
check(longName, String);
if (! Meteor.userId()) {
throw new Meteor.Error('Cannot edit profile', 'User not logged in.');
Function users.admin.registerUser
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
'users.admin.registerUser'(username, longname, email, password1, password2, sendMail, sendPassword) {
console.log('users.admin.registerUser for user: '+username);
// #Security: Only logged in admin may invoke this method: users.admin.registerUser
if (! Meteor.userId()) {
throw new Meteor.Error('Cannot register user', 'User not logged in.');
Function users.admin.changePassword
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
'users.admin.changePassword'(userId, password1, password2) {
if (Meteor.isServer) {
// #Security: Only logged in admin may invoke this method: users.admin.changePassword
console.log('users.admin.changePassword for user: '+Meteor.userId());
if (! Meteor.userId()) {
- 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 users.admin.registerUser
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
'users.admin.registerUser'(username, longname, email, password1, password2, sendMail, sendPassword) {
Function users.admin.registerUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
'users.admin.registerUser'(username, longname, email, password1, password2, sendMail, sendPassword) {
console.log('users.admin.registerUser for user: '+username);
// #Security: Only logged in admin may invoke this method: users.admin.registerUser
if (! Meteor.userId()) {
throw new Meteor.Error('Cannot register user', 'User not logged in.');
- 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 users.admin.ToggleInactiveUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
'users.admin.ToggleInactiveUser'(userId) {
console.log('users.admin.ToggleInactiveUser for '+userId);
// #Security: Only logged in admin may invoke this method: users.admin.ToggleInactiveUser
if (! Meteor.user().isAdmin) {
throw new Meteor.Error('Cannot toggle inactive user', 'You are not admin.');
- 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"