From: Jérôme Benoit Date: Fri, 17 Sep 2021 05:33:03 +0000 (+0200) Subject: Silence sonar a bit X-Git-Tag: v1.1.2~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0dad4bda6c02b3c62b8f9465a82d33f721dfbd13;p=e-mobility-charging-stations-simulator.git Silence sonar a bit Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 185eab5e..fe2b5d8d 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -899,7 +899,7 @@ export default class ChargingStation { if (webSocketPingInterval > 0 && !this.webSocketPingSetInterval) { this.webSocketPingSetInterval = setInterval(() => { if (this.isWebSocketConnectionOpened()) { - this.wsConnection.ping((): void => { }); + this.wsConnection.ping((): void => { /* This is intentional */ }); } }, webSocketPingInterval * 1000); logger.info(this.logPrefix() + ' WebSocket ping started every ' + Utils.secondsToHHMMSS(webSocketPingInterval)); diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index 7fde148b..fa6cd8f7 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -407,12 +407,12 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer setTimeout(() => { this.chargingStation.ocppRequestService.sendBootNotification(this.chargingStation.getBootNotificationRequest().chargePointModel, this.chargingStation.getBootNotificationRequest().chargePointVendor, this.chargingStation.getBootNotificationRequest().chargeBoxSerialNumber, - this.chargingStation.getBootNotificationRequest().firmwareVersion).catch(() => {}); + this.chargingStation.getBootNotificationRequest().firmwareVersion).catch(() => { /* This is intentional */ }); }, Constants.OCPP_TRIGGER_MESSAGE_DELAY); return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED; case MessageTrigger.Heartbeat: setTimeout(() => { - this.chargingStation.ocppRequestService.sendHeartbeat().catch(() => {}); + this.chargingStation.ocppRequestService.sendHeartbeat().catch(() => { /* This is intentional */ }); }, Constants.OCPP_TRIGGER_MESSAGE_DELAY); return Constants.OCPP_TRIGGER_MESSAGE_RESPONSE_ACCEPTED; default: diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index c35f78de..d17c21d3 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -81,7 +81,7 @@ export default abstract class OCPPRequestService { logger.debug(`${self.chargingStation.logPrefix()} Error: %j occurred when calling command %s with parameters: %j`, error, commandName, commandParams); // Build Exception // eslint-disable-next-line no-empty-function - self.chargingStation.requests.set(messageId, [() => { }, () => { }, {}]); + self.chargingStation.requests.set(messageId, [() => { /* This is intentiomal */ }, () => { /* This is intentiomal */ }, {}]); // Send error reject(error); } diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index ae99da5b..b782f311 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -23,7 +23,7 @@ export default class WorkerSet extends WorkerAbstract { constructor(workerScript: string, maxElementsPerWorker = 1, workerStartDelay?: number, opts?: WorkerOptions) { super(workerScript, workerStartDelay); this.maxElementsPerWorker = maxElementsPerWorker; - this.messageHandler = opts?.messageHandler ?? (() => { }); + this.messageHandler = opts?.messageHandler ?? (() => { /* This is intentional */ }); this.workerSet = new Set(); } @@ -82,7 +82,7 @@ export default class WorkerSet extends WorkerAbstract { worker.on('message', (msg) => { (async () => { await this.messageHandler(msg); - })().catch(() => {}); + })().catch(() => { /* This is intentional */ }); }); worker.on('error', () => { /* This is intentional */ }); worker.on('exit', (code) => {