Expander/Plugin/MessageRFC822.pm

filter: Statementstmt 100% 29 / 29 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 95.2% 40 / 42 CC 4 SCAR 8.5
CC
4
Cov
97%
expand
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.3
« Expander/Plugin/ApplicationTar.pm ↑ Summary Expander/Plugin.pm »
1 package MIME::Expander::Plugin::MessageRFC822;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 $VERSION = '0.02';
7  
8 4 ▶use parent qw(MIME::Expander::Plugin);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 __PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw(
10 message/rfc822
11 multipart/mixed
12 )]);
13  
14 4 ▶use Email::MIME;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 4 ▶sub expand {
Subroutine expand: called CC=4 SCAR=13.9
Pod undocumented
17 4 my $self = shift;
18 4 my $part = shift;
19 4 my $callback = shift;
20 4 my $c = 0;
21  
22 4 my @parts = ($part);
23 4 ▶ while( my $part = shift @parts ){
Branch: 1 branch
BranchTrueFalseTotal
if (my $part = shift @parts) 21 4 25
24 21 ▶ if( 1 < $part->parts ){
Branch: 1 branch
BranchTrueFalseTotal
if (1 < $part->parts) { } 5 16 21
25 5 push @parts, $part->subparts;
26 }else{
27 16 ++$c;
28 16 ▶ $callback->( \$part->body, {
Branch: 1 branch
BranchTrueFalseTotal
if ref $callback eq "CODE" 16 0 16
29 filename => $part->filename,
30 } ) if( ref $callback eq 'CODE' );
31 }
32 }
33  
34 4 return $c;
35 }
36  
37 4 1;
38 __END__
« Expander/Plugin/ApplicationTar.pm ↑ Summary Expander/Plugin.pm »