A commit-level risk scoring and visualization framework for C/C++ projects. Predicts bug introduction risk from code changes using static analysis.
- Call Graph — LLVM-based static call graph (single file + multi-file project)
- Differential CFG — Side-by-side control flow graph comparison
- Risk Heatmap — Line-by-line risk visualization of code changes
- Risk Score — Quantified risk using 3 established metrics
- Actionable Insights — Auto-generated review checklist
- Ubuntu 20.04+
- Python 3.8+
- LLVM/Clang 13+
- Graphviz
1. Clone the repo
git clone https://github.com/EmonRezaBD/commitFuzz.git
cd commitFuzz2. Install system dependencies
sudo apt update
sudo apt install -y clang llvm graphviz python3-dev python3-venv \
libgraphviz-dev cmake3. Build the LLVM CallGraph pass
cd CallGraph
mkdir build && cd build
cmake ..
make
cd ../..
chmod +x CallGraph/run.sh CallGraph/run_multifile.sh4. Set up Python environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install pygraphvizRun the dashboard
source venv/bin/activate
streamlit run src/dashboard.pyOpens at http://localhost:8501
Sample files are included in data/ — enable "Use sample files" checkbox to test instantly.
For multi-file C/C++ projects, CommitFuzz captures cross-file function calls using LLVM whole-program analysis.
Pipeline:
Project folder
│
▼
clang -emit-llvm (per file)
│
▼
.bc files (LLVM IR)
│
▼
llvm-link → merged.bc
│
▼
opt -load libCallGraph.so
│
▼
graph.dot + graph.text
│
▼
c++filt (demangle) + dot -Tpng
│
▼
callgraph.png
Steps:
- Each
.cpp/.cfile in the folder is compiled to LLVM IR (.bc) - All
.bcfiles merged into one whole-program IR viallvm-link - CallGraph LLVM pass extracts cross-file call relationships
- C++ mangled names are demangled with
c++filt - Graphviz renders the final PNG
Try the demo:
./CallGraph/run_multifile.sh data/demo_multifileOr enter the path data/demo_multifile in the Call Graph tab → Section 3.
Production projects with complex build systems (e.g. FFmpeg, OpenCV) require
compile_commands.jsonintegration via Bear — a known prerequisite for all LLVM-based static analyzers including Clang-Tidy.
- McCabe (1976) — Cyclomatic Complexity
- Nagappan & Ball (2005) — Code Churn & Defect Density
- Moser et al. (2008) — Change Metrics for Defect Prediction
- LLVM CallGraph pass: bernardnongpoh/CallGraph