Plugin/Web/MobileCharset.pm

filter: Statementstmt 83.3% 20 / 24 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 1 totaltotal 72.9% 27 / 37 CC 3 SCAR 14.7
CC
3
Cov
71%
__ANON__
12.0
init
1.3
BEGIN
1.0
CRAP 4.3
↑ Summary MobileJP.pm »
1 package Amon2::Plugin::Web::MobileCharset;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use HTTP::MobileAgent::Plugin::Charset;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Encode::JP::Mobile 0.29;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Amon2::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub init {
Subroutine init: called CC=1 SCAR=2.6
Pod undocumented
9 1 my ($class, $c, $conf) = @_;
10  
11 0 ▶ Amon2::Util::add_method($c, 'html_content_type' => sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
12 0 my $ma = shift->mobile_agent;
13 0 ▶ my $ct = $ma->is_docomo ? 'application/xhtml+xml;charset=' : 'text/html;charset=';
Branch: 1 branch
BranchTrueFalseTotal
$ma->is_docomo ? : 0 0 0
14 0 ▶ $ct .= $ma->can_display_utf8 ? 'utf-8' : 'Shift_JIS';
Branch: 1 branch
BranchTrueFalseTotal
$ma->can_display_utf8 ? : 0 0 0
15 0 $ct;
16 1 });
17  
18 1 ▶ Amon2::Util::add_method($c, 'encoding' => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
19 shift->mobile_agent->encoding
20 1 });
21 }
22  
23 1 1;
24 __END__
↑ Summary MobileJP.pm »