GX/HTML/Util.pm

filter: Statementstmt 57.8% 11 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 100% 1 / 1 totaltotal 57.6% 15 / 26 CC 2 SCAR 11.0
CC
2
Cov
52%
escape_html
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« GX/Request.pm ↑ Summary GX/Class/Singleton.pm »
1 # ----------------------------------------------------------------------------------------------------------------------
2 # GX Framework (c) 2009-2011 Jörg A. Uzarek <uzarek@runlevelnull.de>
3 # File: GX/HTML/Util.pm
4 # ----------------------------------------------------------------------------------------------------------------------
5  
6 package GX::HTML::Util;
7  
8 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 # ----------------------------------------------------------------------------------------------------------------------
13 # Export mechanism
14 # ----------------------------------------------------------------------------------------------------------------------
15  
16 6 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 6 our @EXPORT_OK = qw( escape_html );
19  
20  
21 # ----------------------------------------------------------------------------------------------------------------------
22 # Public functions
23 # ----------------------------------------------------------------------------------------------------------------------
24  
25 0 ▶sub escape_html {
Subroutine escape_html: not called CC=2 SCAR=17.9
Pod documented
26  
27 0 my $string = shift;
28  
29 0 ▶ if ( defined $string ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $string) 0 0 0
30 0 $string =~ s/&/&amp;/g;
31 0 $string =~ s/</&lt;/g;
32 0 $string =~ s/>/&gt;/g;
33 0 $string =~ s/"/&quot;/g;
34 0 $string =~ s/'/&apos;/g;
35 }
36  
37 0 return $string;
38  
39 }
40  
41  
42 6 1;
43  
44 __END__
« GX/Request.pm ↑ Summary GX/Class/Singleton.pm »