On Oct 4, 2005, at 1:04 PM, Nik Clayton wrote:
I don't have strong opinions about this yet, but has anyone else
looked at the Perl::Critic suite of modules on CPAN?
It occurs to me that:
a) Kwalitee metrics could quite easily be implemented as
Perl::Critic plugins.
b) The plugins that it ships with (based on Perl Best Practices)
may form good kwalitee indicators.
As a framework, yes, it has potential for being useful for kwalitee
metrics. The PPI foundation that Perl::Critic uses is a very
powerful tool for parsing Perl without actually running Perl. Some
of the plugins would be good for kwalitee, but many of them are just
very well-reasoned opinions. I'm a fan of most of PBP, but many of
the ideas are too strict to impose on all of CPAN.
Things that PPI/Perl::Critic could judge that might lead to
quantitative, non-controversial metrics:
* are the variables/functions consistently named? (i.e. all of them
in_underscore_style or allInCamelCase)
* what's the ratio of globals to subroutines? (smaller is better)
* is there a SYNOPSIS section and is it valid Perl?
* do OO-style modules bless into a hardcoded package or a passed
package name? (former kills subclassing)
* are there any undeclared, non-core dependencies?
* does the module use Perl 5.6.x+ constructs without declaring "use
5.006"?
* does the module use platform directory syntax or portable tools?
(e.g. File::Spec, Path::Class)
All of these would be very hard to judge without parsing the module.
Chris
--
Chris Dolan, Software Developer, Clotho Advanced Media Inc.
608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703
Clotho Advanced Media, Inc. - Creators of MediaLandscape Software
(http://www.media-landscape.com/) and partners in the revolutionary
Croquet project (http://www.opencroquet.org/)