Showing 364 of 761 total issues
Function getNextButtonJob
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getNextButtonJob($scope, user, accountRights) {
return function() {
// hide the period selection
$scope.periodSelection = false;
Function getInitTask
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
rightSchema.statics.getInitTask = function(company) {
let model = this;
Function exports
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(req, res) {
var workflow = new (require('events').EventEmitter)();
workflow.httpstatus = 200;
- 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 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
const gt = app.utility.gettext;
const dispunits = app.utility.dispunits;
Function getResultPromise
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
service.getResultPromise = function(params) {
var filter = {
_id: params.id
};
Function exports
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
var collectionSchema = new params.mongoose.Schema({
name: { type: String, required: true, unique: true },
timeCreated: { type: Date, default: Date.now },
attendance: { type: Number, min: 0, max: 100, default: 100 }, // attendance percentage
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
var mongoose = params.mongoose;
var eventSchema = new mongoose.Schema({
- 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 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
var service = new services.list(app);
const dispunits = app.utility.dispunits;
Function convertOvertimeQuantity
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convertOvertimeQuantity(service, params) {
const gt = service.app.utility.gettext;
const AccountModel = service.app.db.models.Account;
const OvertimeModel = service.app.db.models.Overtime;
const RightModel = service.app.db.models.Right;
File calendar.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
define(['moment'], function(moment) {
'use strict';
return function loadCalendarService($locale, $q, $routeParams) {
Function exports
has a Cognitive Complexity of 23 (exceeds 5 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
- 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 LoadRestListService
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function LoadRestListService(ResourceFactory, RestResource) {
/**
* the returned object will be the one used in controller
* to create the resource from url or create a new one
Function exports
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports = module.exports = function(params) {
var mongoose = params.mongoose;
var typeSchema = new mongoose.Schema({
name: { type: String, unique: true },
Function getExpress
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
getExpress: function getExpress(config, models) {
let mongoStore = connectMongodbSession(session);
Function exports
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
exports = module.exports = function(services, app) {
let service = new services.get(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 resetPassword
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.resetPassword = function(req, res) {
let User = req.app.db.models.User;
let gt = req.app.utility.gettext;
let workflow = req.app.utility.workflow(req, res);
Function saveCompulsoryLeave
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function saveCompulsoryLeave(service, params) {
const gt = service.app.utility.gettext;
/**
Function getUserRequests
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getUserRequests(user, from, to, types) {
let calendar;
Function createRequest
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createRequest(userId) {
let fieldsToSet;
let Request = service.app.db.models.Request;
Function prepareRequestFields
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareRequestFields(service, params, user)
{
return getApprovalSteps(user)