Showing 7 of 7 total issues
File EncryptionUtils.js
has 415 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var CONFIG_PAT = {
enforceEmailVerification: Match.Optional(Boolean),
onGeneratedKeypair: Match.Optional(Function)
};
`` has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
EncryptionUtils = {
/**
* standard options
*/
options: {
Function encryptDocWithId
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
encryptDocWithId: function (doc, fields, name, documentKey) {
var self = this,
// client only so this works :)
user = Meteor.user(),
newDoc = {},
Function extendProfile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
extendProfile: function (password) {
var self = this;
var userId = Meteor.userId();
// generate keypair
var keyPair = nacl.box.keyPair();
Function onSignIn
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onSignIn: function (password) {
var self = this,
user = Meteor.user();
if (self.options.enforceEmailVerification === true && user.emails[
Function shareDocWithUser
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
shareDocWithUser: function (docId, docType, userId) {
var self = this,
asymNonce = self.generate24ByteNonce();
// find principal of user to share post with
Function encryptDocWithId
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
encryptDocWithId: function (doc, fields, name, documentKey) {
var self = this,
// client only so this works :)
user = Meteor.user(),
newDoc = {},
- 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"