python metrics program/script sample

P

Philippe C. Martin

Hi,

I am looking for an eric3/linux compatible alternative to checking code
metrics (ex: true lines of code count)


Regards,


Philippe
 
P

Peter Hansen

Philippe said:
I am looking for an eric3/linux compatible alternative to checking code
metrics (ex: true lines of code count)

I don't know what "eric3/linux compatible" might be, I'm not sure
what this would be an alternative _to_, and I don't know what you
mean by "true" lines of code count, but the only thing I've
noticed lately that counts lines of Python code, and I'm fairly
sure it would run fine on Linux, is pycount. Google for it...

-Peter
 
F

F. Petitjean

I don't know what "eric3/linux compatible" might be, I'm not sure
what this would be an alternative _to_, and I don't know what you
mean by "true" lines of code count, but the only thing I've
noticed lately that counts lines of Python code, and I'm fairly
sure it would run fine on Linux, is pycount. Google for it...

-Peter
You can also use pylint (logilab.org) which print something like :
Report
======
57 statements analysed.

[snip]

Raw metrics
-----------

type number % previous difference
:::::::::::::::::::::::::::::::::::::::::::
code 61 64.21 61 =
docstring 22 23.16 22 =
comment 3 3.16 3 =
empty 9 9.47 9 =


As it is pure python it should not be difficult to adapt to your needs.
(but do not feed pylint with a module with tabs, the final 'Global
evaluation' will be deceitfull)

Sorry for bad english, I'm not a native speaker.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top