From 6c3cfef8aa7818941a9f05e3cb293a5b60360b47 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 26 Aug 2021 00:26:30 +0200 Subject: [PATCH] Silence some sonar code smells MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/performance-storage/StorageFactory.ts | 4 +++- src/worker/WorkerDynamicPool.ts | 4 +++- src/worker/WorkerFactory.ts | 4 +++- src/worker/WorkerSet.ts | 6 +++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/utils/performance-storage/StorageFactory.ts b/src/utils/performance-storage/StorageFactory.ts index 4d04dee2..2012b500 100644 --- a/src/utils/performance-storage/StorageFactory.ts +++ b/src/utils/performance-storage/StorageFactory.ts @@ -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; diff --git a/src/worker/WorkerDynamicPool.ts b/src/worker/WorkerDynamicPool.ts index 306bcd4f..47d1e458 100644 --- a/src/worker/WorkerDynamicPool.ts +++ b/src/worker/WorkerDynamicPool.ts @@ -38,7 +38,9 @@ export default class WorkerDynamicPool extends WorkerAbstract { * @public */ // eslint-disable-next-line @typescript-eslint/no-empty-function - public async start(): Promise {} + public async start(): Promise { + // This is intentional + } /** * diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index 6164848d..8ccd6698 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -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(workerScript: string, workerProcessType: WorkerProcessType, options?: WorkerOptions): WorkerAbstract | null { if (!isMainThread) { diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index e6421b14..32956104 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -76,8 +76,8 @@ export default class WorkerSet 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 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; } -- 2.34.1