From: Jérôme Benoit Date: Wed, 25 Aug 2021 22:26:30 +0000 (+0200) Subject: Silence some sonar code smells X-Git-Tag: v1.0.45~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6c3cfef8aa7818941a9f05e3cb293a5b60360b47;p=e-mobility-charging-stations-simulator.git Silence some sonar code smells Signed-off-by: Jérôme Benoit --- 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; }