Template/ESCAPE/URL.pm

filter: Statementstmt 100% 21 / 21 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 93.5% 29 / 31 CC 4 SCAR 9.2
CC
4
Cov
96%
output
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.5
« Template/ESCAPE/DOUBLE_QUOTE.pm ↑ Summary Template/ESCAPE/JS.pm »
1 package HTML::Template::ESCAPE::URL;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use base qw(HTML::Template::ESCAPE);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use vars qw(%MAP);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 our $VERSION = '2.9';
7  
8 24 ▶sub output {
Subroutine output: called CC=4 SCAR=13.9
Pod undocumented
9 24 my $self = shift;
10 24 ▶ $_ = shift if (@_ > 0);
Branch: 1 branch
BranchTrueFalseTotal
if @_ > 0 24 0 24
11  
12 # Build a char->hex map if one isn't already available
13 24 ▶ unless (exists($MAP{chr(1)})) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $HTML::Template::ESCAPE::URL::MAP{"\1"}) 2 22 24
14 2 for (0..255) { $MAP{chr($_)} = sprintf('%%%02X', $_); }
15 }
16  
17 # do the translation (RFC 2396 ^uric)
18 24 s!([^a-zA-Z0-9_.\-])!$MAP{$1}!g;
19  
20 24 $_;
21 }
22  
23 4 1;
« Template/ESCAPE/DOUBLE_QUOTE.pm ↑ Summary Template/ESCAPE/JS.pm »