How kde/clazy works
clazy is a Clang plugin and standalone analyzer that adds Qt-aware diagnostics and automatic fix-its to C++ compilation. In the plugin workflow, a project is compiled through Clang with clazy loaded; checks are selected, inspect compiler information, and report warnings or fixes. The standalone entry point supports analysis using a JSON compilation database. The tree and excerpts support the major subsystems, but do not show all runtime call wiring, so uncertain connections are omitted.
Main entry points: checkbase.cpp Compiler diagnostics · checkmanager.cpp Check selection · level0 Level 0 checks · level1 Level 1 checks
Components 16
Analysis entry points
- Clang plugin
src/Clazy.cpp - Standalone analyzer
src/ClazyStandaloneMain.cpp
Analysis engine
- Check selection
src/checkmanager.cpp - Analysis context
src/ClazyContext.cpp - AST traversal
src/ClazyVisitHelper.cpp - Qt access metadata
src/AccessSpecifierManager.cpp - Warning suppression
src/SuppressionManager.cpp
Qt checks
- Level 0 checks
src/checks/level0 - Level 1 checks
src/checks/level1 - Level 2 checks
src/checks/level2 - Manual checks
src/checks/manuallevel
Diagnostics and fixes
- Compiler diagnostics
src/checkbase.cpp - Fix-it export
src/FixItExporter.cpp
Other components
- C++ project
- Clang compiler
- JSON compilation database
Connections 13
- C++ project → Clang compiler: compile with
- Clang compiler → Clang plugin: loads plugin
- C++ project → Standalone analyzer: analyze
- JSON compilation database → Standalone analyzer: provides commands
- Check selection → Level 0 checks: creates checks
- Check selection → Level 1 checks: creates checks
- Check selection → Level 2 checks: creates checks
- Check selection → Manual checks: creates checks
- Level 0 checks → Compiler diagnostics: reports findings
- Level 1 checks → Compiler diagnostics: reports findings
- Level 2 checks → Compiler diagnostics: reports findings
- Manual checks → Compiler diagnostics: reports findings
- Compiler diagnostics → Fix-it export: exports fixes