I am now an independent Linux consultant and owner of
Built On Linux.
When I was doing engineering management at Brightmail , we had a lot of Perl
code in-house and I wanted to get a grip on its quality. I wrote this
as a quick hack to improve said quality by measuring some of the more
obvious features of the code. This is my first pass at measuring some
of the things that make software readable and maintainable.
This program is intended to help perl programmers write better code
by becoming more aware of their coding style. In particular, one
would like to know the code-to-comment ratio, the average number of
lines per subroutine, the longest subroutine, and things like that.
- Fixed "use constant" syntax for v5.6 and v5.8
===> perl-metrics.pl <===
DANGER --> 82 non-subroutine lines
code-to-comment ratio 2.7
avg lines per subroutine 16.7
longest subroutine: count_things (53 lines)
Share and enjoy!
Fri Oct 15 13:25:57 CDT 2004
Please write me with your feedback, patches, etc.