Question

Is it possible to get the total LOC for files in the depot? I have already tried solutions which check for LOC's for changelists edited by a specific user using P4 describe -ds I wish to check the LOC for all the files under the directory without actually importing the files (Irrespective of the user who modified the file) Also if this is possible wish to sort out these details with the file types.

Was it helpful?

Solution

There isn't a direct way to do this. You can use p4 print, as someone else already suggested, or p4 sizes, which gives you the the size of a file revision in bytes (and you'd have to calculate the difference between subsequent revisions).

I recommend paying special attention to integrations. If your Perforce server employs branches, you'll probably want to discount integrations from your metrics calculation. Only the original change should get credit for adding/modifying lines, pushing that change to another codeline should not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top