1 Star 0 Fork 0

any3ite/codeql

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ContextEfficiency.ql 816 Bytes
一键复制 编辑 原始数据 按行查看 历史
Taus 提交于 2025-10-31 07:06 +08:00 . Python: Fix query tests
/**
* Compute the total points-to facts, the total size of the points-to relation and
* the ratio of the two in relation to the depth of context.
*/
import python
private import LegacyPointsTo
from int total_facts, int total_size, int depth, float efficiency
where
total_facts =
strictcount(ControlFlowNode f, Object value, ClassObject cls |
exists(PointsToContext ctx |
PointsTo::points_to(f, ctx, value, cls, _) and
depth = ctx.getDepth()
)
) and
total_size =
strictcount(ControlFlowNode f, Object value, ClassObject cls, PointsToContext ctx,
ControlFlowNode orig |
PointsTo::points_to(f, ctx, value, cls, orig) and
depth = ctx.getDepth()
) and
efficiency = 100.0 * total_facts / total_size
select depth, total_facts, total_size, efficiency
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/any3ite/codeql.git
git@gitee.com:any3ite/codeql.git
any3ite
codeql
codeql
main

搜索帮助