pygame: CLEAN — runtime uses dict/set throughout (O(1) membership) libgdx-0002: ModelBuilder.rebuildReferences Array.contains O(P*M) — patch libgdx-0005: Stage.touchDragged touchFocuses.contains O(F^2) — patch libgdx-0006: AfterAction.delegate currentActions.indexOf O(W*A) per frame — patch unit: extend LibGDXTest to 7 tests, all PASS (50x-1971x speedup measured)
917 B
917 B
pygame — CWE-407 Scan Result: CLEAN
Scanned: 2026-03-30
Scope: Python layer (src_py/), Cython layer (src_c/cython/), event C layer (src_c/event.c)
Findings
No CWE-407 defects found in the runtime Python/Cython/C layers.
Why pygame is clean
AbstractGroupusesdict(spritedict) for all sprite membership — O(1)inchecks.Sprite.__gis aset— O(1) group membership.- Event blocking (
set_blocked/get_blocked) uses SDL's nativeSDL_EventStatearray — O(1). LayeredUpdatesuses_spritelayersdict for layer lookups — O(1).sysfontmodule usesdictfor font registry — O(1).OrderedUpdates._spritelist.remove()is O(N) but is a single-shot operation, not nested.
The build infrastructure (buildconfig/) contains some list membership patterns but these
run once at build time, not in game loops, and are not relevant to runtime complexity.