← Market Analyst · c8

code-readability-todo.md

TODO — Code Readability

Create a shared format utility

  • formatLabel() and formatDate() are duplicated across index.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 between avoma.ts and avoma-notes.ts

Add "why" comments to pipeline business logic

  • avoma.ts filtering loops (isExternalProspectCall) — explain the business reason for each exclusion pattern
  • extract.ts extractCall() — document data priority decisions and the JSON regex pattern
  • batch.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 helpers
  • avoma.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 threshold
  • InterestDots.vue: levelColors array — explain the color mapping strategy and why indices 0 and 1 are identical
  • index.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

Qpoint Brand Style Guide