Skip to content

StanSparrow/warning_scan_machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Warning Scan Machine

An automated static analysis and detailed report generation system for C++ projects, powered by PVS-Studio.

🛠 Key Features:

  1. Environment Management: Automatically sets up the necessary directories (credentials, source, report).
  2. Source Fetching: Downloads code from a remote repository into the source directory.
  3. Build System: Integrates with CMake, automatically applying selected compilers and flags from the config file.
  4. Static Analysis: Runs pvs-studio-analyzer in multi-threaded mode (-j).
  5. Report Generation: Creates an interactive HTML report with a timestamp in the filename.
  6. Post-processing (Python): Analyzes and modifies the HTML report to ensure correct data display.

🚀 How to Run:

  1. Configure the settings by following the example in config.md.
  2. Run the main script:
    ./make_pvs_report.sh
    

Configuration Setup

    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

Project Structure

    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

This tool automates PVS-Studio analysis. Users are responsible for complying with the PVS-Studio license agreement. The 'free' mode is intended for non-commercial/open-source projects according to PVS-Studio terms

About

Automation tool for PVS-Studio static analysis with HTML reporting

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors