Monday, June 13, 2011

Resurrecting the dead: Delphi source analysis tool

Hello to all Delphi fans!

It's been some time since I worked with Delphi (2,5 years to be exact) and I've missed the old days quite a bit. Everything was so simple those days: there was one unit testing framework that nobody used, there were no source code quality checking tools like Sonar in Java or stylecop/fxcop in .NET and everything was up to you as a developer to do a good job. Man that was really something!

Anyways... Back in the days I wrote a tool to check for the complexity of Delphi source code. And I've had a reason for it, namely I worked on a project that (even for Delphi standards) seemed to be way above the complexity human beings can understand. For the sake of understanding what kind of beast I'm trying to actually tackle with it I've decided to write a small application that'd measure a couple of things.

First of all here are the sources, open and for your entertainment :)

http://github.com/padcom/delcos

What it does?

1. Dump debug source tree
2. Dump uses tree
3. Dump advanced uses tree
4. Dump Cyclomatic Complexity of methods - my favorite! :D

So just to let you know we human beings do understand right away methods with CCC around 5-6, some brainiacs do even 10!

And here's the bummer: the project that I've had this bad feeling about had the top CCC of one method around 2000 :) Man that was something!

Some day I'll get back to those glorious days,... someday...

No comments: