Guess/Role/Unicode.pm

filter: Statementstmt 87.8% 29 / 33 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 81.8% 9 / 11 Podpod 0.0% 0 / 1 totaltotal 79.5% 39 / 49 CC 3 SCAR 6.7
CC
3
Cov
81%
__ANON__
6.0
_length
2.0
to_sub
1.3
CRAP 1.9
« split_collated.pl ↑ Summary
1 package Type::Guess::Role::Unicode;
2  
3 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Text::VisualPrintf qw/vprintf vsprintf/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Text::VisualWidth::PP qw/vwidth/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use List::Util qw/max/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Encode qw/decode encode/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 use overload
12 1 ▶ '&{}' => \&to_sub;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 3 ▶sub _length {
Subroutine _length: called CC=2 SCAR=7.0
15 3 my $class = shift();
16 3 ▶ return max map { local $_ = utf8::is_utf8($_) ? $_ : decode("UTF-8", $_); vwidth($_) } @_;
Branch: 1 branch
BranchTrueFalseTotal
utf8::is_utf8($_) ? : 0 15 15
17 }
18  
19 0 ▶sub to_sub {
Subroutine to_sub: not called CC=1 SCAR=2.6
Pod undocumented
20 0 my $self = shift;
21 0 my $format = $self->to_string;
22 1 ▶ no warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 0 ▶ return sub {
Subroutine __ANON__: not called CC=2 SCAR=17.9
24 0 ▶ return encode "UTF-8", vsprintf $format, utf8::is_utf8($_[0]) ? $_ : decode("UTF-8", $_[0]);
Branch: 1 branch
BranchTrueFalseTotal
utf8::is_utf8($_[0]) ? : 0 0 0
25 }
26 0 }
27  
28 1 1
29  
« split_collated.pl ↑ Summary