Silence one code smell
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 Nov 2021 21:15:11 +0000 (22:15 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 Nov 2021 21:15:11 +0000 (22:15 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
package-lock.json
package.json
src/charging-station/UIWebSocketServices/AbstractUIService.ts
src/charging-station/UIWebSocketServices/UIService001.ts [moved from src/charging-station/UIWebSocketServices/UIService_0_0_1.ts with 90% similarity]
src/charging-station/UIWebSocketServices/UIServiceFactory.ts

index 67a07e29bc83f9556ddba44e89bd15f5ca87178c..a735b957e9f6a6009a0919b22de5336d04de0f34 100644 (file)
       "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",
       }
     },
     "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"
       },
       }
     },
     "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": {
       }
     },
     "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": {
       "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"
       },
       }
     },
     "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"
       "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"
index 2af86b05f6649e13b6bf32aca37c66af556ebcab..acdea7465cb052c6d053e5955ad1d1acd52d2752 100644 (file)
@@ -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",
     "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",
index a817c859571390b1c8af023b0278462877e7b835..675126989503b1e084e8e0889b10ad1e337c4280 100644 (file)
@@ -43,7 +43,7 @@ export default abstract class AbstractUIService {
     return JSON.stringify([command, payload]);
   }
 
-  protected handleListChargingStations(): Set<string> {
+  private handleListChargingStations(): Set<string> {
     return this.chargingStations;
   }
 }
similarity index 90%
rename from src/charging-station/UIWebSocketServices/UIService_0_0_1.ts
rename to src/charging-station/UIWebSocketServices/UIService001.ts
index eebaf0111b57ba38ab74a6407b408689b47f7ee9..5aba5a7b70cca0bab3ab3d440267daf4cf04d3a7 100644 (file)
@@ -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));
index a4d8d6e8aeff534b572ccb6f89169029cb40ea68..108a113f7558b07cccf351c22582baa5f205103c 100644 (file)
@@ -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;
     }