blib/lib/Encode/MAB2.pm

filter: Statementstmt 86.6% 26 / 30 Branchbran 37.5% 3 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 100% 2 / 2 totaltotal 78.7% 37 / 47 CC 5 SCAR 13.6
CC
5
Cov
76%
decode
7.2
needs_lines
2.0
BEGIN
1.0
CRAP 3.9
« blib/lib/MAB2/Record/Base.pm ↑ Summary blib/lib/Tie/MAB2/Dualdb/Recno.pm »
1 package Encode::MAB2;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 our $VERSION = "0.09"; # must stay in sync with Encode::MAB2table
5  
6 2 ▶use Encode ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Encode::MAB2table;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Unicode::Normalize qw(NFC);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use base qw(Encode::Encoding);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 2 __PACKAGE__->Define('MAB2', 'mab2');
12  
13 0 ▶sub needs_lines {1}
Subroutine needs_lines: not called CC=1 SCAR=6.9
Pod documented
14  
15 2 our $combinings = qr/[\xc0-\xdb\xdd-\xdf]/;
16 3 ▶sub decode {
Subroutine decode: called CC=5 SCAR=19.7
Pod documented
17 3 my($obj, $str, $chk) = @_;
18 3 ▶ return unless defined $str;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $str 0 3 3
19 3 $str =~ s{\xcd\xc9}{\xcd}g; # Fehler bei Heged"us, Erd"os und Mez"o
20 3 ▶ $str =~ s{($combinings+)(.)}{($2 eq "\xf5" ? "i" : $2) . $1}ge; #};
Branch: 1 branch
BranchTrueFalseTotal
$2 eq "\365" ? : 0 9 9
21 3 ▶ if ($chk) {
Branch: 1 branch
BranchTrueFalseTotal
if ($chk) 0 3 3
22 0 ▶ if ($str =~ s/($combinings+)\z//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($str =~ s/($Encode::MAB2::combinings+)\z//) { } 0 0 0
23 0 $_[1] = $1; # we have 'sub needs_lines {1}', so this should
24 # never happen
25 } else {
26 0 $_[1] = '';
27 }
28 }
29 3 NFC(Encode::decode("MAB2table",$str));
30 }
31  
32 2 1;
33 __END__
« blib/lib/MAB2/Record/Base.pm ↑ Summary blib/lib/Tie/MAB2/Dualdb/Recno.pm »