blib/lib/Encode/MAB2.pm

filter: Statementstmt 63.3% 19 / 30 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 55.3% 26 / 47 CC 5 SCAR 26.6
CC
5
Cov
50%
decode
30.0
needs_lines
2.0
BEGIN
1.0
CRAP 14.3
↑ Summary blib/lib/Tie/MAB2/Dualdb.pm »
1 package Encode::MAB2;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 our $VERSION = "0.06";
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 sub decode {
17 0 ▶ my($obj, $str, $chk) = @_;
Subroutine decode: not called CC=5 SCAR=34.0
Pod documented
18 0 ▶ return unless defined $str;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $str 0 0 0
19 0 $str =~ s{\xcd\xc9}{\xcd}g; # Fehler bei Heged"us, Erd"os und Mez"o
20 0 ▶ $str =~ s{($combinings+)(.)}{($2 eq "\xf5" ? "i" : $2) . $1}ge; #};
Branch: 1 branch
BranchTrueFalseTotal
$2 eq "\365" ? : 0 0 0
21 0 ▶ if ($chk) {
Branch: 1 branch
BranchTrueFalseTotal
if ($chk) 0 0 0
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 0 NFC(Encode::decode("MAB2table",$str));
30 }
31  
32 2 1;
33 __END__
↑ Summary blib/lib/Tie/MAB2/Dualdb.pm »