How can I measure the overall change in the code base (Eclipse and Mercurial)

We need to be able to calculate the complete change in the lines of code between the two versions (V1 and V2) of a large Java base. A tool that uses Eclipse or Mercurial would be ideal.

Counting the number of lines of code in V1 and V2 is insufficient, as some sections of the code will be deleted and rewritten between versions.

We really need to calculate something like:

  • i = intersection of V1 and V2
  • D = Difference from Z to V2

Then we can calculate things like percent change = D / V2

Any recommendations for tools that can do this?

+4
source share
3 answers

After some Hg-based approaches, I found that the best solution is to use CLOC (Count Lines of Code): http://cloc.sourceforge.net/

You can give it two folders containing two versions of the project, and it will consider all lines the same, modified, added, deleted. This is exactly what I need.

+1
source

hg log --stat will show you different statistics for each commit, including inserted / deleted rows.

I don’t know if there is a better solution, but you can analyze the results of the abstract in order to achieve what you want.

You can also see this previous answer on SO: Counting changed lines of code over time

+3
source

Yes, ProjectCodeMeter can give you a differential slot between 2 versions of the source code, but better than that, it can also give you a difference in development time (which I think you really want to strive for).

0
source

All Articles