문제

I've been tasked with finding a way of reporting whenever the LOC/file size of certain files in our project increases when someone tries to commit via SVN.

ie. if a file has 26 LOC and a developer increases this, they should be alerted at compile or commit time.

We already use PMD so I was hoping I could make use of a PMD rule to achieve this but having looked in to it I'm not sure if that's possible with PMD.

Any advice or suggestions would be much appreciated.

Thanks

도움이 되었습니까?

해결책

I suggest you take a look at JavaNCSS. It looks to have a sound notion of what a line of code is ... and it appears to be grammar based. You may need to modify / extend / post-process to compare line count changes over time.

UPDATE

Looks like it only supports up to Java 5/6 language syntax.


Having said that, if you only want to do this for "certain files" (i.e. a small number), this strikes me as over-engineering. And if you want to do it for large numbers of files, then one has to wonder if someone (your manager perhaps) has a clinical case of metrics obsession disorder. (This is a delusional disorder where people imagine that software metrics are a valid measure of project progress ...)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top