Now maybe this is an ignorant question from someone (me) who hasn't played the sport, but is "code" then referring to the actions players feel they need to take due to historically ineffective officiating? Because there are goaltender interference, instigator, and various other rules for the things you listed.
I always thought they mean like a "code of honour" thing among players.
Either way, what Greig did isn't an excuse for Rielly's action. I'm just not sure what people mean when they say "code".