← Market Analyst · c8
code-readability-todo.md
TODO — Code Readability
Contents
Create a shared format utility
formatLabel()andformatDate()are duplicated acrossindex.vue,[calls]/index.vue, and[name].vue- Extract to
site/utils/format.ts(or a composable) and import from one place - Same for
formatTime()duplicated betweenavoma.tsandavoma-notes.ts
Add "why" comments to pipeline business logic
avoma.tsfiltering loops (isExternalProspectCall) — explain the business reason for each exclusion patternextract.tsextractCall()— document data priority decisions and the JSON regex patternbatch.ts— document the skip/force logic intent
Break up large functions
extract.ts:extractCall()is 162 lines covering load, fetch, parse, validate, and write — split into focused helpersavoma.ts:fetchNewCalls()is 145 lines — extract the filtering logic into named helper functions
Document magic values
avoma.ts:meeting.duration < 300— comment that 300 = 5-minute minimum thresholdInterestDots.vue:levelColorsarray — explain the color mapping strategy and why indices 0 and 1 are identicalindex.vue:.slice(0, 20)— why 20?
Standardize error handling
- Some catches log warnings, others are silent (
} catch { /* skip bad metadata */ }) - Use consistent logging so errors are surfaced during debugging