Eclipse plugin for measuring lines of code

折月煮酒 提交于 2019-11-30 09:04:19

Metrics2 is an updated version of the Metrics plug-in described by js3v that should do what you need. It can also aggregate some of the measurements (e.g. add up the LOC of classes in a package to give you the LOC of the package). This page explains some of its capabilities and mentions that it counts logical lines of code, not physical ones.

rajah9

I have been using checkstyle-cs, a free Eclipse plug-in. Besides logical lines of code, it will also compute cyclomatic and N-path complexity (which may be a better indicator of code problems).

While I don't know if it will generate a report on every module, you might try setting the threshold very low, (like 2). Checkstyle should give you a yellow highlight at the start of every method, telling you how many lines of code it found.

Incidentally, there was some disagreement on our team as to whether

a[i++] = 7;

was one statement or two. There was no disagreement that

a[i] = 7;
i++; 

counted as two statements.

Here's one that I've used... works pretty well. http://sourceforge.net/projects/metrics/

Benji

ProjectCodeMeter can be integrated as eclipse external metrics tool, counts many source code metrics such as logical lines of code, complexity, arithmetic intricacy, strings, numeric constants, even estimates development time in hours.

Look at the "integrating into eclipse" section (about half way through the page)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!