8.6.7. Generating Reports¶
The analysis results can be inspected in a browser or IDE plugin directed to the Dashboard server. For defined versions of the project under analysis, it is also possible to generate a report document. Example use cases include:
Daily/weekly/monthly reporting of key metrics to management
Documentation of analysis results as part of the release process or for external assessment
Report documents can be generated by customizable Python modules. Example report modules are provided in the Axivion Installation folder <Installdir>/example/reports. Custom report modules can be developed using the Dashboard API to query the analysis data. All Python features can be used to generate the report document. Please refer to the Section Report Scripting Framework on how to implement custom report modules.
Note
Specific Python packages like openpyxl or reportlab may be required to run a report module. These packages can often be installed via the command: pip install openpyxl reportlab
Report Modules can be executed interactively by the tool report_runner. This is useful for one-time use, evaluation and during development of custom report modules. For frequent use, the modules can be installed into the Dashboard server to allow Dashboard users to generate reports from the dashboard page.
8.6.7.1. Quick Evaluation¶
If you have access to a database file <path_to_db> for your project, you can use the following command line to generate a report (e.g. using the report module <Installdir>/example/reports/report_misra_pdf.py):
report_runner create_report --database <path_to_db> <Installdir>/example/reports/report_misra_pdf.py
For projects using the option database_mode set to managed_upload to upload analysis results directly to the Dashboard server, you may not have the database file ready. In this case you should use report_runner’s option --dashboard <url> to connect to the running Dashboard server instead.
Each of the report modules defines a set of options. Values for those can also be passed on a report_runner command line. The list of available options can be inspected with the following command:
report_runner options <Installdir>/example/reports/report_misra_pdf.py
For all options and a more detailed discussion of the report_runner tool, please refer to Section Report Runner.
8.6.7.2. Use from the Dashboard¶
If a reporting module should be available to a larger audience, or just be used frequently, it is recommended to make it accessible from the Project Overview page on the Dashboard. See Section Creating Custom Reports for details.