Showing 726 of 2,177 total issues
Function leave
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function leave(objectType, collaboration, userAuthor, userTarget, callback) {
Function cancelMembershipInvitation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function cancelMembershipInvitation(objectType, collaboration, membership, manager, callback) {
Function esnUserNotificationCounter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_,
$q,
esnUserNotificationProviders,
CounterFactory,
ESN_USER_NOTIFICATION_UNREAD_REFRESH_TIMER
Function userMessageToTimelineEntry
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports.userMessageToTimelineEntry = function(message, verb, user, shares, date) {
Function recordAvatar
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function recordAvatar(id, contentType, opts, readable, callback) {
Function cancelMembershipRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function cancelMembershipRequest(objectType, collaboration, membership, user, callback) {
Function removeStateListener
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var removeStateListener = $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
Function ESNSearchAdvancedFormController
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$stateParams,
$rootScope,
esnSearchContextService,
esnSearchQueryService,
esnI18nService
Function profilePopoverCard
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$parse,
profilePopoverCardService,
touchscreenDetectorService,
matchmedia,
ESN_MEDIA_QUERY_SM_XS
Function link
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function link(scope, element, attrs, ctrl, transclude) {
Function esnDatetimeService
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$q,
_,
moment,
esnConfig,
ESN_DATETIME_TIME_FORMATS
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = dependencies => {
const { Model } = dependencies('people');
return ({ source }) => {
const { id, fullName, firstName, lastName, emails, phones } = parseContact(source);
- 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 canLeave
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function canLeave(req, res, next) {
if (!req.collaboration) {
return res.status(400).json({error: 400, message: 'Bad Request', details: 'Missing collaboration'});
}
- 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 exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = dependencies => {
const jobQueue = dependencies('jobqueue');
const contactModule = dependencies('contact');
const logger = dependencies('logger');
const {
- 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 canWriteUserConfig
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function canWriteUserConfig(req, res, next) {
const modules = req.body;
const hasUnwritableConfig = modules.some(module => {
if (!module || !Array.isArray(module.configurations)) {
- 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 getMembershipRequests
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getMembershipRequests(req, res) {
const collaboration = req.collaboration;
if (!req.isCollaborationManager) {
return res.status(403).json({error: {code: 403, message: 'Forbidden', details: 'Only collaboration managers can get requests'}});
- 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 profileToUser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports.profileToUser = function(profile, user) {
user = user || {};
user.firstname = profile.name.givenName ? profile.name.givenName : '';
user.lastname = profile.name.familyName ? profile.name.familyName : '';
user.description = profile._json.bio ? profile._json.bio : '';
- 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 translate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function translate(baseUser, payload) {
const userEmail = payload.username; // we use email as username to authenticate
const domainId = payload.domainId;
const payloadUser = payload.user;
const mapping = payload.mapping;
- 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 count
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function count(options) {
var defer = q.defer();
var query = {};
if (options.type) {
- 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 validateAction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function validateAction(value) {
if (!value.url) { return false; }
if (!value.display) { return false; }
if (!value.display.label) { return false; }
if (!value.display.text) { return false; }
- 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"