4

I am working on a project using Eclipse 3.4.2, and would like to know how many Non Comment Lines of Code (NCLOC) it has.

It is OK to be a simple plugin, but I don't wan too much bloat. My machine is already slow the way it is.

ciczan
  • 340
  • 2
  • 8

2 Answers2

5

Use Eclipse regular Expression: Search->File, check Regular expression.

  • LOC: \n[\s]* (without blanks)

  • Comments: [*]+

you can subtract to get NCLOC with selected resource

wang binghuan
  • 63
  • 1
  • 4
2

You could try a metric plugin (like the ones I mention in this SO question)

That, plus a good eclipse.ini (making your eclipse run with the latest JDK), should make your configuration able to display what you want in a timely fashion.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I think the plugins you mentioned will do the trick. Since a report is generated on demand, the is no reason they can impact Eclipse's performance. – ciczan Dec 03 '09 at 11:01
  • 1
    The metric plug-in seems to be not compatible with recent versions of Eclipse. – usr1234567 May 05 '17 at 07:45
  • @usr1234567 8 years later, that wouldn't be a surprise ;) Are you talking about http://metrics.sourceforge.net/ or http://eclipse-metrics.sourceforge.net/? The latter should be compatible (https://marketplace.eclipse.org/content/eclipse-metrics) – VonC May 05 '17 at 07:48