MIME/Creator.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 29 / 29 CC 3 SCAR 5.6
CC
3
Cov
100%
_construct_part
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« MIME/Modifier.pm ↑ Summary
1 19 ▶use v5.12.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Email::MIME::Creator 1.954;
4 # ABSTRACT: obsolete do-nothing library
5  
6 19 ▶use parent q[Email::Simple::Creator];
Subroutine BEGIN: called CC=1 SCAR=0.0
7 19 ▶use Email::MIME;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 19 ▶use Encode ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 14 ▶sub _construct_part {
Subroutine _construct_part: called CC=3 SCAR=11.0
11 14 my ($class, $body) = @_;
12  
13 14 my $is_binary = $body =~ /[\x00\x80-\xFF]/;
14  
15 14 ▶ my $content_type = $is_binary ? 'application/x-binary' : 'text/plain';
Branch: 1 branch
BranchTrueFalseTotal
$is_binary ? : 7 7 14
16  
17 14 ▶ Email::MIME->create(
Branch: 1 branch
BranchTrueFalseTotal
$is_binary ? : 7 7 14
18 attributes => {
19 content_type => $content_type,
20 encoding => ($is_binary ? 'base64' : ''), # be safe
21 },
22 body => $body,
23 );
24 }
25  
26 19 1;
27  
28 #pod =head1 SYNOPSIS
29 #pod
30 #pod You don't need to use this module for anything.
31 #pod
32 #pod =cut
33  
34 __END__
« MIME/Modifier.pm ↑ Summary