Re: Count lines of code
Re: Count lines of code
- Subject: Re: Count lines of code
- From: "Fred W. Bacon" <email@hidden>
- Date: Tue, 01 Feb 2005 17:24:05 -0500
- Organization: Rigid Rotor
On Tue, 2005-02-01 at 11:51 -0800, Brant Sears wrote:
> Perhaps using grep with some regular expression would be the right way to
> filter out comments and blank lines? Perhaps a perl script would be better?
>
Things I like to see occasionally are a count of semicolons,
for/while/do loops, if/ifelse/else, switch/case and function
definitions. All of them have something to say about the size and
complexity of your code. More so than just a simple source line of code
count.
> The next step might involve using the diff utility to determine lines of code
> deleted, modified, and added.
If you aren't using a version control system, you should be. I'm sure
that the more expensive version control systems have something available
for doing this. For my personal use, I've always worked with cvs and
diffstat. You can get an arbitrary diff between two "versions" (in the
sense of cvs) of your source code and pipe that through diffstat to get
some statistics on what changed and by how much.
http://dickey.his.com/diffstat/diffstat.html
Don't forget viewcvs: http://viewcvs.sourceforge.net/
and cvsgraph: http://www.akhphd.au.dk/~bertho/cvsgraph/
>
> The purpose of this is that we want to be able to use this data to calibrate
> an estimation tool with data from our project. I think that the more automated
> this system is, the less bias our data will be and therefore we will have
> better data to calibrate the estimation tool with.
Or you could just sacrifice a goat and examine its entrails. ;-)
>
> So the reason why I'm posting this is that I'd like to ask if there is already
> such a tool in existence that I can buy/use. Does anyone know of such a tool for
> OS X?
There are lots of commercial tools for this. If you want something free
and simple try
http://www.dwheeler.com/sloccount/
It should work on OS X, but I haven't tried it there.
--
Fred W. Bacon <email@hidden>
Rigid Rotor
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden