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.
|
||
|---|---|---|
| .. | ||
| CalibreGoogleTagDedupTest.java | ||
| CalibreSeriesIndexTest.java | ||
| test_calibre_0003.py | ||
| test_calibre_0004.py | ||