I would like to know on a line by line basis, what percentage of source code within a subversion repository has been modified between two commits.
For example. say revision 2100 has 150,000 lines of code -- but revision 2600 has 165,000 lines of code where 8,000 lines of the original 150,000 code where modified. I would report this as 142,000 / 165,000 = 86% the same, 14% "new". I don't care to separate Javadoc, XML, comments, or unit tests....just lump them all together as "source".
Any idea how to do this?
I just did this today using the free open-source tool CLOC. It allows you to compare two directories recursively, so all you need to do is have both versions checked out and run the program on it.
It also gives summaries for separate languages and total, for example:
Language files blank comment code
--------------------------------------------------------------------------------
SUM:
same 1556 0 76662 165546
modified 137 0 159 570
added 2 241 257 1250
removed 30 591 906 2271
As you can see from the 'blank' statistic there, it's not perfect, but it definitely gives you a ballpark.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With