github / github/codeql

Control Flow Analysis Visualization: Result generated by CodeQL can not understand well by human

未關閉
#16,920 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

**CFA(Control Flow Analysis)**
I used the following simple QL statement:
```
/**
* @name Control Flow Graph Visualization
* @description This query identifies control flow nodes within a function and visualizes the control flow graph, helping to understand the flow of execution.
* @kind graph
* @id cpp/control-flow-graph-visualization
* @problem.severity recommendation
* @tags control-flow analysis
* @precision high
* @security-severity 0.0
*/

import cpp
import semmle.code.cpp.controlflow.internal.CFG

from Function f, ControlFlowNode start, ControlFlowNode end, Stmt s1, Stmt s2
where
start.getControlFlowScope() = f and
end.getControlFlowScope() = f and
start.getASuccessor() = end and
f.getFile().getBaseName() = "ip_output.c" and
f.getName() = "__ip_append_data"
select
start,
end,
"This is a control flow from " + start.getEnclosingStmt().toString() + " to " + end.getEnclosingStmt().toString() + " in function " +

f.getQualifiedName()
```

Although I output the control flow of a specific function in formats such as SARIF, DOT, and DGML, the results are not easily understandable by humans. I want to ask if CodeQL provides any other methods for visualizing control flow that can be easily understood by both humans and, if possible, LLMs (large language models).

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。