From: Jeffrey Thalhammer <j...@imaginative-software.com>
>To: Ovid <curtis_ovid_...@yahoo.com> 
>Cc: Paul Johnson <p...@pjcj.net>; "perl-qa@perl.org" <perl-qa@perl.org> 
>Sent: Monday, 1 October 2012, 22:48
>Subject: Re: TPF Devel::Cover grant report Week 18
> 
>
>On Oct 1, 2012, at 2:00 AM, Ovid wrote:
>
>> For others: yes, I know that PPI offers cyclomatic complexity information. I 
>> would like to see all code coverage information provided in "one-stop 
>> shopping" for Perl rather than relying on a separate tool (and I don't know 
>> that PPI exposes the control-flow graph used to calculate the cyclomatic 
>> complexity. Does it?).
>
>To my knowledge, PPI doesn't compute cyclomatic complexity.  But Perl::Critic 
>approximates it just by counting conditional operators and keywords.
>
>-Jeff


D'oh! You're right.

I didn't realize that P:C only approximates it.

For those who haven't seen it, it's the "McCabe score" when you use 
--statistics:

    $ perlcritic lib/ --statistics
    <snip>
      5 files.
     21 subroutines/methods.
    177 statements.

    450 lines, consisting of:
         59 blank lines.
         10 comment lines.
          4 data lines.
        207 lines of Perl code.
        170 lines of POD.

    Average McCabe score of subroutines was 1.52.
Cheers,
Ovid
--
Twitter - http://twitter.com/OvidPerl/
Buy my book - http://bit.ly/beginning_perl
Buy my other book - http://www.oreilly.com/catalog/perlhks/
Live and work overseas - http://www.overseas-exile.com/

Reply via email to