The Talmud (Bavli, B'rachos 18 amud 1) mentions a prohibition on wearing tzitzis or t'filin, or reading from a Torah scroll, in a cemetery, based on "one who taunts the pauper, that makes him a blasphemer" (Proverbs 17:5).
Based on this, the Shulchan Aruch forbids the following in a cemetery near a grave: wearing tzitzis exposed to view (OC 23, YD 367:4), wearing t'filin exposed to view (OC 45:1, YD 367:2), saying "Sh'ma" (OC 71:7, per Mishna B'rura :15), holding a Torah scroll (YD 282:4, per Shach :6), reciting from the Torah except in honor of the deceased (YD 367:3, Kaf Hachayim OC 23:1), and praying (YD 367:3) even kadish (Shach :3). (As always, consult your rabbi for practical guidance.)
Seemingly, the pauper-taunting is the fulfilling of a mitzva (command), alluding to the fact that he can still do so and the deceased cannot. This logic apparently does not apply to mitzvot done for the benefit of the deceased. For example, burying the body and attendin the funeral are themsleves mitzvot, which are obviously permitted. But the same logic could apply to far more mitzvot than the number listed by the poskim relating to Torah, prayer, tzitzit and tefilin.
Is there a prohibition, then, on fulfilling other commands also, when apparent to onlookers, except in honor of the deceased? For example, if my father and I are near a grave and he asks me for his sweater that I'm holding, so that he may wear it, am I not allowed to pass it to him, because that would be obviously fulfilling the mitzva of honoring my father? If someone begs for charity near a grave, am I not allowed to give? If there's a fall hazard near a grave, am I forbidden from putting a railing up?) If (as I suspect) fulfilling all mitzvos is not prohibited, then why not? What's special about tzitzis, t'filin, reciting Torah and prayers, and holding a Torah scroll? And if fulfilling all mitzvos is in fact prohibited (at least when apparent to onlookers), why doesn't Shulchan Aruch say so as a blanket rule?