blib/lib/Net/IDN/Nameprep.pm

filter: Statementstmt 100% 33 / 33 Branchbran 100% 2 / 2 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 100% 1 / 1 totaltotal 100% 49 / 49 CC 3 SCAR 4.7
CC
3
Cov
100%
nameprep
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
↑ Summary
1 package Net::IDN::Nameprep;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = "1.102";
8 2 $VERSION = eval $VERSION;
9  
10 2 require Exporter;
11 2 our @ISA = qw(Exporter);
12 2 our @EXPORT = qw(nameprep);
13  
14 2 ▶use Unicode::Stringprep 1.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 2 ▶use Unicode::Stringprep::Mapping;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 2 ▶use Unicode::Stringprep::Prohibited;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 2 our $_nameprep_stored;
20 2 our $_nameprep_query;
21  
22 47 ▶sub nameprep {
Subroutine nameprep: called CC=3 SCAR=11.0
Pod documented
23 47 my ($input, %param) = @_;
24 47 ▶ if (
Branch: 1 branch
BranchTrueFalseTotal
if (not exists $param{'AllowUnassigned'} or $param{'AllowUnassigned'}) { } 46 1 47
Condition100%3/3
not exists $param{"AllowUnassigned"} or $param{"AllowUnassigned"}
l!l&&r!l&&!r
4511
MC/DC100%2/2
not exists $param{"AllowUnassigned"} or $param{"AllowUnassigned"}
not exists $param{"AllowUnassigned"} $param{"AllowUnassigned"}
Truth table100%3/3
not(A) or B
A= not exists $param{"AllowUnassigned"}B= $param{"AllowUnassigned"}
ABresult
1X1
011
000
25 !exists($param{'AllowUnassigned'})
26 || $param{'AllowUnassigned'}
27 ) {
28 46 goto &$_nameprep_query;
29 } else {
30 1 goto &$_nameprep_stored;
31 }
32 }
33  
34 2 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
35 2 my @_common_args = (
36 3.2,
37 [
38 @Unicode::Stringprep::Mapping::B1,
39 @Unicode::Stringprep::Mapping::B2
40 ],
41 'KC',
42 [
43 @Unicode::Stringprep::Prohibited::C12,
44 @Unicode::Stringprep::Prohibited::C22,
45 @Unicode::Stringprep::Prohibited::C3,
46 @Unicode::Stringprep::Prohibited::C4,
47 @Unicode::Stringprep::Prohibited::C5,
48 @Unicode::Stringprep::Prohibited::C6,
49 @Unicode::Stringprep::Prohibited::C7,
50 @Unicode::Stringprep::Prohibited::C8,
51 @Unicode::Stringprep::Prohibited::C9
52 ],
53 1,
54 );
55  
56 2 our $_nameprep_stored = Unicode::Stringprep->new(
57 @_common_args,
58 1,
59 );
60  
61 2 our $_nameprep_query = Unicode::Stringprep->new(
62 @_common_args,
63 0,
64 );
65 }
66  
67 2 1;
68 __END__
↑ Summary