lib/JMAP/Validation/Checks/Number.pm

filter: Statementstmt 71.4% 15 / 21 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 66.6% 4 / 6 Podpod n/a totaltotal 55.8% 19 / 34 SCAR 16.9
CC
4
Cov
56%
__ANON__
12.0
__ANON__
6.0
BEGIN
1.0
CRAP 5.4
« blib/lib/JMAP/Validation/Generators/ContactGroup.pm ↑ Summary lib/JMAP/Validation/Generators/ContactInformation.pm »
1 package JMAP::Validation::Checks::Number;
2  
3 1 ▶use JMAP::Validation;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use JMAP::Validation::Tests::Number;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Test2::Bundle::Extended;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use JSON::Typist;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 our $is_number = validator(sub {
10 0 ▶ my (%params) = @_;
Subroutine __ANON__: not called CC=2 SCAR=17.9
11  
12 0 ▶ return (ref($params{got}) || '') eq 'JSON::Typist::Number';
Condition0%0/2
ref $params{'got'} || ''
l!l
00
MC/DC0%0/1
ref $params{'got'} || ''
ref $params{'got'}
Truth table0%0/2
A
A= ref $params{'got'}
Aresult
11
00
13 1 });
14  
15 our $is_number_or_null = validator(sub {
16 0 ▶ my (%params) = @_;
Subroutine __ANON__: not called CC=3 SCAR=24.8
17  
18 0 ▶ if (defined $params{got}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $params{"got"}) 0 0 0
19 return unless JMAP::Validation::validate(
20 $params{got},
21 0 ▶ $is_number,
Branch: 1 branch
BranchTrueFalseTotal
unless JMAP::Validation::validate($params{"got"}, $JMAP::Validation::Checks::Number::is_number) 0 0 0
22 );
23 }
24  
25 0 return 1;
26 1 });
27  
28 1 1;
« blib/lib/JMAP/Validation/Generators/ContactGroup.pm ↑ Summary lib/JMAP/Validation/Generators/ContactInformation.pm »