TypeInference/Type/Number.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.1% 32 / 34 CC 3 SCAR 5.6
CC
3
Cov
100%
accepts
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« TypeInference.pm ↑ Summary TypeInference/Type/String.pm »
1 package JSON::TypeInference::Type::Number;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use parent qw(JSON::TypeInference::Type::Atom);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Scalar::Util qw(looks_like_number);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶sub name {
Subroutine name: called CC=1 SCAR=0.0
Pod undocumented
9 5 my ($class) = @_;
10 5 return 'number';
11 }
12  
13 33 ▶sub accepts {
Subroutine accepts: called CC=3 SCAR=11.0
Pod undocumented
14 33 my ($class, $data) = @_;
15 33 ▶ return !ref($data) && defined($data) && looks_like_number($data);
Condition100%6/6
!ref($data) && defined $data && &looks_like_number($data)
!ll&&!rl&&r
11517
not ref $data and defined $data
!ll&&!rl&&r
10122
MC/DC100%3/3
!ref($data) && defined $data && &looks_like_number($data)
not ref $data defined $data &looks_like_number($data)
Truth table100%4/4
not(A) and B && C
A= not ref $dataB= defined $dataC= &looks_like_number($data)
ABCresult
0XX0
10X0
1100
1111
16 }
17  
18 4 1;
19 __END__
« TypeInference.pm ↑ Summary TypeInference/Type/String.pm »