job51-gitlab-cr-node-jt-1 2.2.2 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# 代码审查规则
|
|
2
2
|
|
|
3
|
+
**⚠️ 最高优先级强制规则(违反将导致严重误报)**:
|
|
4
|
+
> - **报告运行时异常风险前,必须先用 Read 工具追踪读取相关方法/函数的实现代码**
|
|
5
|
+
> - 适用场景:空指针/空引用异常、类型转换异常、集合越界等所有运行时异常
|
|
6
|
+
> - 示例:看到 `obj = service.getData(id); obj.getProperty()` 时,**必须先读取** `service.getData` 方法的源码,确认其返回值是否可能为 null
|
|
7
|
+
> - 如果方法/函数内部已有防护措施(如返回默认对象、空对象模式、边界检查等),则**禁止报告**该问题
|
|
8
|
+
> - **禁止仅凭代码表面形式判断运行时异常风险**
|
|
9
|
+
|
|
3
10
|
0. **Diff 数据结构与上下文读取规则**:
|
|
4
11
|
> - **临时文件格式说明**:
|
|
5
12
|
> - 文件分为两部分:`=== File Information ===` 和 `=== Diff Content ===`
|