java-topology/defects/calibre/test
russell@unturf.com fac760d8f1 calibre: 5-MOAD scan; calibre-0003 CWE-407 depth_first O(L*F) 38x, calibre-0004 CWE-407 find_links O(L^2) 124x
MOAD-0001 CWE-407 — 2 new defects:
- calibre-0003: depth_first() in src/calibre/ebooks/html/input.py calls flat.index(link)
  inside a while loop over all ebook links. O(L * F) where L = links, F = flat list size.
  Fix: pre-build flat_map = {hf: hf for hf in flat} before loop, O(1) lookup.
  Measured: 38x at F=500 files (linear chain), 13.5x at F=200.
- calibre-0004: HTMLFile.find_links() uses list membership for dedup: `if link not in
  self.links`. O(L^2) per HTML chapter file. Fix: parallel _links_seen set.
  Measured: 124x at L=1000 unique links, 68x at L=500.

MOAD-0002/0003/0004/0005 — CLEAN. See TICKET.md for full analysis.
2026-04-03 13:49:57 -04:00
..
CalibreGoogleTagDedupTest.java undf: assign 847-849; stamp freecad/retroarch patches 2026-03-30 14:53:28 -04:00
CalibreSeriesIndexTest.java undf: assign 847-849; stamp freecad/retroarch patches 2026-03-30 14:53:28 -04:00
test_calibre_0003.py calibre: 5-MOAD scan; calibre-0003 CWE-407 depth_first O(L*F) 38x, calibre-0004 CWE-407 find_links O(L^2) 124x 2026-04-03 13:49:57 -04:00
test_calibre_0004.py calibre: 5-MOAD scan; calibre-0003 CWE-407 depth_first O(L*F) 38x, calibre-0004 CWE-407 find_links O(L^2) 124x 2026-04-03 13:49:57 -04:00