MCPcopy Index your code
hub / github.com/openai/plugins / list_findings

Function list_findings

plugins/codex-security/scripts/workbench_db.py:3029–3047  ·  view source on GitHub ↗
(connection: sqlite3.Connection, args: argparse.Namespace)

Source from the content-addressed store, hash-verified

3027
3028
3029def list_findings(connection: sqlite3.Connection, args: argparse.Namespace) -> dict[str, Any]:
3030 scan = require_scan(connection, args.scan_id)
3031 backfill_legacy_finding_details(connection, scan)
3032 limit = min(args.limit, FINDINGS_PAGE_MAX)
3033 rows = finding_occurrence_rows(connection, scan["id"], offset=args.offset, limit=limit)
3034 total = connection.execute(
3035 "SELECT COUNT(*) FROM finding_occurrences WHERE scan_id = ?", (scan["id"],)
3036 ).fetchone()[0]
3037 next_offset = args.offset + len(rows)
3038 return {
3039 "findingsPage": {
3040 "findings": [finding_result(connection, scan, row) for row in rows],
3041 "limit": limit,
3042 "nextOffset": next_offset if next_offset < total else None,
3043 "offset": args.offset,
3044 "scanId": scan["id"],
3045 "total": total,
3046 }
3047 }
3048
3049
3050def scan_result(

Callers 1

mainFunction · 0.85

Calls 4

require_scanFunction · 0.85
finding_occurrence_rowsFunction · 0.85
finding_resultFunction · 0.85

Tested by

no test coverage detected