ReplacePictogramMobileJp/EZweb.pm

filter: Statementstmt 100% 29 / 29 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 38 / 38 CC 2 SCAR 2.2
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« ReplacePictogramMobileJp/Base.pm ↑ Summary ReplacePictogramMobileJp.pm »
1 package HTML::ReplacePictogramMobileJp::EZweb;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use HTML::ReplacePictogramMobileJp::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Encode;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Encode::JP::Mobile ':props';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶filter utf8 => 'x-utf8-kddi', sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
9 3 unicode_property 'E';
10 3 unicode_hex_cref 'E';
11 3 img_localsrc 'E';
12 3 };
13  
14 # とりあえず KDDI-Auto をつかう.どっちにするべき?
15 4 ▶filter sjis => 'x-sjis-kddi-auto', sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
16 4 s/&#x([0-9A-F]{4});/
17 2 my $original = $1;
18 # hex cref でドコモの絵文字も表示できる(sjis)
19 2 my $x = decode('cp932', pack 'H*', $original);
20 2 ▶ if ($x =~ m{(\p{InDoCoMoPictograms})}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($x =~ /(\p{InDoCoMoPictograms})/) { } 1 1 2
21 1 HTML::ReplacePictogramMobileJp::Base::callback(ord decode('x-utf8-kddi', encode('x-utf8-kddi', $1)), 'E')
22 } else {
23 1 callback(hex $original, 'E')
24 }
25 /ge;
26  
27 4 img_localsrc 'E';
28  
29 4 unicode_property 'E';
30 3 };
31  
32 3 1;
« ReplacePictogramMobileJp/Base.pm ↑ Summary ReplacePictogramMobileJp.pm »