blib/lib/HTML/Escape/PurePerl.pm

filter: Statementstmt 100% 17 / 17 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 88.4% 23 / 26 CC 2 SCAR 3.4
CC
2
Cov
90%
escape_html
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« _build/lib/MyBuilder.pm ↑ Summary blib/lib/HTML/Escape.pm »
1 package HTML::Escape::PurePerl;
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 utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶die qq{Don't use HTML::Escape::PurePerl directly, use HTML::Escape instead.\n} # ' for poor editors
Branch: 1 branch
BranchTrueFalseTotal
if caller() ne "HTML::Escape" 0 1 1
7 if caller() ne 'HTML::Escape';
8  
9 package # do not index, pause.
10 HTML::Escape;
11  
12 1 our %_escape_table = ( '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', q{"} => '&quot;', q{'} => '&#39;', q{`} => '&#96;', '{' => '&#123;', '}' => '&#125;' );
13 sub escape_html {
14 5 ▶ my $str = shift;
Subroutine escape_html: called CC=2 SCAR=7.0
Pod undocumented
15 5 ▶ return ''
Branch: 1 branch
BranchTrueFalseTotal
unless defined $str 0 5 5
16 unless defined $str;
17 5 $str =~ s/([&><"'`{}])/$_escape_table{$1}/ge; #' for poor editors
18 5 return $str;
19 }
20  
21 1 1;
22  
« _build/lib/MyBuilder.pm ↑ Summary blib/lib/HTML/Escape.pm »