Well, the most recent New Yorker had an article in which they described how more complex humor (defined as humour that affected the most parts of the brain at once or in sequence and required the most "stages" to get, ie realizing incongruity, left-brain word puns, right-brain emotional puns, etc.) tended to include potty or sexual elements.