Silence sonar a bit
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Sep 2021 05:33:03 +0000 (07:33 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 17 Sep 2021 05:33:03 +0000 (07:33 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/OCPPRequestService.ts
src/worker/WorkerSet.ts

index 185eab5e504735608d2b3f184948fed422fcada1..fe2b5d8dd9abe16644fc6c3594b31f322cd594a0 100644 (file)
@@ -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));
index 7fde148b4834af16a4428345cc745661536eefb8..fa6cd8f722178da59d531cd8a42fb4bab1940c3c 100644 (file)
@@ -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:
index c35f78de254e8080743aa81f11253877cfd6ca1c..d17c21d3805945bc94bc93534d4c2eca2a698f33 100644 (file)
@@ -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);
       }
index ae99da5b4a319093bd4923913a173d3a2a1eb040..b782f3111a382e568b965351d080e204c88b0f4d 100644 (file)
@@ -23,7 +23,7 @@ export default class WorkerSet<T> 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<WorkerSetElement>();
   }
 
@@ -82,7 +82,7 @@ export default class WorkerSet<T> 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) => {