Knit/Plugin/Abstract.pm

filter: Statementstmt 100% 33 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 100% 41 / 41 CC 2 SCAR 2.0
CC
2
Cov
100%
munge
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Knit/Plugin/Version.pm ↑ Summary Knit/Plugin.pm »
1 package Pod::Knit::Plugin::Abstract;
2 3 our $AUTHORITY = 'cpan:YANICK';
3 # ABSTRACT: add the NAME section to the POD
4 3 $Pod::Knit::Plugin::Abstract::VERSION = '0.0.1';
5  
6 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use Log::Any '$log', prefix => 'Knit::Abstract: ';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 extends 'Pod::Knit::Plugin';
14 3 with 'Pod::Knit::DOM::Mojo';
15  
16 3 ▶use experimental qw/
Subroutine BEGIN: called CC=1 SCAR=0.0
17 signatures
18 postderef
19 3 /;
20  
21 2 ▶sub munge($self,$doc) {
Subroutine munge: called CC=2 SCAR=6.9
22  
23 2 $log->debug( 'transforming' );
24  
25 2 my ( $package, $abstract );
26 2 for ( $doc->content ) {
27 3 ▶ no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
28 2 ( $package ) = /^ \s* package \s+ (\S+);/mx;
29 2 ( $abstract ) = /^ \s* \# \s* ABSTRACT: \s* (.*?) $/mx;
30 }
31  
32 3 ▶ no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 $doc->find_or_create_section( 'NAME', 1, undef,
35 2 para => join ' - ', grep { $_ } $package, $abstract
36 );
37  
38 };
39  
40  
41  
42  
43 3 1;
44  
45 __END__
« Knit/Plugin/Version.pm ↑ Summary Knit/Plugin.pm »