Message/TransferEnc/Binary.pm

filter: Statementstmt 48.3% 15 / 31 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 44.0% 22 / 50 CC 5 SCAR 26.6
CC
5
Cov
39%
encode
30.0
check
2.0
decode
2.0
CRAP 14.4
« Message/Head/ListGroup.pm ↑ Summary Message/Head/FieldGroup.pm »
1 # This code is part of Perl distribution Mail-Message version 4.05.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2001-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Mail::Message::TransferEnc::Binary;{
13 1 our $VERSION = '4.05';
14 }
15  
16 1 ▶use parent 'Mail::Message::TransferEnc';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Log::Report 'mail-message', import => [ qw// ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 #--------------------
24  
25 sub name() { 'binary' }
26  
27 sub check($@)
28 0 ▶{ my ($self, $body, %args) = @_;
Subroutine check: not called CC=1 SCAR=6.9
Pod documented
29 0 $body;
30 }
31  
32 sub decode($@)
33 0 ▶{ my ($self, $body, %args) = @_;
Subroutine decode: not called CC=1 SCAR=6.9
Pod documented
34 0 $body->transferEncoding('none');
35 0 $body;
36 }
37  
38 sub encode($@)
39 0 ▶{ my ($self, $body, %args) = @_;
Subroutine encode: not called CC=5 SCAR=34.0
Pod documented
40 0 my @lines;
41  
42 0 my $changes = 0;
43 0 foreach ($body->lines)
44 0 ▶ { $changes++ if s/[\000\013]//g;
Branch: 1 branch
BranchTrueFalseTotal
if s/[\000\013]//g 0 0 0
45 0 push @lines, $_;
46 }
47  
48 0 ▶ unless($changes)
Branch: 1 branch
BranchTrueFalseTotal
unless ($changes) 0 0 0
49 0 { $body->transferEncoding('none');
50 0 return $body;
51 }
52  
53 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
54 0 $bodytype->new(based_on => $body, transfer_encoding => 'none', data => \@lines);
55 }
56  
57 1 1;
« Message/Head/ListGroup.pm ↑ Summary Message/Head/FieldGroup.pm »