Today I wrote a little program in Boo that can analyze the results of Subversion's "blame" command. "blame" goes through the whole history of the subversion repository and finds for each line of code the revision in which it was written.
I analyzed the trunk of our current repository for SharpDevelop 2.1. The repository was created on the 4th January of 2005 for SharpDevelop 2.0. Development on SharpDevelop 2.0 was already active before, but that old repository is not available anymore. That means I could not find out who wrote code older than 2005 - most of the code marked as "unknown old code" is probably from SharpDevelop 1.0, but all the changes done by Mike Krüger to make SharpDevelop run on .NET 2.0 using MSBuild for the project system are also "old code". Our parser library NRefactory was existant at that time, too.
My analyzer program gets the person who committed each line of code. Additionally, it searches log messages for the term "patch by" and uses that name instead. And I assigned some revisions manually, for example when I committed Peter Forstmeier's SharpReport. Moreover, I excluded the docking library and log4net (the source code for both is included in our repository).
Now here is the image with the results:
These results were pretty surprising for me. Considering that "unknown (old code)" already ran on .NET 2.0 and already had the improved AddIn system and build system in place (all those changes were done by Mike Krüger), pretty much all of SharpDevelop has been rewritten. The area with the highest percentage of old code is the text editor - 80 percent are unchanged. Most other parts are around 45% old code - the 33% average is caused by the new AddIns.
"unknown (merged code)" is code that has been committed to SharpDevelop 2.0 in the last time and then was merged back into trunk (SharpDevelop 2.1). Most of it seems to be David Srbecky's generated debugger interop code.
Finally, sometimes I committed patches and my own modifications in the same commit; everything was counted for the person providing the patch. For example, Christian Hornung owes me 170 lines on the AddIn manager.
So the whole thing isn't really accurate, but if you are interested in the source code, you can download it here:BlameAnalyzer.zip (1,1 MB) Caution: contains hard-coded absolute paths to a temp directory and the SD working copy