It likely depends. The point of laws like this is that they don't want people to exchange favours as a means to avoid paying taxes. When you help a friend paint his house you usually expect that he returns the favor and that's not allowed. If there's no expectation to return the favor it's fine. Anyway, these things are hard to prove.
It's important for a mutual friendship though. If you're there for your friends when you need them, you kind of expect for them to return the favor. Friendships are usually not one-sided, that particular "honor" is more common in family relationships.