死代码、遗留资源和过期注释清理 [AI Review]

Open
#3,826 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
39/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
backend, desktop

Research direction

Start with the listed files and references, especially ProcessInterop.cs, PageRegistry.cs, LauncherCommon.cs, the named unused resources, and the WPF-era comments and TODOs. Check current callers and project compile or resource inclusion settings before removing each item. Done means the listed dead code, unused WPF resources, and outdated comments are addressed; the issue does not name validation commands or tests.

Written by the indexing model from the issue text.

Description

⭕ 等待处理

🤖 这条 Issue 由 AI 代码审计批量生成,未经人工逐项复核。基线:dev@2856c2a4(迁移范围 9c4f1544..2856c2a4)。证据来自静态代码分析,欢迎在评论中补充或纠正。

现象

迁移后仍有一批没有调用方的类、方法和资源,还有一些注释停留在 WPF 时期。

证据

  • PCL.Core/Utils/OS/ProcessInterop.cs:258-329 的 SetGpuPreference 没有调用方,实际实现已在 PCL.Platform/Windows/WindowsGpuPreferenceService.cs。
  • PCL.Launcher/Navigation/PageRegistry.cs:31-39 的 Register 没有调用方。
  • PCL.Launcher.Core/LauncherCommon.cs:395-401 的 IniClearCache 是空方法,仍有 4 处调用。
  • PCL.Core/Utils/EaseUtils.cs、PCL.Core.UI/Animation/Clock/StopwatchClock.cs、PCL.Core.UI/Animation/Core/AnimationData.cs 等没有引用。
  • PCL.Launcher/Resources/Font.ttf 和 PCL.Launcher/Resources/Markdown.xaml 没有被使用。
  • PCL.Core.Test/BlurPerformanceTest.cs 被 Compile Remove,仍引用 WPF 类型。
  • 注释:LauncherPaths.cs:78、LauncherCommon.cs:34、LocalizationSource.cs:11、ModalFrame.cs:6-8 仍在说 WPF 宿主或迁移计划。
  • PageSetupGameLink.axaml:73 和 LegacyMcPingService.cs:52 的 TODO 已经过时,对应功能已经存在。

影响

阅读代码时很难判断哪些是当前实现,哪些是历史遗留。打包体积也多了一些无用资源。

建议

  • 删除确认没有调用方的类、方法和资源。
  • 空方法要么实现,要么连同调用一起删除。
  • 把 WPF 兼容代码集中标注为兼容层,其他注释改成当前架构。
  • 删除过时 TODO。

验收

  • 死代码清单中的项目处理完毕。
  • 资源目录不再包含未引用的 WPF 文件。
  • 注释里的 WPF 宿主、迁移计划等描述清理完成。
Dominant language
C#
Stars
4.3k
Forks
148
Avg merge
1d 6h
Merged PRs (30d)
64

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PCL-Community/PCL-CE

All issues in PCL-Community/PCL-CE

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.