A Qt-oriented static code analyzer based on Clang that provides over 50 Qt-specific compiler warnings and automatic fix-its.
Clazy is a static code analyzer built as a Clang compiler plugin specifically for Qt-based C++ projects. It detects over 50 types of Qt-related issues, such as unnecessary memory allocations, API misuse, and suboptimal patterns, offering automatic fixes for many problems. It integrates directly into the build process to provide real-time feedback during compilation.
C++ developers working with Qt frameworks who want to improve code quality, performance, and adherence to Qt best practices. It is particularly useful for large Qt codebases where manual review is impractical.
Developers choose Clazy because it provides Qt-aware static analysis that generic tools miss, with low false-positive rates and actionable fix-its. It seamlessly integrates into existing Clang/CMake/qmake workflows and offers fine-grained control over which checks to enable.
Qt-oriented static code analyzer based on the Clang framework
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides over 50 Qt-specific checks, such as detecting unnecessary QString allocations and misused signal-slot connections, which generic tools like clang-tidy miss, as listed in the README.
Many checks include automatic code refactoring capabilities, like fixing old-style connect syntax or adding missing QStringRef, directly from compiler warnings without manual intervention.
Checks are organized into levels 0-2 and manual, allowing granular control to start with safe checks and gradually enable more aggressive ones, reducing false positives.
Can run over JSON compilation databases without building the project via clazy-standalone, enabling integration into CI pipelines or pre-commit hooks for static analysis only.
Requires building and installing Clang from source on many platforms, with lengthy, platform-specific instructions in the README that are error-prone and time-consuming.
Tied exclusively to the Clang compiler ecosystem; projects using GCC or other compilers cannot integrate Clazy without switching toolchains, limiting flexibility.
Disables optimizations like pre-compiled headers and ccache, as noted in the troubleshooting section, which can significantly slow down compilation times in large projects.
Officially tested only on Linux, macOS, and Windows; other platforms are unsupported and rely on community patches, as stated in the README.