Abstract/MIMEEntity.pm

filter: Statementstmt 43.7% 14 / 32 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 4 / 8 Podpod 20.0% 1 / 5 totaltotal 43.1% 22 / 51 CC 5 SCAR 12.2
CC
5
Cov
45%
get_body
6.0
set_body
6.0
is_available
3.2
CRAP 3.4
« Abstract.pm ↑ Summary Abstract/MailMessage.pm »
1 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Email::Abstract::MIMEEntity;
3 # ABSTRACT: Email::Abstract wrapper for MIME::Entity
4 3 $Email::Abstract::MIMEEntity::VERSION = '3.010';
5 3 ▶use Email::Abstract::Plugin;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶BEGIN { @Email::Abstract::MIMEEntity::ISA = 'Email::Abstract::MailInternet' };
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 my $is_avail;
9 4 ▶sub is_available {
Subroutine is_available: called CC=3 SCAR=11.8
Pod documented
10 4 ▶ return $is_avail if defined $is_avail;
Branch: 1 branch
BranchTrueFalseTotal
if defined $is_avail 1 3 4
11 0 eval { require MIME::Entity; MIME::Entity->VERSION(5.508); 1 };
12 3 ▶ return $is_avail = $@ ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
$@ ? : 3 0 3
13 }
14  
15 0 ▶sub target { "MIME::Entity" }
Subroutine target: not called CC=1 SCAR=6.9
Pod undocumented
16  
17 0 ▶sub construct {
Subroutine construct: not called CC=1 SCAR=6.9
Pod undocumented
18 0 require MIME::Parser;
19 0 my $parser = MIME::Parser->new;
20 0 $parser->output_to_core(1);
21 0 my ($class, $rfc822) = @_;
22 0 $parser->parse_data($rfc822);
23 }
24  
25 0 ▶sub get_body {
Subroutine get_body: not called CC=2 SCAR=17.9
Pod undocumented
26 0 my ($self, $obj) = @_;
27 0 my $handle = $obj->bodyhandle;
28 0 ▶ return $handle ? $handle->as_string : join('', @{ $obj->body });
Branch: 1 branch
BranchTrueFalseTotal
$handle ? : 0 0 0
29 }
30  
31 0 ▶sub set_body {
Subroutine set_body: not called CC=2 SCAR=17.9
Pod undocumented
32 0 my ($class, $obj, $body) = @_;
33 0 my @lines = split /\n/, $body;
34 0 my $io = $obj->bodyhandle->open("w");
35 0 foreach (@lines) { $io->print($_."\n") }
36 0 $io->close;
37 }
38  
39 3 1;
40  
41 #pod =head1 DESCRIPTION
42 #pod
43 #pod This module wraps the MIME::Entity mail handling library with an
44 #pod abstract interface, to be used with L<Email::Abstract>
45 #pod
46 #pod =head1 SEE ALSO
47 #pod
48 #pod L<Email::Abstract>, L<MIME::Entity>.
49 #pod
50 #pod =cut
51  
52 __END__
« Abstract.pm ↑ Summary Abstract/MailMessage.pm »