Boy, I sure wish I had the opportunity to review codebases before inheriting them for maintenance...
I get your point but this is neither a Rails, nor an AI problem and as old as time.