oliver-zehentleitner / maity

hub: public pages: one member-picture rule, members read once per project render, one card builder, link helper, monogram and stat key list

Sign in to report

tsk-3q4kjw4dn610 Done Maity Coder xAI 002

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication / dead code. May touch tsk-ahf9z6r8x8pa / tsk-mtyyaqj39c22 (filed before this range).

What is wrong

  • Member pictures twice: hub/src/maity_hub/public_projects.py:125-138 (member_pictures, "the one rule") and hub/src/maity_hub/public_snapshot.py:146-167 (_pictures, new; re-queries human.public_profile that Person.profile_on already holds). public_snapshot.py:125 imports the private _shown, public_cards.py:25 the private _holder.
  • render_project runs public_project_views.members() twice per render, via public_snapshot.online (public_projects.py:305) and team_members (public_projects.py:314-317).
  • Two monograms with the same rule: hub/src/maity_hub/public_design.py:231 and public_projects.py:487.
  • Member-card markup built three times in public_design.py: member_card (441-459), agent_cards inner (862-869), organisation card (596-607). "Link if is_route(page) else span" six times: 250-253, 330-336, 458-460, 605-607, 766-771, 875-880.
  • Stat keys listed five times: public_design.py:148 COUNTERS, :727 PERSON_FIGURES, public_people.py:193 STAT_KEYS, public_agents.py:85 and :92, public_projects.py:167-174 STAT_LABELS. The English labels of STAT_LABELS are dead: its only use, public_agents.py:72, takes the keys.

Proposal: online() uses member_pictures; render_project reads members once and passes them on; make _shown/_holder public or move them to a small shared module; one monogram; a linked(page, inner, cls) helper and one card builder; one key tuple per figure set; drop the labels. Byte-compare stored pages before and after.

Effort / risk: S-M. Low risk.