There's nothing wrong with the nethack source code! (As long as you consider that e.g. modifying string constants is "not wrong"...)
The nethack source is very like nethack itself: an intricate and wonderful maze filled with treasure and surprises and hidden secrets and traps and terrifying monsters of every kind. I actually prefer reading the nethack source to playing nethack. (But perhaps I am strange.)