2

When programming in C++, I have a Code::Blocks plugin that tells me statistics about a project (not just one file), like code to comment percentages, lines of code in project etc.

Screenshot from Code::Blocks:

Code::Blocks code statistics plugin

I was wondering whether there was a similar program/plugin for Lua, so I can view statistics of all my code in a certain directory. (I'm using an IDE called ZeroBrane Studio, if anyone knows a plugin for that)

I'm running Ubuntu (Linux) 14.04 and it doesn't need to be compatible with Windows or Mac because Lua isn't a compiled language.

1

You can use CLOC:

  • free, open source, CLI
  • support many languages including Lua

Example:

prompt> cloc perl-5.10.0.tar.gz
    4076 text files.
    3883 unique files.                                          
    1521 files ignored.

http://cloc.sourceforge.net v 1.50  T=12.0 s (209.2 files/s, 70472.1 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Perl                          2052         110356         130018         292281
C                              135          18718          22862         140483
C/C++ Header                   147           7650          12093          44042
Bourne Shell                   116           3402           5789          36882
Lisp                             1            684           2242           7515
make                             7            498            473           2044
C++                             10            312            277           2000
XML                             26            231              0           1972
yacc                             2            128             97           1549
YAML                             2              2              0            489
DOS Batch                       11             85             50            322
HTML                             1             19              2             98
-------------------------------------------------------------------------------
SUM:                          2510         142085         173903         529677
-------------------------------------------------------------------------------

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.