Pad/Type/Float.pm

filter: Statementstmt 100% 25 / 25 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 100% 36 / 36 CC 3 SCAR 5.6
CC
3
Cov
100%
checkFormat
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Pad/Spec/Level.pm ↑ Summary Pad/Type/File.pm »
1 18 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 18 ▶use Object::Pad;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 18 ▶use Getopt::Pad::Type::Number;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 class Getopt::Pad::Type::Float :isa(Getopt::Pad::Type::Number) :strict(params) {
7 18 ▶ use Scalar::Util qw(looks_like_number);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 18 our $VERSION = '0.04';
10  
11 18 ▶ use constant NAMES => ['f', 'float', 'num', 'number'];
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 ▶ method checkFormat($value) {
Subroutine checkFormat: called CC=3 SCAR=11.0
Pod documented
14 4 ▶ return sprintf("'%s' is not a number", $value) if !looks_like_number($value);
Branch: 1 branch
BranchTrueFalseTotal
unless &looks_like_number($value) 1 3 4
15 3 ▶ return sprintf("'%s' is not a finite number", $value) if $value =~ /\A\s*[+-]?(?:inf(?:inity)?|nan)\s*\z/i;
Branch: 1 branch
BranchTrueFalseTotal
if $value =~ /\A\s*[+-]?(?:inf(?:inity)?|nan)\s*\z/iu 2 1 3
16 1 return undef;
17 18 }
18 }
19  
20 18 1;
21  
22 __END__
« Pad/Spec/Level.pm ↑ Summary Pad/Type/File.pm »