Code count extension?
José Luis García Pallero
jgpallero at gmail.com
Tue Feb 28 10:24:39 UTC 2012
Good job. Thank you again. I am not an expert programmer but how can
be converted 8264 perl code lines into 773 python code lines :-P? You
are my programming guru! :)
I've tried the extension (hg.cloc is faster than cloc) against my
OctCLIP extension for GNU Octave
(https://bitbucket.org/jgpallero/octclip) and I obtain some
differences between hg.cloc and cloc. First of all, the results:
hg.cloc:
topo at geo:~/Desktop/octclip$ hg cloc
language files blank
comment total
-----------------------------------------------------------------------------------------
C 15 47
4367 10080
C/C++ Header 19 80
6546 7752
C++ 1 0
81 240
MATLAB/Objective C/MUMPS 1 37 37 264
-----------------------------------------------------------------------------------------
SUM: 36 164
11031 18336
cloc (v. 1.55):
topo at geo:~/Desktop/octclip$ cloc .
Use of qw(...) as parentheses is deprecated at
/home/topo/software//bin/cloc line 1841.
45 text files.
43 unique files.
77 files ignored.
http://cloc.sourceforge.net v 1.55 T=0.5 s (74.0 files/s, 36728.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C 15 47 4320
5713
C/C++ Header 19 80 6466 1206
C++ 1 0
81 159
MATLAB 1 37 120
107
make 1 3
1 24
-------------------------------------------------------------------------------
SUM: 37 167 10988
7209
-------------------------------------------------------------------------------
About the type of the lines, you forgot the 'code' tag in the group
'files', 'blank', 'comment', 'CODE', 'total'. The original cloc has
not the 'total' column, but I like it :).
On the other hand, in some cases the number of lines do not agree
between hg.cloc and cloc. I think there is a problem parsing comments.
For example, in C files, hg.cloc counts 4367 comments and cloc counts
4320. For Matlab files (actually are GNU Octave files), hg.cloc counts
37 comment lines while cloc counts 120. Why do you have grouped
MATLAB/Objective C/MUMPS files?
Finally, your hg.cloc do not detect makefiles, as cloc does.
Finally, I would like to say that I think that when hg.cloc will be
stable it could be a good idea to integrate it as an extension
distributed with Mercurial
Cheers
El día 28 de febrero de 2012 10:50, nemo <nemo1412 at gmail.com> escribió:
> Sorry,I forgot.
> Now the repo is open. :-P
>
> On 02/28/2012 05:41 PM, José Luis García Pallero wrote:
>
> Oh, very fast. Thank you very much for your effort. Now, one small
> problem, the repo https://bitbucket.org/jinhui/hg-cloc is not public,
> so I can't download the code :-))
>
> Cheers
>
> El día 28 de febrero de 2012 10:15, nemo <nemo1412 at gmail.com> escribió:
>
> On 02/22/2012 04:09 PM, José Luis García Pallero wrote:
>
> Oh, it sounds very good. For sure it will be a useful extension. I
> suggest the name hg.cloc :)
>
> Hi, hg.cloc completed.
>
> I rewrite CLOC to python and integrated it to a extension. Now published it
> on http://mercurial.selenic.com/wiki/ClocExtension.
>
> Finally, thank you for your advice.
>
>
>
--
*****************************************
José Luis García Pallero
jgpallero at gmail.com
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************
More information about the Mercurial
mailing list