Number/Tolerant/Type/constant.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 32 / 32 SCAR 11.0
CC
3
Cov
100%
valid_args
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Number/Tolerant/Constant.pm ↑ Summary
1 26 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 26 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 # ABSTRACT: a tolerance "m == n"
4  
5 package
6 Number::Tolerant::Type::constant;
7 26 ▶use parent qw(Number::Tolerant::Type);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶sub construct { shift; $_[0] }
Subroutine construct: called CC=1 SCAR=0.0
Pod documented
10  
11 sub parse {
12 21 ▶ my $self = shift;
Subroutine parse: called CC=1 SCAR=0.0
Pod documented
13 21 return $self->normalize_number($_[0]);
14 }
15  
16 sub valid_args {
17 90 ▶ my $self = shift;
Subroutine valid_args: called CC=3 SCAR=11.0
Pod documented
18  
19 90 my $number = $self->normalize_number($_[0]);
20  
21 90 ▶ return unless defined $number;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $number 16 74 90
22  
23 74 ▶ return $number if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 4 70 74
24  
25 70 return;
26 }
27  
28 26 1;
29  
30 __END__
« Number/Tolerant/Constant.pm ↑ Summary