Silence some sonar code smells
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 25 Aug 2021 22:26:30 +0000 (00:26 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 25 Aug 2021 22:26:30 +0000 (00:26 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/performance-storage/StorageFactory.ts
src/worker/WorkerDynamicPool.ts
src/worker/WorkerFactory.ts
src/worker/WorkerSet.ts

index 4d04dee2e064fc2b9b876ce2a54411945acc08f8..2012b500e544485c8f0f607ea4d9b89a5ac363a4 100644 (file)
@@ -6,7 +6,9 @@ import logger from '../Logger';
 
 export class StorageFactory {
   // eslint-disable-next-line @typescript-eslint/no-empty-function
-  private constructor() {}
+  private constructor() {
+    // This is intentional
+  }
 
   public static getStorage(type: StorageType, connectionURI: string, logPrefix: string): Storage {
     let storageInstance: Storage = null;
index 306bcd4f38f415b1823a205198e05a8ddb3a38a0..47d1e458b0c0593d5dd12226a9afc9a16036c029 100644 (file)
@@ -38,7 +38,9 @@ export default class WorkerDynamicPool<T> extends WorkerAbstract {
    * @public
    */
   // eslint-disable-next-line @typescript-eslint/no-empty-function
-  public async start(): Promise<void> {}
+  public async start(): Promise<void> {
+    // This is intentional
+  }
 
   /**
    *
index 6164848d99018bda55769141e3a3b08114735b8c..8ccd6698bc3bffd2e33e71e3d4270541f6c46694 100644 (file)
@@ -9,7 +9,9 @@ import { isMainThread } from 'worker_threads';
 
 export default class WorkerFactory {
   // eslint-disable-next-line @typescript-eslint/no-empty-function
-  private constructor() {}
+  private constructor() {
+    // This is intentional
+  }
 
   public static getWorkerImplementation<T>(workerScript: string, workerProcessType: WorkerProcessType, options?: WorkerOptions): WorkerAbstract | null {
     if (!isMainThread) {
index e6421b14ab746fd816eadac1566fa44c4e705dbf..32956104d288808de4150d776a113ad065c8ed80 100644 (file)
@@ -76,8 +76,8 @@ export default class WorkerSet<T> extends WorkerAbstract {
    */
   private startWorker(): void {
     const worker = new Worker(this.workerScript);
-    worker.on('message', () => { });
-    worker.on('error', () => { });
+    worker.on('message', () => { /* This is intentional */ });
+    worker.on('error', () => { /* This is intentional */ });
     worker.on('exit', (code) => {
       WorkerUtils.defaultExitHandler(code);
       this.workerSet.delete(this.getWorkerSetElementByWorker(worker));
@@ -88,7 +88,7 @@ export default class WorkerSet<T> extends WorkerAbstract {
   private getLastWorkerSetElement(): WorkerSetElement {
     let workerSetElement: WorkerSetElement;
     // eslint-disable-next-line no-empty
-    for (workerSetElement of this.workerSet) { }
+    for (workerSetElement of this.workerSet) { /* This is intentional */ }
     return workerSetElement;
   }