Repository Validation Report Generator¶
osa_tool.operations.analysis.repository_validation.report_generator
¶
ReportGenerator
¶
Generates a PDF validation report for a repository.
This class builds a PDF report summarizing repository analysis results, including correspondence, percentage metrics, and conclusions. It adds branding, QR codes, and repository metadata to the report.
__build_brief(experiments)
staticmethod
¶
Builds the first section of the report with correspondence and percentage metrics.
Returns:
| Type | Description |
|---|---|
tuple
|
tuple[Paragraph]: Paragraph elements for the section. |
__build_conclusion(conclusion)
staticmethod
¶
Builds the conclusion section of the report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conclusion
|
str
|
Conclusion text for the report. |
required |
Returns:
| Type | Description |
|---|---|
tuple
|
list[Flowable]: Flowable elements for the section. |
__build_header(type_)
¶
Generates the header section for the repository analysis report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type_
|
str
|
Type of validation (e.g., "Code", "Doc", "Paper"). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
tuple
|
A list of Paragraph elements representing the header content. |
__draw_images(canvas_obj, doc)
¶
Draws branding images, QR code, and lines on the first page of the PDF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
canvas_obj
|
Canvas
|
The canvas object for drawing. |
required |
doc
|
SimpleDocTemplate
|
The PDF document template. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
__generate_qr_code()
¶
Generates a QR code for the given URL and saves it as an image file.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The file path of the generated QR code image. |
__init__(config_manager, metadata)
¶
Initialize the ReportGenerator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_manager
|
ConfigManager
|
A unified configuration manager that provides task-specific LLM settings, repository information, and workflow preferences. |
required |
metadata
|
RepositoryMetadata
|
Metadata about the repository. |
required |
build_pdf(type_, experiments)
¶
Build and save the PDF validation report.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type_
|
str
|
Type of validation (e.g., "Code", "Doc", "Paper"). |
required |
experiments
|
tuple[Experiment]
|
JSON containing report data. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |