I always took code to be unwritten rules around dangerous acts that aren't properly written in the rulebook.
Like there's no rule for extra punishment for a player fighting a goalie, but generally will be considered against the code because a goalie is more likely to get injured (unless you're emery of course)
I never see code for things that don't harm anyone like empty net goals or celebrations. There have always been crazy celebrations like Brad may or theoren Fleury, or Ovechkin, etc.
Things that don't harm anyone have nothing to do with code and everything to do with egos getting hurt.