The Magic Servlet pattern in action: a 4000+ line function implemented in a jsp file; took a while to refactor that dumpster fire. I have never put much stock in 'licensing' for software developers but the aforesaid monstrosity really made me consider whether I should rethink my position.
I once encountered a 2K+ line script handling submissions from something like a contact form.
If a client submitted a value for which the key didn't exist in the database table, it wasn't ignored - the application would alter the table to add that row to the database so it could insert it.
Found an "if (true or false) { ... }" in a PHP project my team is maintaining. It was from before we took over the project so we don't know where it comes from.
Problem solved!