Perl Advent Calendar 2007-12-23

Dickens also rates an 8

by Jerrad Pierce

It's a little known fact that before he took over operations at the North Pole Santa was working on his M.B.A. As jolly as the old elf is, he's a real stickler for standards and metrics. Needless to say, the Winter Solstice B&E cookie muncher was thrilled when Test::Perl::Critic was covered but that was sometime ago and he's beginning to long for something more… enter B::Fathom. Fathom gathers some arcane statistics it employs in seemingly arbitrary calculations to generate a value from 0 .. 10 or null to line noise.While the subroutine count seems off, the overall results are not unreasonable as indicated below.

pèrenoel@3# perl -MO=Fathom /usr/share/perl/5.8.4/AnyDBM_File.pm #v1.00
   49 tokens
   16 expressions
    8 statements
    1 subroutine
readability is 2.88 (very readable)
/usr/share/perl/5.8.4/AnyDBM_File.pm syntax OK
pèrenoel@3# perl -MO=Fathom /usr/share/perl/5.8.4/CGI.pm #v3.04
  674 tokens
  172 expressions
   71 statements
    1 subroutine
readability is 8.51 (obfuscated)
/usr/share/perl/5.8.4/CGI.pm syntax OK