Data/FormValidator/Constraints/Business/DK/Phonenumber.pm

filter: Statementstmt 88.5% 31 / 35 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 90.0% 9 / 10 Podpod 100% 2 / 2 totaltotal 86.2% 44 / 51 CC 3 SCAR 6.9
CC
3
Cov
85%
match_dk_phonenumber
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 2.0
« Business/DK/Phonenumber.pm ↑ Summary
1 package Data::FormValidator::Constraints::Business::DK::Phonenumber;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use vars qw($VERSION @EXPORT_OK);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Business::DK::Phonenumber qw(validate render);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use base qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 $VERSION = '0.10';
10 3 @EXPORT_OK = qw(valid_dk_phonenumber match_dk_phonenumber);
11  
12 3 ▶use constant VALID => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use constant INVALID => undef;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 4 ▶sub valid_dk_phonenumber {
Subroutine valid_dk_phonenumber: called CC=1 SCAR=0.0
Pod documented
16 6 ▶ return sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
17 6 my $dfv = shift;
18  
19 6 $dfv->name_this('valid_dk_phonenumber');
20  
21 6 my $phonenumber = $dfv->get_current_constraint_value();
22  
23 6 ▶ if ( validate($phonenumber) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (validate($phonenumber)) { } 4 2 6
24 4 return VALID;
25 } else {
26 2 return INVALID;
27 }
28 }
29 4 }
30  
31 0 ▶sub match_dk_phonenumber {
Subroutine match_dk_phonenumber: not called CC=2 SCAR=17.9
Pod documented
32 0 my ( $dfv, $format ) = @_;
33  
34 0 ▶ my $phonenumber = ref $dfv ? $dfv->get_current_constraint_value : $dfv;
Branch: 1 branch
BranchTrueFalseTotal
ref $dfv ? : 0 0 0
35  
36 0 my ($untainted_phonenumber) = render($phonenumber);
37  
38 0 return $untainted_phonenumber;
39 }
40  
41 3 1;
42  
43 __END__
« Business/DK/Phonenumber.pm ↑ Summary