views:

740

answers:

4

I want to be able to get the projects I have in Sourcesafe and their total lines of code (perhaps also with total number of classes, etc). Is there an SDK for Sourcesafe (I use 2005 edition) which will allow me to do this?

Or is there a document in Sourcesafe which lists all the projects in SS? Using this, I could work towards getting the line count.

Thanks

A: 

You will need to get each file and count the number of lines yourself.

Lasse V. Karlsen
+2  A: 

There is no specific line counting API. There is an API to access the files but its way too slow.

It would probably be better if you set up a shadow folder on the root project (this is done via the admin tool). A simple app could then open all the source files recursively from the shadow folder and do some line counting.

AnthonyWJones
+1  A: 

I realize this is not exactly what you're asking for, but you might be able to adapt the following to suit your needs:

http://richnewman.wordpress.com/2007/07/01/c-and-vbnet-line-count-utility/

I've used this before, and works very well. It differentiates between comments and auto-generated code as well.

Charlie Salts
A: 

I don't need an API to count the number of lines in a class. This is easy to do and I know several ways.

Rather, it would be good to get a collection of the files stored in SS, so I can run the line count on each and every file.

However, I guess I could just label my root parent dir with a tag like projectnameISSOURCESAFECHECKEDIN, and for every folder (and only the parent folder), I will drill in, and count the lines in classes. Not a perfect solution, but effective and no dependency on any API.

Anthony,

Your solution is also credible. :)

dotnetdev