检查器 Playground

设计、测试并验证你的静态分析规则。

精选了十条经典规则,为其生成了代码检查器,选择规则可快速浏览生成结果。

选择一个预置案例来预览其规则定义和测试集。

规则定义

清晰描述规则,并提供具有代表性的合规与不合规测试用例。

使用简洁明确的名称标记规则。

说明应检测的问题。

合规

10

安全代码,不应触发检查器。

dependent_call_in_expr_case_11.cpp 合规 长度:235
dependent_call_in_expr_case_12.cpp 合规 长度:313
dependent_call_in_expr_case_13.cpp 合规 长度:286
dependent_call_in_expr_case_14.cpp 合规 长度:263
dependent_call_in_expr_case_15.cpp 合规 长度:320
dependent_call_in_expr_case_16.cpp 合规 长度:158
dependent_call_in_expr_case_17.cpp 合规 长度:196
dependent_call_in_expr_case_18.cpp 合规 长度:360
dependent_call_in_expr_case_19.cpp 合规 长度:509
dependent_call_in_expr_case_20.cpp 合规 长度:419

不合规

10

危险代码,应被检查器识别出来。

dependent_call_in_expr_case_1.cpp 不合规 长度:341
dependent_call_in_expr_case_2.cpp 不合规 长度:326
dependent_call_in_expr_case_3.cpp 不合规 长度:469
dependent_call_in_expr_case_4.cpp 不合规 长度:394
dependent_call_in_expr_case_5.cpp 不合规 长度:325
dependent_call_in_expr_case_6.cpp 不合规 长度:285
dependent_call_in_expr_case_7.cpp 不合规 长度:391
dependent_call_in_expr_case_8.cpp 不合规 长度:403
dependent_call_in_expr_case_9.cpp 不合规 长度:314
dependent_call_in_expr_case_10.cpp 不合规 长度:316
enzh