NLPPlatform/XMLEntities.pm

filter: Statementstmt 40.0% 8 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 50.0% 1 / 2 totaltotal 42.3% 11 / 26 CC 1 SCAR 4.1
CC
1
Cov
40%
encode
2.0
decode
2.0
BEGIN
1.0
CRAP 1.5
« NLPPlatform/UserNLPWrappers-template.pm ↑ Summary NLPPlatform/Annotation.pm »
1 package Alvis::NLPPlatform::XMLEntities;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 our $VERSION=$Alvis::NLPPlatform::VERSION;
7  
8 sub encode
9 0 ▶{
Subroutine encode: not called CC=1 SCAR=6.9
Pod documented
10 0 $_[0]=~s/&/&/g;
11 0 $_[0]=~s/\"/"/g;
12 0 $_[0]=~s/\'/'/g;
13 0 $_[0]=~s/</&lt;/g;
14 0 $_[0]=~s/>/&gt;/g;
15 }
16  
17  
18  
19  
20 sub decode
21 0 ▶{
Subroutine decode: not called CC=1 SCAR=6.9
Pod undocumented
22 0 my $shift_offset = 0;
23  
24 0 $shift_offset += ($_[0]=~s/&quot;/\"/g) * 5;
25 0 $shift_offset += ($_[0]=~s/&apos;/\'/g) * 5;
26 0 $shift_offset += ($_[0]=~s/&amp;/&/g) * 4;
27 0 $shift_offset += ($_[0]=~s/&lt;/</g) * 3;
28 0 $shift_offset += ($_[0]=~s/&gt;/>/g) * 3;
29 0 return($shift_offset);
30 }
31  
32  
33 4 1;
34  
35 __END__
« NLPPlatform/UserNLPWrappers-template.pm ↑ Summary NLPPlatform/Annotation.pm »