From 0dad4bda6c02b3c62b8f9465a82d33f721dfbd13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 17 Sep 2021 07:33:03 +0200 Subject: [PATCH] Silence sonar a bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 2 +- src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts | 4 ++-- src/charging-station/ocpp/OCPPRequestService.ts | 2 +- src/worker/WorkerSet.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) 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) => { -- 2.34.1