Range/Search/Liner.pm

filter: Statementstmt 100% 17 / 17 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 100% 26 / 26 CC 3 SCAR 6.2
CC
3
Cov
100%
find
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.9
« Range.pm ↑ Summary
1 package List::Range::Search::Liner;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use Class::Accessor::Lite ro => [qw/ranges/];
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
8 1 my ($class, $set) = @_;
9 1 return bless {
10 ranges => $set->ranges,
11 } => $class;
12 }
13  
14 7 ▶sub find {
Subroutine find: called CC=3 SCAR=11.0
Pod documented
15 7 my ($self, $value) = @_;
16  
17 7 for my $range (@{ $self->{ranges} }) {
18 20 ▶ return $range if $range->includes($value)
Branch: 1 branch
BranchTrueFalseTotal
if $range->includes($value) 6 14 20
19 }
20  
21 # not found
22 1 return undef; ## no critic
23 }
24  
25 2 1;
26 __END__
« Range.pm ↑ Summary