Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How many lines of code modified during a time period?

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.

like image 858
Nathan Feger Avatar asked Oct 08 '09 14:10

Nathan Feger


4 Answers

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.

like image 106
Roland Rabien Avatar answered Nov 06 '22 15:11

Roland Rabien


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?

like image 45
Bartosz Radaczyński Avatar answered Nov 06 '22 13:11

Bartosz Radaczyński


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

like image 4
yegor256 Avatar answered Nov 06 '22 15:11

yegor256


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.

like image 3
Taylor Leese Avatar answered Nov 06 '22 14:11

Taylor Leese