| 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
| |||||||||||
| 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
| |||||||||||
| 25 | } | ||||||||||
| 26 | 0 | } | |||||||||
| 27 | |||||||||||
| 28 | 1 | 1 | |||||||||
| 29 | |||||||||||