Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

domm (4030)

domm
  (email not shown publicly)
http://domm.plix.at/

Just in case you like to know, I'm currently full-time father of 2 kids, half-time Perl hacker, sort-of DJ, bicyclist, no longer dreadlocked and 33 years old

I'm also head of Vienna.pm [pm.org], maintainer of the CPANTS [perl.org] project, member of the TPF Grants Commitee [perlfoundation.org] and the YAPC Europe Foundation [yapceurope.org].

I've got stuff on CPAN [cpan.org], held various talks [domm.plix.at] and organised YAPC::Europe 2007 in Vienna [yapceurope.org].

Journal of domm (4030)

Friday October 08, 2004
02:26 PM

CPANTS news

[ #21254 ]
I just released a new version of Module::CPANTS::Generator. Should be on your favourite CPAN mirror soon.

It contains the following new metrics:

  • proper_libs - is there only one .pm file in the top dir or one or more in libs
  • use_stric - do all modules in dist use strict
  • use warnings - do all modules in dist use warnings

The last two are generated by parsing the source code with a Parse::RecDescent based parser (Module::ExtractUse). This might be buggy, so please inform me if something got parsed wrong.

There's also quite a bit of new metadata, mainly a list of all modules actually used by a dist (again gathered by parsing). This information isn't used currently, but I plan to compare this list with what's specified in PREREQ_PM (minus Module::CoreList, of course).

Some data (total Kwalitee available is 14) (SQLite db is available here: http://cpants.dev.zsi.at/):

sqlite> select kwalitee,count(kwalitee) as cnt from kwalitee group by kwalitee order by kwalitee;
kwalitee    cnt
----------  ----------
0           30
2           3
3           11
4           57
5           35
6           34
7           95
8           276
9           670
10          1609
11          2567
12          1780
13          747
14          21

+++++++++++++++++++++++++++

sqlite> select avg(kwalitee) from kwalitee;
avg(kwalitee)
--------------------
10.7424070573409

++++++++++++ +++++++++++++++

sqlite> select cpanid,name,average_kwalitee from authors where distcount>5 order by average_kwalitee desc limit 20;
cpanid      name                       average_kwalitee
----------  -------------------------  ----------------
BPOSTLE     Bruno Postle               13
STEPHANB    Stephan Buys               13
JCDUQUE     Julius C. Duque            12.9411764705882
AMBS        Alberto Manuel Brandao Si  12.9
IAN         Ian Langworth              12.7857142857143
BARBIE      Barbie                     12.75
FABPOT      Fabien Potencier           12.7272727272727
RMCFARLA    Ross McFarland             12.7142857142857
BMORROW     Ben Morrow                 12.7142857142857
RSAVAGE     Ron Savage                 12.68
RJBS        Ricardo SIGNES             12.5769230769231
SSCOTTO     Salvatore E. ScottoDiLuzi  12.5714285714286
COG         Jose' Alves de Castro      12.4615384615385
DAVECROSS   Dave Cross                 12.4375
JOUKE       Jouke Visser               12.4285714285714
NKH         Nadim Ibn Hamouda El Khem  12.4285714285714
JFITZ       James FitzGibbon           12.4
TSCH        Torsten Schoenfeld         12.3333333333333
CLOTHO      Clotho Advanced Media      12.3333333333333
FLORIAN     Florian Helmberger         12.3333333333333

+++++++++++++++++++++++++++

sqlite> select module,count(module) as cnt from uses group by module order by cnt desc limit 20;
module                cnt
--------------------  -------------------------
strict                7026
vars                  4542
Carp                  3226
Exporter              3052
warnings              2255
DynaLoader            751
constant              747
5.006                 731
Data::Dumper          631
AutoLoader            503
POSIX                 381
File::Spec            341
IO::File              337
File::Basename        336
5.004                 321
DBI                   309
Fcntl                 294
5.005                 284
Apache::Constants     274
Cwd                   269

Next steps:

  • Set up a proper cronjob (sorry Jos, you're butt-kick on #perl wasn't hard enough :-)
  • Set up something to automatically generate nice reports
  • add more metrics
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • use warnings as a metric is unfair if a module expects to work with 5.005 or earlier. Likewise, having use warnings without a require 5.006 (or later) in Makefile.PL is probably a sign of poor kwalitee.

    • Hmm, you're right.

      So I guess I'll drop use warnings as a metric, and maybe add a combined use warnings && require 5.006 check.
      • This might be too much to do for every package, but I think checking for emitted warnings during tests might be a good metric. It's not perfect either, though. Still, good work :)
  • It seems the "use strict" test doesn't work out right for Business::ISMN.

    I'm curious how your system decides which modules to include: several of mine are missing, such as Chemistry::Elements, Apache::Htaccess, and Data::Constraint.

    The "use warning" metric is a bit unfair. Not only does it not work with perl versions prior to 5.6, but some people don't want warnings on in production code lest a perl upgrade start dumping new warnings into logs files. Before disks got to be as big as they are today, one
    • It seems the "use strict" test doesn't work out right for Business::ISMN.

      You're right. Business::ISMN contains two module files, but defines three namespaces, all of which use strict. The bug in CPANTS is that it expects the number of use stricts to be the same as the number of module files. Which is obviously wrong. I changed '==' to '

      I'm curious how your system decides which modules to include: several of mine are missing, such as Chemistry::Elements, Apache::Htaccess, and Data::Constraint.

      Hmm, str

  • I'm not sure exactly how to include it, but I think the CPAN ratings [perl.org] ought to be some sort of kwalitee indicator :-)