Loading...
Loading...
Compare original and translation side by side
git diff main...HEAD --name-only
git log main...HEAD --onelinegit diff main...HEADgit diff main...HEAD --name-only
git log main...HEAD --onelinegit diff main...HEADundefinedundefinedundefinedundefined| Issue | Pattern | Recommendation |
|---|---|---|
| Hardcoded secrets | | Use environment variables |
| SQL injection | | Use parameterized queries |
| XSS vulnerability | | Sanitize or use textContent |
| Missing auth check | New endpoint without | Add authentication middleware |
| 问题 | 表现形式 | 建议 |
|---|---|---|
| 硬编码密钥 | | 使用环境变量 |
| SQL注入 | | 使用参数化查询 |
| XSS漏洞 | | 清理输入或使用textContent |
| 缺失权限检查 | 新接口未添加 | 添加身份验证中间件 |
| Issue | Pattern | Recommendation |
|---|---|---|
| N+1 query | Loop with database call | Use eager loading or batch queries |
| Unnecessary re-render | Missing dependencies in | Fix dependency array |
| Memory leak | Event listener not removed | Add cleanup in useEffect return |
| Inefficient loop | Nested loops O(n²) | Consider hash map or different algorithm |
| 问题 | 表现形式 | 建议 |
|---|---|---|
| N+1查询 | 循环中包含数据库调用 | 使用预加载或批量查询 |
| 不必要的重渲染 | | 修复依赖数组 |
| 内存泄漏 | 事件监听器未移除 | 在useEffect返回函数中添加清理逻辑 |
| 低效循环 | 嵌套循环O(n²) | 考虑使用哈希表或其他算法 |
| Issue | Pattern | Recommendation |
|---|---|---|
| Duplicate code | Similar blocks repeated | Extract to function |
| Magic number | | Use named constant |
| Long function | Function >50 lines | Split into smaller functions |
| Complex condition | `a && b |
| 问题 | 表现形式 | 建议 |
|---|---|---|
| 重复代码 | 相似代码块重复出现 | 提取为函数 |
| 魔法数字 | | 使用命名常量 |
| 过长函数 | 函数超过50行 | 拆分为更小的函数 |
| 复杂条件 | `a && b |
| Issue | Pattern | Recommendation |
|---|---|---|
| No tests | New feature without test file | Add unit tests |
| Untested edge case | Test only covers happy path | Add edge case tests |
| Brittle test | Test relies on implementation details | Test behavior, not implementation |
| Missing assertion | Test doesn't assert anything | Add proper assertions |
| 问题 | 表现形式 | 建议 |
|---|---|---|
| 无测试 | 新功能无测试文件 | 添加单元测试 |
| 未覆盖边界情况 | 仅测试正常流程 | 添加边界情况测试 |
| 脆弱性测试 | 测试依赖实现细节 | 测试行为而非实现 |
| 缺失断言 | 测试未包含任何断言 | 添加合理的断言 |
unknownanyinterfacetypeasunknownanyinterfacetypeasuseCallbackuseMemouseCallbackuseMemopython scripts/review_checklist.py <pr-number>python scripts/review_checklist.py <pr-number>references/checklist.mdreferences/security.mdreferences/patterns.mdreferences/checklist.mdreferences/security.mdreferences/patterns.md