Multibyte/GBK.pm

filter: Statementstmt 38.4% 5 / 13 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod n/a totaltotal 21.4% 6 / 28 CC 7 SCAR 37.8
CC
7
Cov
20%
__ANON__
56.0
__ANON__
2.0
BEGIN
1.0
CRAP 43.9
« Multibyte/Big5Plus.pm ↑ Summary Multibyte/UTF8.pm »
1 package String::Multibyte::GBK;
2  
3 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 $VERSION = '1.12';
5  
6 +{
7 charset => 'GBK',
8  
9 regexp => '(?:[\x00-\x80]|[\x81-\xFE][\x40-\x7E\x80-\xFE])',
10  
11 0 ▶ cmpchar => sub { $_[0] cmp $_[1] },
Subroutine __ANON__: not called CC=1 SCAR=6.9
12  
13 0 ▶ nextchar => sub {
Subroutine __ANON__: not called CC=7 SCAR=40.3
14 0 my $ch = shift;
15 0 my $len = length $ch;
16 0 ▶ if ($len == 1) {
Branch: 2 branches
BranchTrueFalseTotal
if ($len == 1) { } 0 0 0
elsif ($len == 2) { } 0 0 0
17 0 ▶ return $ch eq "\x80"
Branch: 1 branch
BranchTrueFalseTotal
$ch eq "\200" ? : 0 0 0
18 ? "\x81\x40"
19 : chr(ord($ch)+1);
20 }
21 elsif ($len == 2) {
22 0 my($c, $d) = unpack('CC', $ch);
23 0 ▶ return $ch eq "\xFE\xFE"
Branch: 3 branches
BranchTrueFalseTotal
$ch eq "\376\376" ? : 0 0 0
$d == 254 ? : 0 0 0
$d == 126 ? : 0 0 0
24 ? undef
25 : $d == 0xFE
26 ? chr($c+1)."\x40"
27 : $d == 0x7E
28 ? chr($c) ."\x80"
29 : pack('CC', $c, $d+1);
30 }
31 else {
32 0 return;
33 }
34 },
35 1 };
36  
37 __END__
« Multibyte/Big5Plus.pm ↑ Summary Multibyte/UTF8.pm »