TypeInference/Type/String.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/Type/Number.pm ↑ Summary TypeInference/Type/Maybe.pm »
1 package JSON::TypeInference::Type::String;
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 6 ▶sub name {
Subroutine name: called CC=1 SCAR=0.0
Pod undocumented
9 6 my ($class) = @_;
10 6 return 'string';
11 }
12  
13 12 ▶sub accepts {
Subroutine accepts: called CC=3 SCAR=11.0
Pod undocumented
14 12 my ($class, $data) = @_;
15 12 ▶ return !ref($data) && defined($data) && !looks_like_number($data);
Condition100%6/6
!ref($data) && defined $data && !&looks_like_number($data)
!ll&&!rl&&r
615
not ref $data and defined $data
!ll&&!rl&&r
516
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 && not(C)
A= not ref $dataB= defined $dataC= !&looks_like_number($data)
ABCresult
0XX0
10X0
1100
1111
16 }
17  
18 4 1;
19 __END__
« TypeInference/Type/Number.pm ↑ Summary TypeInference/Type/Maybe.pm »