lib/File/Rename/Unicode.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 100% 37 / 37 CC 3 SCAR 5.1
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« script/unsafe-rename ↑ Summary
1 package File::Rename::Unicode;
2
3 3 ▶use 5.032; # use 5.012;
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 3 ▶use Encode qw(encode decode);
Subroutine BEGIN: called CC=1 SCAR=0.0
9
10 3 our $VERSION = '1.30';
11
12 3 ▶sub code {
Subroutine code: called CC=1 SCAR=0.0
Pod documented
13 3 my $code = shift;
14 3 my $encoding = shift;
15 return
16 3 ▶ sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
17 3 ▶ use feature 'unicode_strings';
Subroutine BEGIN: called CC=1 SCAR=0.0
18 3 ▶ if ( $encoding ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($encoding) { } 1 2 3
19 1 $_ = decode($encoding, $_);
20 }
21 else {
22 2 utf8::upgrade $_;
23 }
24 3 $code->();
25 3 ▶ if ( $encoding ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($encoding) 1 2 3
26 1 $_ = encode($encoding, $_);
27 }
28 3 };
29 }
30
31 3 1;
32
33 __END__
« script/unsafe-rename ↑ Summary