Util/Underscore/Numbers.pm

filter: Statementstmt 100% 12 / 12 Branchbran 100% 4 / 4 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 4 / 4 Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 33 / 33 CC 5 SCAR 7.4
CC
5
Cov
100%
is_int
3.0
is_uint
3.0
BEGIN
1.0
CRAP 2.1
« Util/Underscore/Scalars.pm ↑ Summary Util/Underscore/Objects.pm »
1 package Util::Underscore::Numbers;
2  
3 #ABSTRACT: Functions for dealing with numbers
4  
5 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 ## no critic (ProhibitMultiplePackages)
10 package # hide from PAUSE
11 _;
12  
13 ## no critic (RequireArgUnpacking, RequireFinalReturn, ProhibitSubroutinePrototypes)
14  
15 sub is_numeric(_) {
16 27 ▶ goto &Scalar::Util::looks_like_number;
Subroutine is_numeric: called CC=1 SCAR=0.0
17 }
18  
19 sub is_int(_) {
20 ## no critic (ProhibitEnumeratedClasses)
21 14 ▶ defined $_[0]
Subroutine is_int: called CC=3 SCAR=11.0
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0] and not defined &ref_type($_[0]) and scalar $_[0] =~ /\A [-]? [0-9]+ \z/msx 11 3 14
Condition100%3/3
defined $_[0] and not defined &ref_type($_[0])
!ll&&!rl&&r
2111
MC/DC100%2/2
defined $_[0] and not defined &ref_type($_[0])
defined $_[0] not defined &ref_type($_[0])
Truth table100%3/3
A and not(B)
A= defined $_[0]B= not defined &ref_type($_[0])
ABresult
0X0
100
111
22 && !defined ref_type $_[0]
23 && scalar($_[0] =~ /\A [-]? [0-9]+ \z/xsm);
24 }
25  
26 sub is_uint(_) {
27 ## no critic (ProhibitEnumeratedClasses)
28 14 ▶ defined $_[0]
Subroutine is_uint: called CC=3 SCAR=11.0
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0] and not defined &ref_type($_[0]) and scalar $_[0] =~ /\A [0-9]+ \z/msx 11 3 14
Condition100%3/3
defined $_[0] and not defined &ref_type($_[0])
!ll&&!rl&&r
2111
MC/DC100%2/2
defined $_[0] and not defined &ref_type($_[0])
defined $_[0] not defined &ref_type($_[0])
Truth table100%3/3
A and not(B)
A= defined $_[0]B= not defined &ref_type($_[0])
ABresult
0X0
100
111
29 && !defined ref_type $_[0]
30 && scalar($_[0] =~ /\A [0-9]+ \z/xsm);
31 }
32  
33 sub ceil(_) {
34 10 ▶ goto &POSIX::ceil;
Subroutine ceil: called CC=1 SCAR=0.0
35 }
36  
37 sub floor(_) {
38 10 ▶ goto &POSIX::floor;
Subroutine floor: called CC=1 SCAR=0.0
39 }
40  
41 12 1;
42  
43 __END__
« Util/Underscore/Scalars.pm ↑ Summary Util/Underscore/Objects.pm »