(
connection: sqlite3.Connection, scan_id: str, *, offset: int, limit: int
)
| 3156 | |
| 3157 | |
| 3158 | def finding_occurrence_rows( |
| 3159 | connection: sqlite3.Connection, scan_id: str, *, offset: int, limit: int |
| 3160 | ) -> list[sqlite3.Row]: |
| 3161 | return connection.execute( |
| 3162 | """ |
| 3163 | SELECT id, finding_id, title, summary, severity, confidence, remediation, details_json, created_at |
| 3164 | FROM finding_occurrences |
| 3165 | WHERE scan_id = ? |
| 3166 | ORDER BY |
| 3167 | CASE severity |
| 3168 | WHEN 'critical' THEN 0 |
| 3169 | WHEN 'high' THEN 1 |
| 3170 | WHEN 'medium' THEN 2 |
| 3171 | WHEN 'low' THEN 3 |
| 3172 | WHEN 'informational' THEN 4 |
| 3173 | ELSE 5 |
| 3174 | END, |
| 3175 | created_at, |
| 3176 | id |
| 3177 | LIMIT ? OFFSET ? |
| 3178 | """, |
| 3179 | (scan_id, limit, offset), |
| 3180 | ).fetchall() |
| 3181 | |
| 3182 | |
| 3183 | def backfill_legacy_finding_details(connection: sqlite3.Connection, scan: sqlite3.Row) -> None: |
no outgoing calls
no test coverage detected