I’ve just been digging through query.php trying to fix a WordPress problem.
And the code I see is staggeringly bad. Yet this is core code.
e.g. take a look at `get_posts()`, pages upon pages of `if` statements. Utterly unreadable and there is no way to figure out how a change might cascade down the code.
I ran the code through a debugger. After staggering through the hundreds of lines of `if` statements I found WordPress was calling the function a 2nd time. So, not only is it incredibly long and incomprehensible. It gets called multiple times.