I have been tasked with figuring out how many lines of code I've written this year. Not very exciting for a number of reasons, but it seems like it could make a nice SO question.
So in your favorite version control tool, how do you tell how many lines of code have been modified? In my particular answer blank lines and comments happen to count to simplify the time allotted to determining the answer, but feel free to elaborate.
In my particular case I'm using svn, so I'm going to get rid of all the --- and other misc output that svn log and svn diff output.
Use StatSVN. I use it at work and it's great, it'll break down LOC by developer by month. It'll draw pretty graphs, tell you what day of the week and what time you check in the most code. It'll tell you exactly what you need to know.
The simplest solution:
svn diff -x --ignore-eol-style -x -w http://svn/tags/releases/1.0 http://svn/tags/releases/2.0/ |diffstat
this is very rudimentary and does not exclude blank line inserts and so on, but perhaps it's good enough?
Try to use Hits-of-Code metric (which does exactly what you're looking for). You can collect the data using this hoc
explained in this blog post: Hits-of-Code Instead of SLoC
Fisheye can tell you how many lines of code were committed per developer. There is a nice charting feature that can give you pretty graphs for this.
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