Saturday 5 February 2011

Crappy code

I spend way too much time dealing with other peoples' crappy code. To that end, a very long time ago, I wrote a quick script that would help me navigate around a PHP source file in order to work out what it's supposed to, and what it actually does.

It generates a call graph of the functions and methods in a PHP file, example shown below.



It had been sitting, festering on my HD for a while, and I thought "Hey, maybe someone else might find this helpful" so I uploaded it to phpclasses.org

So blow me, not only do they find it useful - but they want me to support the damn thing too! And then I get nominated for an award! I had a quick look at the source code. OMG - it's a mess!

So a couple of late nights were spent cleaning it up until the API is at least usable.

You can get the (cleaned up, slightly) source code here