This is a very bad practice, but need some reference material here. Does anyone have any code reference as to why you should not use spray foam insulation inside boxes to seal them? I've been discussing this with a DIYer and he seems to think it's a best practice to fill up most of the box with foam after he has all of his wire run.