assets_guardian.core.domain.models.report

Classes

Report([findings])

Container for audit findings, allowing tracking of metrics.

class assets_guardian.core.domain.models.report.Report(findings: Iterable[Finding] | None = None)[source]

Bases: object

Container for audit findings, allowing tracking of metrics.

Can operate either in β€œmemory” mode (classic list) or in β€œstreaming” mode (external iterable such as a cache) to prevent RAM saturation.

Initializes the report, possibly in streaming mode.

Parameters:

findings – An optional iterable of findings (e.g., from cache). If present, the report switches to streaming mode.

add_finding(finding: Finding) None[source]

Adds a finding to the report and updates severity counters.

Parameters:

finding – The detected anomaly to integrate.

extend(findings: Iterable[Finding]) None[source]

Adds multiple findings to the report in bulk.

Parameters:

findings – An iterable of findings to process.

get_count_by_severity(severity: SeverityType) int[source]

Returns the count of findings for a given severity.

property total_count: int

Total count of detected findings.