An automated static analysis and detailed report generation system for C++ projects, powered by PVS-Studio.
- Environment Management: Automatically sets up the necessary directories (
credentials,source,report). - Source Fetching: Downloads code from a remote repository into the
sourcedirectory. - Build System: Integrates with CMake, automatically applying selected compilers and flags from the config file.
- Static Analysis: Runs
pvs-studio-analyzerin multi-threaded mode (-j). - Report Generation: Creates an interactive HTML report with a timestamp in the filename.
- Post-processing (Python): Analyzes and modifies the HTML report to ensure correct data display.
- Configure the settings by following the example in
config.md. - Run the main script:
./make_pvs_report.sh
1. Create a copy of config.md in the root directory and rename it to config
2. Open the config file and fill in your local settings:
2.1. build_from_new_sources: Set boolean (true/false) to either fetch new sources or use existing ones
2.2. git_user & git_password: Your Git credentials
2.3. git_host: The hostname of your repository (e.g., github.com)
2.4. git_souce: Full remote repository path with .git without git_host and the slash
2.5. git_target_branch: The specific branch to be scanned
2.6. git_submodules: Set boolean (true/false) to enable or disable Git submodules fetching
2.7. project_folder: Path to the specific project directory
2.8. build_folder: Path to the project build directory
2.9. subfolders_to_analyze: Subdirectories within the project folder to be scanned (if multiple — space-separated in quotes). Default is "./"
2.10. cxx_compiler_path: Path to the C++ compiler
2.11. c_compiler_path: Path to the C compiler
2.12. python_interpreter: Name of the Python interpreter
2.13. number_of_parallel_workers: Number of parallel threads for execution
2.14. warning_levels: Comma-separated warning levels (1, 2, 3), where 1 is High, 2 is Medium, 3 is Low
2.15. pre_analysis_event: Command to execute before scanning (e.g., to copy a directory into the project directory "cp -r ../libs ./libs")
3. Run the make_pvs_report.sh script from the console
1. credentials - Directory for storing Git credentials
2. license - PVS-Studio license file
2. report - Directory for complete reports, named like pvs_report_year.month.day.hour.minute.second.fullhtml
3. source - Directory for downloading source code and performing all related operations
4. tools - Directory for auxiliary utilities
5. config.md - Template file for creating the configuration file
6. The main execution script - make_pvs_report.sh - run it from the console within the current directory as follows: ./make_pvs_report.sh
7. README.md - README in English
7. README.ru.md - README in Russian
8. LICENSE - Warning Scan Machine license file