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
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") andhub/src/maity_hub/public_snapshot.py:146-167(_pictures, new; re-querieshuman.public_profilethatPerson.profile_onalready holds).public_snapshot.py:125imports the private_shown,public_cards.py:25the private_holder. render_projectrunspublic_project_views.members()twice per render, viapublic_snapshot.online(public_projects.py:305) andteam_members(public_projects.py:314-317).- Two
monograms with the same rule:hub/src/maity_hub/public_design.py:231andpublic_projects.py:487. - Member-card markup built three times in
public_design.py:member_card(441-459),agent_cardsinner (862-869), organisation card (596-607). "Link ifis_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:148COUNTERS,:727PERSON_FIGURES,public_people.py:193STAT_KEYS,public_agents.py:85and:92,public_projects.py:167-174STAT_LABELS. The English labels ofSTAT_LABELSare 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.