Message/TransferEnc.pm

filter: Statementstmt 57.1% 16 / 28 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 4 / 10 Podpod 100% 6 / 6 totaltotal 54.1% 26 / 48 CC 3 SCAR 14.3
CC
3
Cov
50%
create
12.0
addTransferEncoder
2.0
name
2.0
CRAP 4.2
« Message/TransferEnc/EightBit.pm ↑ Summary Message/Field/AddrGroup.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;{
13 13 our $VERSION = '4.05';
14 }
15  
16 13 ▶use parent 'Mail::Reporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 13 ▶use Log::Report 'mail-message', import => [ qw/__x error/ ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 #--------------------
24  
25 13 my %encoder = (
26 'base64' => 'Mail::Message::TransferEnc::Base64',
27 '7bit' => 'Mail::Message::TransferEnc::SevenBit',
28 '8bit' => 'Mail::Message::TransferEnc::EightBit',
29 'quoted-printable' => 'Mail::Message::TransferEnc::QuotedPrint',
30 );
31  
32 #--------------------
33  
34 sub create($@)
35 0 ▶{ my ($class, $type) = (shift, shift);
Subroutine create: not called CC=3 SCAR=24.8
Pod documented
36  
37 0 ▶ my $encoder = $encoder{lc $type}
Branch: 1 branch
BranchTrueFalseTotal
my $encoder = $encoder{lc $type} or &error(&__x("no decoder for transfer encoding {type}.", "type", $type)) 0 0 0
38 or error __x"no decoder for transfer encoding {type}.", type => $type;
39  
40 0 eval "require $encoder";
41 0 ▶ $@ and error __x"decoder for transfer encoding {type} does not work:\n{error}", type => $type, error => $@;
Branch: 1 branch
BranchTrueFalseTotal
$@ and &error(&__x("decoder for transfer encoding {type} does not work:\n{error}", "type", $type, "error", $@)) 0 0 0
42  
43 0 $encoder->new(@_);
44 }
45  
46  
47 sub addTransferEncoder($$)
48 0 ▶{ my ($class, $type, $encoderclass) = @_;
Subroutine addTransferEncoder: not called CC=1 SCAR=6.9
Pod documented
49 0 $encoder{lc $type} = $encoderclass;
50 0 $class;
51 }
52  
53  
54 0 ▶sub name { $_[0]->notImplemented }
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
55  
56 #--------------------
57  
58 0 ▶sub check($@) { $_[0]->notImplemented }
Subroutine check: not called CC=1 SCAR=6.9
Pod documented
59  
60  
61 0 ▶sub decode($@) { $_[0]->notImplemented }
Subroutine decode: not called CC=1 SCAR=6.9
Pod documented
62  
63  
64 0 ▶sub encode($) { $_[0]->notImplemented }
Subroutine encode: not called CC=1 SCAR=6.9
Pod documented
65  
66 #--------------------
67  
68 13 1;
« Message/TransferEnc/EightBit.pm ↑ Summary Message/Field/AddrGroup.pm »