14 messages in com.perforce.perforce-user[p4] lines of code counting tools
FromSent OnAttachments
Dave Lewis16 Aug 2004 15:02 
Vinny Murphy16 Aug 2004 15:18 
Dave Lewis16 Aug 2004 15:23 
David Surber16 Aug 2004 15:40 
David Surber16 Aug 2004 16:45 
Vinny Murphy16 Aug 2004 16:56 
David Surber16 Aug 2004 17:58 
Nick Barnes17 Aug 2004 01:34 
Richard Brooksby17 Aug 2004 07:26 
Janulewicz, Matthew17 Aug 2004 09:45 
Richard Brooksby17 Aug 2004 10:47 
Dave Lewis17 Aug 2004 10:50 
David Surber17 Aug 2004 11:03 
ste...@vance.com17 Aug 2004 12:37 
Subject:[p4] lines of code counting tools
From:Janulewicz, Matthew (mjan@alarismed.com)
Date:08/17/2004 09:45:57 AM
List:com.perforce.perforce-user

At the risk of coming off like a jerk (which I've done before, thanks) I was wondering, in a more philosophical sense, what this data would be used for, anyway? Is the number of lines of code changed really a good matrix for anything? I was asked to provide total lines of code counts, over time, for some projects once and the managers quickly realized that the data didn't really tell them anything. They eventually became more interested in the quality of the code (code reviews), how long it took to fix particular defects, whether or not code had to be re-written, etc.

That being said, a decent (I'm only halfway decent) shell scripter (unix or cygwin) could whip up a short script to parse 'p4 changes' into 'p4 describe', grep the pertinent results to a file, then use the built-in 'wc' command to count the lines. It shouldn't be that complicated, as perforce does most of the work (through describe') for you.

-Matt

-----Original Message----- From: David Surber [mailto:dsurber at mahinetworks.com] Sent: Monday, August 16, 2004 5:59 PM To: 'Vinny Murphy'; Dave Lewis Cc: perforce-user at perforce.com Subject: RE: [p4] lines of code counting tools

I simply create two workspaces - one with release_one and the other with release_two and simply diff the two outputs from the sloc output. I guess you could simply have a loop to walk through each of the changelist between two releases

Perhaps it would be wise to get a clarification of exactly what question we are trying to answer... Is it:

1. What is the difference in the number of lines between Release X and Release Y? or 2. How many lines were modified during development of Release Y? or 3. How many lines are different between Release X and Release Y?

Vinny's idea of diffing the two directory trees' sloc counts would probably answer Question 1; running all the "P4 describe" changes though the counter would probably answer Question 2; and my previous posting's method would answer Question 3!

Best Regards,

- Dave Surber