blib/lib/MIME/DecodeText.pm

filter: Statementstmt 45.7% 16 / 35 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 1 totaltotal 43.4% 20 / 46 CC 4 SCAR 17.5
CC
4
Cov
41%
__decode
12.0
decode_text
6.0
BEGIN
1.0
CRAP 5.8
↑ Summary
1 package MIME::DecodeText;
2  
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use MIME::QuotedPrint;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 require Exporter;
10  
11 1 our @ISA = qw(Exporter);
12  
13 1 our @EXPORT = qw(
14 decode_text
15 );
16 1 our $VERSION = '0.01';
17  
18  
19  
20 0 ▶sub decode_text($) {
Subroutine decode_text: not called CC=2 SCAR=17.9
Pod undocumented
21 0 my $s = shift;
22 0 my $ret = '';
23 0 local ($/) = undef;
24
25 0 my @ar = split ' ', $s;
26 0 foreach my $substr (@ar) {
27 0 $ret .= __decode($substr);
28 }
29  
30 0 return $ret;
31 }
32  
33 0 ▶sub __decode($) {
Subroutine __decode: not called CC=3 SCAR=24.8
34 0 my $s = shift;
35 0 my $ret = $s;
36 0 local ($/) = undef;
37  
38 0 $s =~ /=\?(.+)?\?(.)\?/;
39 0 my ($encoding,$type) = ($1,$2);
40
41 0 $s =~ s/=\?.+?\?$type\?(.*)\?=/$1/g;
42  
43 0 ▶ if ( $type eq 'q' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($type eq 'q') { } 0 0 0
elsif ($type eq 'B') { } 0 0 0
44 0 $s =~ s/_/ /g;
45 0 $ret = decode_qp($s);
46 } elsif ( $type eq 'B' ) {
47 0 $ret = decode_base64($s);
48 } else {
49 0 $ret = "$s ";
50 }
51  
52 0 return $ret;
53 }
54  
55 1 1;
56 __END__
↑ Summary