Number/Tolerant/Type/infinite.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 4 / 4 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 40 / 40 CC 5 SCAR 8.8
CC
5
Cov
100%
valid_args
4.0
parse
2.0
BEGIN
1.0
CRAP 2.4
« Number/Tolerant/Type/or_more.pm ↑ Summary Number/Tolerant/Type/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: an infinite tolerance
4  
5 package
6 Number::Tolerant::Type::infinite;
7 25 ▶use parent qw(Number::Tolerant::Type);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 7 ▶sub construct { shift; { value => 0 } }
Subroutine construct: called CC=1 SCAR=0.0
Pod documented
10  
11 21 ▶sub parse {
Subroutine parse: called CC=2 SCAR=6.9
Pod documented
12 21 my ($self, $string, $factory) = @_;
13 21 ▶ return $factory->new('infinite') if $string =~ m!\Aany\s+number\z!;
Branch: 1 branch
BranchTrueFalseTotal
if $string =~ /\Aany\s+number\z/ 1 20 21
14 20 return;
15 }
16  
17 61 ▶sub valid_args { shift;
Subroutine valid_args: called CC=4 SCAR=13.9
Pod documented
18 61 ▶ return ($_[0]) if @_ == 1 and defined $_[0] and $_[0] eq 'infinite';
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 and defined $_[0] and $_[0] eq "infinite" 7 54 61
Condition100%6/6
@_ == 1 and defined $_[0] and $_[0] eq "infinite"
!ll&&!rl&&r
4687
@_ == 1 and defined $_[0]
!ll&&!rl&&r
45115
MC/DC100%3/3
@_ == 1 and defined $_[0] and $_[0] eq "infinite"
@_ == 1 defined $_[0] $_[0] eq "infinite"
Truth table100%4/4
A and B and C
A= @_ == 1B= defined $_[0]C= $_[0] eq "infinite"
ABCresult
0XX0
10X0
1100
1111
19 54 return;
20 }
21  
22 25 1;
23  
24 __END__
« Number/Tolerant/Type/or_more.pm ↑ Summary Number/Tolerant/Type/constant.pm »