Showing 364 of 761 total issues
Function createRandomUser
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createRandomUser = function(app, email, password, lastname, firstname) {
Function removeOrUpdate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var removeOrUpdate = function(userDocument, checkedRole, model, updateCallback, noRoleCallback) {
Function createBusinessDaysConsRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createBusinessDaysConsRequest = function(app, dtstart, dtend, nbdays, availableQuantity) {
Function createRandomAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createRandomAccount = function(app, email, password, lastname, firstname) {
Function useGoogleStrategy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function useGoogleStrategy(request, accessToken, refreshToken, profile, done) {
Function createRandomAdmin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createRandomAdmin = function(app, email, password, lastname, firstname) {
Function createRandomManager
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createRandomManager = function(app, email, password, lastname, firstname) {
Function createProportionConsRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createProportionConsRequest = function(app, attendance, dtstart, dtend, nbdays) {
Function createEncUser
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createEncUser = function(app, email, password, lastname, firstname) {
Function createEncAdmin
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
api.createEncAdmin = function(app, email, password, lastname, firstname) {
Function createElement
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function createElement(service, user, elem, collection, setElemProperties)
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
var service = new services.list(app);
/**
- 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
exports = module.exports = function(services, app) {
var service = new services.delete(app);
const gt = app.utility.gettext;
- 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
exports = module.exports = function(services, app) {
var service = new services.delete(app);
const gt = app.utility.gettext;
- 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
exports = module.exports = function(period1, period2) {
if (period2.to && period1.to) {
if (period1.to > period2.from && period1.from < period2.to) {
// the current period overlap one of the existing periods
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"
Further reading
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(app) {
const gt = app.utility.gettext;
return function checkParams(service, params) {
- 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 validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function validate(service, params) {
const gt = service.app.utility.gettext;
if (service.needRequiredFields(params, ['dtstart', 'dtend', 'name', 'userCreated', 'collections', 'departments', 'right'])) {
- 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
exports = module.exports = function(services, app) {
var service = new services.delete(app);
const gt = app.utility.gettext;
- 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 saveCollection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function saveCollection(service, params) {
const gt = service.app.utility.gettext;
- 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 saveAbsenceDistribution
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function saveAbsenceDistribution(service, user, params, collection) {
if (params.absence.distribution === undefined || params.absence.distribution.length === 0) {
return Promise.reject(new Error('Right distribution is mandatory to save an absence request'));
- 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"