Expander/Plugin.pm

filter: Statementstmt 100% 33 / 33 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 3 totaltotal 83.6% 46 / 55 CC 6 SCAR 8.2
CC
6
Cov
90%
is_acceptable
4.0
new
2.3
expand
2.0
CRAP 2.3
« Expander/Plugin/MessageRFC822.pm ↑ Summary Expander/Guess.pm »
1 package MIME::Expander::Plugin;
2  
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 9 $VERSION = '0.02';
7  
8 9 ▶use parent qw(Class::Data::Inheritable);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 ▶use Email::MIME;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 9 __PACKAGE__->mk_classdata('ACCEPT_TYPES' => [qw(
12 )]);
13  
14 31 ▶sub new {
Subroutine new: called CC=2 SCAR=8.1
Pod undocumented
15 31 my $class = shift;
16 31 ▶ bless {}, (ref $class || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
0310
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
17 }
18  
19 259 ▶sub is_acceptable {
Subroutine is_acceptable: called CC=4 SCAR=13.9
Pod undocumented
20 259 my $self = shift;
21 259 ▶ my $type = shift or return ();
Branch: 1 branch
BranchTrueFalseTotal
my $type = shift() or return () 259 0 259
22 259 for ( @{$self->ACCEPT_TYPES} ){
23 332 ▶ return 1 if( $type eq $_ );
Branch: 1 branch
BranchTrueFalseTotal
if $type eq $_ 34 298 332
24 }
25 225 return ();
26 }
27  
28 1 ▶sub expand {
Subroutine expand: called CC=2 SCAR=7.0
Pod undocumented
29 1 my $self = shift;
30 1 my $part = shift;
31 1 my $callback = shift;
32 1 my $c = 0;
33  
34 1 ▶ $callback->( $part->body )
Branch: 1 branch
BranchTrueFalseTotal
if ref $callback eq "CODE" 1 0 1
35 if( ref $callback eq 'CODE' );
36  
37 1 ++$c;
38  
39 1 return $c;
40 }
41  
42 9 1;
43 __END__
« Expander/Plugin/MessageRFC822.pm ↑ Summary Expander/Guess.pm »