Repository navigation
fix(localization): 拆分 check_keys.py main 降低认知复杂度 - #914
Conversation
SonarCloud python:S3776 在合并 #912 后的 main 上仍报 main() 认知复杂度超标(原 29,阈值 15)。将阶段编排拆为四个模块内 私有 helper:_parse_arguments、_report_placeholder_stage、 _report_callsite_stage、_exit_with_summary,main() 仅保留编排 与结构失败退出(sys.exit(2) 语义不变)。纯等价重构,门禁输出 与退出码逐字节一致。 Linear: GFX-1168
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
检查阶段辅助函数 GameFrameX.Localization/check_keys.py |
新增参数解析、占位符一致性检查、调用点扫描和退出汇总函数;保留原有参数、报告和退出行为。 |
main() 调用流程 GameFrameX.Localization/check_keys.py |
main() 调用新增辅助函数,并保持检查顺序和失败消息传递不变。 |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Refactor
Possibly related PRs
- GameFrameX/GameFrameX.Server.Source#909:该 PR 建立
check_keys.py本地化一致性门禁;本 PR 重构该门禁的参数解析、报告和退出汇总。 - GameFrameX/GameFrameX.Server.Source#912:该 PR 与本 PR 都处理
check_keys.py的认知复杂度问题;本 PR 继续拆分main(),并保持 CLI 契约和检查输出行为。
Merge Risk: 
Minimal · up to bbaef
-
No actionable merge-blocking risk was identified. Run the normal quality checks before merging.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|



Fixes GFX-1168
Closes #913
Summary by CodeRabbit