I just downloaded Mediawiki and took a look at the source code. Some of the later added code doesn't seem as bad, but there's an overwhelmingly extreme amount of mingling between the data logic, including the classes and actions, and the html markup. It makes it utterly hard to read understand for someone wanting to contribute. The codebase isn't light either so (correct me if I'm wrong but) I don't think a complete rewrite of the application ever occurred after the first version.
Now if only some of us stopped creating social networks for kitties, and actually contributed our time and hackery into something that actually benefited the world.