That's a good point. It's actually hard for me to recognise when it is bad code and when I am just feeling NIH syndrome.
The important thing to realize is that it's all bad code.
Our job as engineers is to prevent those criminal routines from murdering one another by carefully confining them into their prison modules and never letting them get too rowdy.
I am the Code Warden, and within these bytes my word is law!
On the other hand, if you're saying to yourself "This code really sucks, they wrote their own complex CSV parser, I can rewrite this to use the CSV library in the standard lib" and things like that, no matter how big the task may seem, it'll work out in the end.