Poorly written code is not "bad" code
Code is code. Poorly written code is hard to debug, difficult to maintain, and easy to break, but it's not necessarily "bad" - as long as it meets specification and testing parameters.
By bringing it forward, you are actually adding to someone's workload, and in most cases they will never have to touch 90% of your poor code.
Code quality is very subjective
In most cases, in fact, you'll find that others who review your code think your good code is bad, and some of your bad code is good.
It's really, unfortunately, very subjective.
Don't give others red herrings
Don't spend your remaining time sighing wistfully about your poorer efforts there, and saddling others with worries that your code might break - they will spend hours chasing down the bugs in the wrong spots if you give them too much rope. In other words, if you give them cause to believe your code is wrong, they may skip obvious debugging steps and go right into the code when all that was wrong was a simple issue much earlier in the chain.
Complete, meaningful Documentation is far more valuable to pass along
Spend your remaining time putting meaningful comments in the more difficult to understand portions of code, putting proper headers in the files and functions, and handing off tasks that you never got to. Especially comment on design decisions, "Coded for performance, not error handling - breaks if input greater than x..."
A lot of what's lost when a person leaves are the decisions and reasoning that went into a particular implementation. When someone sees your code, they might go, "That's silly, I'm going to refactor that to follow Best Practices" only to find hours later that it was coded that way for a reason. These decisions are, ideally, in the design document, but if not put them somewhere.
If some of the code is bad or wrong, not just poorly written, then flag it
If you believe a section of code to be dangerous, or known to be broken, fix it, or pass that information along, but don't go around pointing out all the "if I had to do it over, I'd have done it differently" issues. It's a waste of time, and possibly more dangerous than helpful.