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 CC 3 SCAR 5.6
CC
3
Cov
100%
valid_args
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Number/Tolerant/Type/infinite.pm ↑ Summary Number/Tolerant/Constant.pm »
1 25 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 25 ▶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 25 ▶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 18 ▶sub parse {
Subroutine parse: called CC=1 SCAR=0.0
Pod documented
12 18 my $self = shift;
13 18 return $self->normalize_number($_[0]);
14 }
15  
16 100 ▶sub valid_args {
Subroutine valid_args: called CC=3 SCAR=11.0
Pod documented
17 100 my $self = shift;
18  
19 100 my $number = $self->normalize_number($_[0]);
20  
21 100 ▶ return unless defined $number;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $number 18 82 100
22  
23 82 ▶ return $number if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 4 78 82
24  
25 78 return;
26 }
27  
28 25 1;
29  
30 __END__
« Number/Tolerant/Type/infinite.pm ↑ Summary Number/Tolerant/Constant.pm »