As I remember it, attending Mass isn't the problem, it's whether or not you take Communion in a state of sin that's the issue. As for Confession, what happens in the Confessional is between you, your confessor and God. Ideally to take Communion one should be clear of conscience and without sin. There is another point about taking Communion and Confession but I can't remember it clearly, so I shall have to consult someone more devout then myself on that point.