server/lib/device/device.calculateAggregate.js
Function calculateAggregate
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function calculateAggregate(type, jobId) {
logger.info(`Calculating aggregates device feature state for interval ${type}`);
// First we get the retention policy of this aggregates type
let retentionPolicyInDays = await this.variable.getValue(AGGREGATES_POLICY_RETENTION_VARIABLES[type]);
Function promise
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const promise = new Promise((resolve, reject) => {
let err = '';
const childProcess = spawn('node', [SCRIPT_PATH, JSON.stringify(params)]);
childProcess.stdout.on('data', async (data) => {