From: Jérôme Benoit Date: Tue, 30 Nov 2021 21:15:11 +0000 (+0100) Subject: Silence one code smell X-Git-Tag: v1.1.36~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f16356b923701711aa03d240eb932f1ff3fe4bf7;p=e-mobility-charging-stations-simulator.git Silence one code smell Signed-off-by: Jérôme Benoit --- diff --git a/package-lock.json b/package-lock.json index 67a07e29..a735b957 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1455,9 +1455,9 @@ "dev": true }, "@jest/types": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.4.1.tgz", - "integrity": "sha512-Uvy+gMBzj6Yak95w1g83AEwhoqzs2letmwKNvb1QgLsqkCxy9NIpNUjrgmra87FVMDsFFgCxcZ6ZaHkQFXJ7Zg==", + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-27.4.2.tgz", + "integrity": "sha512-j35yw0PMTPpZsUoOBiuHzr1zTYoad1cVIE0ajEjcrJONxxrko/IRGKkXx3os0Nsi4Hu3+5VmDbVfq5WhG/pWAg==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "^2.0.0", @@ -3929,9 +3929,9 @@ } }, "bson": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/bson/-/bson-4.5.4.tgz", - "integrity": "sha512-wIt0bPACnx8Ju9r6IsS2wVtGDHBr9Dxb+U29A1YED2pu8XOhS8aKjOnLZ8sxyXkPwanoK7iWWVhS1+coxde6xA==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.0.tgz", + "integrity": "sha512-8jw1NU1hglS+Da1jDOUYuNcBJ4cNHCFIqzlwoFNnsTOg2R/ox0aTYcTiBN4dzRa9q7Cvy6XErh3L8ReTEb9AQQ==", "requires": { "buffer": "^5.6.0" }, @@ -7361,16 +7361,16 @@ } }, "expect": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-27.4.1.tgz", - "integrity": "sha512-ykhuCRLKtHEo8/+qHX2PV7wjX4HMQY635Pe8+7G8hbssDNy7cfE6t/rHbdzEMVfh2KR3Z6V21MveI86IJ7V1jQ==", + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-27.4.2.tgz", + "integrity": "sha512-BjAXIDC6ZOW+WBFNg96J22D27Nq5ohn+oGcuP2rtOtcjuxNoV9McpQ60PcQWhdFOSBIQdR72e+4HdnbZTFSTyg==", "dev": true, "requires": { - "@jest/types": "^27.4.1", + "@jest/types": "^27.4.2", "ansi-styles": "^5.0.0", "jest-get-type": "^27.4.0", - "jest-matcher-utils": "^27.4.1", - "jest-message-util": "^27.4.1", + "jest-matcher-utils": "^27.4.2", + "jest-message-util": "^27.4.2", "jest-regex-util": "^27.4.0" }, "dependencies": { @@ -9804,15 +9804,15 @@ } }, "jest-diff": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.4.1.tgz", - "integrity": "sha512-bkDaDwdausD1tai7/7+WLBsI8lX0JnaL+2FwWOxyfbKR2G1iu+OX/R1YQPk4Xe2jwYI/hOAGxkqhGgAAT7/lsw==", + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-27.4.2.tgz", + "integrity": "sha512-ujc9ToyUZDh9KcqvQDkk/gkbf6zSaeEg9AiBxtttXW59H/AcqEYp1ciXAtJp+jXWva5nAf/ePtSsgWwE5mqp4Q==", "dev": true, "requires": { "chalk": "^4.0.0", "diff-sequences": "^27.4.0", "jest-get-type": "^27.4.0", - "pretty-format": "^27.4.1" + "pretty-format": "^27.4.2" } }, "jest-get-type": { @@ -9822,30 +9822,30 @@ "dev": true }, "jest-matcher-utils": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.4.1.tgz", - "integrity": "sha512-CG0qQY4NN0Jthr/50jZbDL2cE6p8KZwBRkmVnuKv5QBMwkY6QEVxDQfhA+a5Uz17r7MjUQRWCig7H7IwG+L7qw==", + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.4.2.tgz", + "integrity": "sha512-jyP28er3RRtMv+fmYC/PKG8wvAmfGcSNproVTW2Y0P/OY7/hWUOmsPfxN1jOhM+0u2xU984u2yEagGivz9OBGQ==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^27.4.1", + "jest-diff": "^27.4.2", "jest-get-type": "^27.4.0", - "pretty-format": "^27.4.1" + "pretty-format": "^27.4.2" } }, "jest-message-util": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.4.1.tgz", - "integrity": "sha512-oC3sEs5dDHk5ibCrjIkDoe2S+U2bGogI3b8D9bGyKxJu/HSyibG/pWBI27gG3cwXgRyiGXZHuSiVCq7f+PoYcw==", + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.4.2.tgz", + "integrity": "sha512-OMRqRNd9E0DkBLZpFtZkAGYOXl6ZpoMtQJWTAREJKDOFa0M6ptB7L67tp+cszMBkvSgKOhNtQp2Vbcz3ZZKo/w==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^27.4.1", + "@jest/types": "^27.4.2", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.4", "micromatch": "^4.0.4", - "pretty-format": "^27.4.1", + "pretty-format": "^27.4.2", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -11377,11 +11377,11 @@ } }, "mongodb": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.2.0.tgz", - "integrity": "sha512-lg3MJ9dAKxhogRnIB6/j63gfD7JryZwRC0nNzZ82RhENw4nCmscZVqRfOmNzTvSNndJx9ZhxZpm9JvnKuH/GTA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.2.1.tgz", + "integrity": "sha512-nDC+ulM/Ea3Q2VG5eemuGfB7T4ORwrtKegH2XW9OLlUBgQF6OTNrzFCS1Z3SJGVA+T0Sr1xBYV6DMnp0A7us0g==", "requires": { - "bson": "^4.5.4", + "bson": "^4.6.0", "denque": "^2.0.1", "mongodb-connection-string-url": "^2.2.0", "saslprep": "^1.0.3" @@ -13324,12 +13324,12 @@ "dev": true }, "pretty-format": { - "version": "27.4.1", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.4.1.tgz", - "integrity": "sha512-JJw4GzG0vP5dHA+D84zryrX3S34B6rZaJj6zsrN/sdNpcUNf1X6aH/7sPSqwtAGNXCxDqMa1wAKX4EH1Tv62aw==", + "version": "27.4.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.4.2.tgz", + "integrity": "sha512-p0wNtJ9oLuvgOQDEIZ9zQjZffK7KtyR6Si0jnXULIDwrlNF8Cuir3AZP0hHv0jmKuNN/edOnbMjnzd4uTcmWiw==", "dev": true, "requires": { - "@jest/types": "^27.4.1", + "@jest/types": "^27.4.2", "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" diff --git a/package.json b/package.json index 2af86b05..acdea746 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "@mikro-orm/sqlite": "^4.5.9", "basic-ftp": "^4.6.6", "chalk": "^4.1.2", - "mongodb": "^4.2.0", + "mongodb": "^4.2.1", "poolifier": "^2.1.0", "proper-lockfile": "^4.1.2", "source-map-support": "^0.5.21", @@ -108,7 +108,7 @@ "eslint-plugin-import": "^2.25.3", "eslint-plugin-jsdoc": "^37.0.3", "eslint-plugin-node": "^11.1.0", - "expect": "^27.4.1", + "expect": "^27.4.2", "mocha": "^9.1.3", "mochawesome": "^7.0.1", "npm-check": "^5.9.2", diff --git a/src/charging-station/UIWebSocketServices/AbstractUIService.ts b/src/charging-station/UIWebSocketServices/AbstractUIService.ts index a817c859..67512698 100644 --- a/src/charging-station/UIWebSocketServices/AbstractUIService.ts +++ b/src/charging-station/UIWebSocketServices/AbstractUIService.ts @@ -43,7 +43,7 @@ export default abstract class AbstractUIService { return JSON.stringify([command, payload]); } - protected handleListChargingStations(): Set { + private handleListChargingStations(): Set { return this.chargingStations; } } diff --git a/src/charging-station/UIWebSocketServices/UIService_0_0_1.ts b/src/charging-station/UIWebSocketServices/UIService001.ts similarity index 90% rename from src/charging-station/UIWebSocketServices/UIService_0_0_1.ts rename to src/charging-station/UIWebSocketServices/UIService001.ts index eebaf011..5aba5a7b 100644 --- a/src/charging-station/UIWebSocketServices/UIService_0_0_1.ts +++ b/src/charging-station/UIWebSocketServices/UIService001.ts @@ -2,7 +2,7 @@ import AbstractUIService from './AbstractUIService'; import { ProtocolCommand } from '../../types/UIProtocol'; import UIWebSocketServer from '../UIWebSocketServer'; -export default class UIService_0_0_1 extends AbstractUIService { +export default class UIService001 extends AbstractUIService { constructor(uiWebSocketServer: UIWebSocketServer) { super(uiWebSocketServer); this.messageHandlers.set(ProtocolCommand.START_TRANSACTION, this.handleStartTransaction.bind(this)); diff --git a/src/charging-station/UIWebSocketServices/UIServiceFactory.ts b/src/charging-station/UIWebSocketServices/UIServiceFactory.ts index a4d8d6e8..108a113f 100644 --- a/src/charging-station/UIWebSocketServices/UIServiceFactory.ts +++ b/src/charging-station/UIWebSocketServices/UIServiceFactory.ts @@ -1,6 +1,6 @@ import AbstractUIService from './AbstractUIService'; import { ProtocolVersion } from '../../types/UIProtocol'; -import UIService_0_0_1 from './UIService_0_0_1'; +import UIService001 from './UIService001'; import UIWebSocketServer from '../UIWebSocketServer'; export default class UIServiceFactory { @@ -11,7 +11,7 @@ export default class UIServiceFactory { public static getUIServiceImplementation(version: ProtocolVersion, uiWebSocketServer: UIWebSocketServer): AbstractUIService | null { switch (version) { case ProtocolVersion['0.0.1']: - return new UIService_0_0_1(uiWebSocketServer); + return new UIService001(uiWebSocketServer); default: return null; }