Showing 364 of 761 total issues
File saveAbsence.js
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
const util = require('util');
Function exports
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(services, app)
{
var service = new services.list(app);
Function exports
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
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 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function site
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function site(languageCode) {
let headers = {};
let sessionCookie;
File routes.js
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
define(['angular', 'app'], function(angular, app) {
'use strict';
return app.config(['$routeProvider', function($routeProvider) {
Function createGraphValues
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createGraphValues(renewals, requestsPromise)
{
var history = [];
function round(x) {
Function exports
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(services, app) {
var service = new services.list(app);
Function saveRequest
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function saveRequest(service, params) {
const gt = service.app.utility.gettext;
const postpone = service.app.utility.postpone;
Function createDistribution
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createDistribution(renewals, periods, accountRights, matchQuantity) {
var totalSeconds = 0;
var totalDays = 0;
Function saveRequest
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function saveRequest(service, params) {
const gt = service.app.utility.gettext;
const postpone = service.app.utility.postpone;
Function exports
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(app, passport)
{
var controllers = new fileControllers(app);
Function exports
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(services, app) {
var service = new services.list(app);
/**
Function exports
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(user, account) {
/**
Function exports
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(params) {
var companySchema = new params.mongoose.Schema({
name: { type: String, required: true, unique: true }, // company name, site title
port: { type: Number, default: 3000 }, // server port
lastname: String, // system owner
Function getResultPromise
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
service.getResultPromise = function(params) {
var getExpandedEra = require('../../../../modules/getExpandedEra');
/**
Function exports
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
exports = module.exports = function(params) {
const mongoose = params.mongoose;
var defaultHalfDay = new Date();
- 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 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(service, moment) {
const gt = service.app.utility.gettext;
const NAME = gt.gettext('Name');
Function exports
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports = module.exports = function(services, app) {
let service = new services.get(app);
const gt = app.utility.gettext;
Function processRenewals
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function processRenewals(rightDocument, beneficiary, renewals, moment)
{
beneficiary.renewals = [];
beneficiary.daysRatio = 1;