Showing 364 of 761 total issues
Function exports
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
var mongoose = params.mongoose;
- 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 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
var mongoose = params.mongoose;
var absenceElemSchema = new mongoose.Schema({
quantity: { type: Number, required: true }, // quantity equal to duration of period in the planning (only duration of worked schedule)
consumedQuantity: { type: Number, required: true }, // quantity removed from vacation right according to Right.consumption
Function exports
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
const mongoose = params.mongoose;
const ruleTypes = [
Function exports
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(app, passport) {
let loginservices = app.config.company.loginservices;
let User = app.db.models.User;
let gt = app.utility.gettext;
Function init
has 187 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function init(decimalAdjust, gettext) {
/**
* Create graph values
Function exports
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = (app) => {
return new OAuthServer({
useErrorHandler: true,
model: {
/**
Function requestEdit
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function requestEdit(gettextCatalog) {
/**
* Duration in milliseconds updated on every period changes
* @var {int}
*/
Function exports
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
var mongoose = params.mongoose;
var eventSchema = new mongoose.Schema({
File absence-edit.js
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
define(['angular', 'services/request-edit'], function(angular, loadRequestEdit) {
'use strict';
return function(gettextCatalog) {
var RequestEdit = loadRequestEdit(gettextCatalog);
Function exports
has 158 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
let service = new services.list(app);
let collaborators = {};
File Company.api.js
has 428 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const models = require('../models');
const helmet = require('helmet');
const routes = require('../rest/routes');
Function getInfos
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.getInfos = function(req, res) {
let gt = req.app.utility.gettext;
Function pages
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function pages(server) {
function createUser() {
return new Promise((resolve, reject) => {
server.post('/rest/admin/users', {
File Calendar.js
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const ical = require('ical');
const util = require('util');
const latinize = require('latinize');
Function exports
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
const mongoose = params.mongoose;
const ruleTypes = [
- 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 37 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(app, passport) {
let loginservices = app.config.company.loginservices;
let User = app.db.models.User;
let 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 37 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
let service = new services.list(app);
let collaborators = {};
- 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
File save.js
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
const saveAbsence = require('./../../user/requests/saveAbsence');
const Services = require('restitute').service;
const util = require('util');
Function createRenewalChart
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function createRenewalChart(gettextCatalog, $filter) {
return function renewalChart($scope, beneficiariesResource)
{
$scope.renewalChart = {
Function renewalChart
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function renewalChart($scope, beneficiariesResource)
{
$scope.renewalChart = {
availableHours: 0,