Message/TransferEnc/Binary.pm

filter: Statementstmt 46.6% 14 / 30 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod 100% 3 / 3 totaltotal 42.8% 21 / 49 CC 5 SCAR 26.6
CC
5
Cov
38%
encode
30.0
check
2.0
decode
2.0
CRAP 14.4
« Message/Construct/Bounce.pm ↑ Summary Message/Head/FieldGroup.pm »
1 # Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.03.
5 # This code is part of distribution Mail-Message. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package Mail::Message::TransferEnc::Binary;
10 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 $VERSION = '3.012';
12  
13 1 ▶use base 'Mail::Message::TransferEnc';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 sub name() { 'binary' }
20  
21 #------------------------------------------
22  
23 sub check($@)
24 0 ▶{ my ($self, $body, %args) = @_;
Subroutine check: not called CC=1 SCAR=6.9
Pod documented
25 0 $body;
26 }
27  
28 #------------------------------------------
29  
30 sub decode($@)
31 0 ▶{ my ($self, $body, %args) = @_;
Subroutine decode: not called CC=1 SCAR=6.9
Pod documented
32 0 $body->transferEncoding('none');
33 0 $body;
34 }
35  
36 #------------------------------------------
37  
38 sub encode($@)
39 0 ▶{ my ($self, $body, %args) = @_;
Subroutine encode: not called CC=5 SCAR=34.0
Pod documented
40  
41 0 my @lines;
42  
43 0 my $changes = 0;
44 0 foreach ($body->lines)
45 0 ▶ { $changes++ if s/[\000\013]//g;
Branch: 1 branch
BranchTrueFalseTotal
if s/[\000\013]//g 0 0 0
46 0 push @lines, $_;
47 }
48  
49 0 ▶ unless($changes)
Branch: 1 branch
BranchTrueFalseTotal
unless ($changes) 0 0 0
50 0 { $body->transferEncoding('none');
51 0 return $body;
52 }
53  
54 0 ▶ my $bodytype = $args{result_type} || ref($self->load);
Condition0%0/3
$args{'result_type'} || ref $self->load
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{'result_type'} || ref $self->load
$args{'result_type'} ref $self->load
Truth table0%0/3
A || B
A= $args{'result_type'}B= ref $self->load
ABresult
1X1
011
000
55  
56 0 $bodytype->new
57 ( based_on => $self
58 , transfer_encoding => 'none'
59 , data => \@lines
60 );
61 }
62  
63 #------------------------------------------
64  
65 1 1;
« Message/Construct/Bounce.pm ↑ Summary Message/Head/FieldGroup.pm »