I have a couple of "nightmares" that although I'd never put them on the top of this list, they have definitely caused some struggle.
The mega object/page/function: (The so called "God Object" anti-pattern): Putting everything in one object's method (mostly Java world), page (mostly php and asp), method (mostly VB6).
I had to maintain code from a programmer who had in one php script: html code, business logic, calls to mysql all messed up. Something like:
foeach( item in sql_query("Select * from Items")) { <a href="/go/to/item['id']">item['name']</a> } Relying on obscure features of the language that might not be well known or are about to become obsolete.
It had happened again with php and preset variables. Short story: for some settings of php v4 a request parameter was auto assigned to a variable. so http://mysite.com?id=44http://mysite.com?id=42 would "magically" generate varaible $id with value '42'.
This was a maintenance nightmare not only because you could not possibly know where data came from but also because php v5 completly removed it (+1), so people trained after that version, would not even understand what was going on and why.