Commit 093f4f4
fix: HostFactory 參數封裝外部化、SonarCloud 程式碼品質修復、靜態方法優化
1. HostFactory 參數封裝外部化
- HostFactory.cs:CreateHost 方法簽章簡化,改為接收單一 HostConfigBundle 參數(原本在方法內部建立)
- HostFactory.cs:HostConfigBundle record 從 private 改為 internal,允許外部建立
- Program.cs:在呼叫 HostFactory.CreateHost 前建立 HostConfigBundle 實例,提升配置組合的靈活性
2. SonarCloud 程式碼品質修復
- ExtensionManager.cs:processCleanupManager?.Dispose() 加入 #pragma warning disable/restore S2589 抑制「Boolean expressions should not be gratuitous」警告(條件式 Dispose 為防禦性程式碼)
3. 靜態方法優化
- ExtensionSessionBridge.cs:CreateMetadata 方法改為 static(不使用實例成員,符合 CA1822 建議)1 parent db47b4f commit 093f4f4
File tree
4 files changed
+11
-25
lines changed- Core
- Extension
4 files changed
+11
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
173 | 174 | | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1374 | 1374 | | |
1375 | 1375 | | |
1376 | 1376 | | |
1377 | | - | |
| 1377 | + | |
1378 | 1378 | | |
1379 | 1379 | | |
1380 | 1380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 42 | + | |
49 | 43 | | |
50 | 44 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 45 | + | |
60 | 46 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 47 | + | |
65 | 48 | | |
66 | 49 | | |
67 | 50 | | |
68 | 51 | | |
69 | | - | |
| 52 | + | |
70 | 53 | | |
71 | 54 | | |
72 | 55 | | |
| |||
425 | 408 | | |
426 | 409 | | |
427 | 410 | | |
428 | | - | |
| 411 | + | |
429 | 412 | | |
430 | 413 | | |
431 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
0 commit comments