Simple/Creator.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 6 / 6 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 38 / 38 CC 5 SCAR 10.4
CC
5
Cov
100%
_add_to_header
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.8
« Simple.pm ↑ Summary
1 22 ▶use v5.12.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 22 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Email::Simple::Creator 2.218;
4 # ABSTRACT: private helper for building Email::Simple objects
5  
6 22 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 64 ▶sub _crlf {
Subroutine _crlf: called CC=1 SCAR=0.0
9 64 "\x0d\x0a";
10 }
11  
12 10 ▶sub _date_header {
Subroutine _date_header: called CC=1 SCAR=0.0
13 10 require Email::Date::Format;
14 10 Email::Date::Format::email_date();
15 }
16  
17 22 our @CARP_NOT = qw(Email::Simple Email::MIME);
18  
19 25 ▶sub _add_to_header {
Subroutine _add_to_header: called CC=5 SCAR=16.1
20 25 my ($class, $header, $key, $value) = @_;
21 25 ▶ $value //= '';
Condition100%2/2
$value //= ""
l!l
241
MC/DC100%1/1
$value //= ""
$value
Truth table100%2/2
A
A= $value
Aresult
11
00
22  
23 25 ▶ Carp::carp "Header name '$key' with wide characters" if $key =~ /[^\x00-\xFF]/;
Branch: 1 branch
BranchTrueFalseTotal
if $key =~ /[^\x00-\xFF]/u 1 24 25
24 25 ▶ Carp::carp "Value '$value' for '$key' header with wide characters" if $value =~ /[^\x00-\xFF]/;
Branch: 1 branch
BranchTrueFalseTotal
if $value =~ /[^\x00-\xFF]/u 1 24 25
25  
26 25 ▶ if ($value =~ s/[\x0a\x0b\x0c\x0d\x85\x{2028}\x{2029}]+/ /g) {
Branch: 1 branch
BranchTrueFalseTotal
if ($value =~ s/[\x0a\x0b\x0c\x0d\x85\x{2028}\x{2029}]+/ /gu) 1 24 25
27 1 Carp::carp("replaced vertical whitespace in $key header with space; this will become fatal in a future version");
28 }
29  
30 25 $$header .= Email::Simple::Header->__fold_objless("$key: $value", 78, q{ }, $class->_crlf);
31 }
32  
33 13 ▶sub _finalize_header {
Subroutine _finalize_header: called CC=1 SCAR=0.0
34 13 my ($class, $header) = @_;
35 13 $$header .= $class->_crlf;
36 }
37  
38 22 1;
39  
40 __END__
« Simple.pm ↑ Summary