jobias
jobias

Reputation: 13

How do I compare the number of lines of code in one version of a project to another?

More specifically, I'm looking for how to count the number of lines in all files within a directory recursively through all directories. I can simply repeat on each the two different versions of the project to get a comparison figure.

Alternatively, since subversion has a fairly robust diff functionality, is it possible to mutate a diff between the two versions to obtain an absolute difference of lines of code?

Either solution would help me out greatly.

Upvotes: 1

Views: 1699

Answers (4)

Romain Verdier
Romain Verdier

Reputation: 13011

If you work in .NET/Java, NDepend/XDepend support this.

Upvotes: 0

dommer
dommer

Reputation: 19820

I use LocMetrics on Windows. Free, and simple "unzip" deployment.

Upvotes: 0

Bill B
Bill B

Reputation: 1300

You didn't specify your platform, but if it happens to be *nix (including cygwin under windows), you could try sloccount. I use it quite a bit for a number of different languages and am very happy with it.

Upvotes: 1

Nick Whaley
Nick Whaley

Reputation: 2799

There are some fantastic tools for counting lines of code as it is a valuable metric. They include options like ignoring whitespace and comments.

Just do a google search for a line counter specific to what you need.

Upvotes: 2

Related Questions