If only more engineers admitted, that something they wrote is not good code, but a product of its time, then I think we would get more realistic expectations.
It's OK to say that something you made is shit. It is OK to say that you were not given time to do xyz.
How you recognize something has been made fitting at least is, when you see it in use without much of a change for some 3 or 4 years and while you are the person maintaining it, you rarely ever need to touch it, because you built it in a way that is simple enough to not have tons of bugs yet flexible enough, to cover use-cases and anticipated use-cases.