blib/lib/DR/R.pm

filter: Statementstmt 100% 40 / 40 Branchbran 91.6% 11 / 12 Conditioncond 75.0% 3 / 4 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 95.4% 63 / 66 CC 10 SCAR 14.8
CC
10
Cov
96%
select
7.0
__ANON__
4.0
BEGIN
1.0
CRAP 4.4
↑ Summary rtree/small/matras.h »
1 package DR::R;
2  
3 5 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 our $VERSION = '0.03';
10  
11 5 require XSLoader;
12 5 XSLoader::load('DR::R', $VERSION);
13  
14 6 ▶sub select :method {
Subroutine select: called CC=7 SCAR=19.5
Pod documented
15 6 my ($self, $type, $point_or_rect, %opts) = @_;
16  
17 6 ▶ my $offset = $opts{offset} || 0;
Condition100%2/2
$opts{'offset'} || 0
l!l
15
MC/DC100%1/1
$opts{'offset'} || 0
$opts{'offset'}
Truth table100%2/2
A
A= $opts{'offset'}
Aresult
11
00
18 6 my $limit = $opts{limit};
19 6 my @result;
20  
21 6 my $type_ok = 0;
22 6 ▶ $type //= '';
Condition50%1/2
$type //= ""
l!l
60
MC/DC0%0/1
$type //= ""
$type
Truth table50%1/2
A
A= $type
Aresult
11
00
23 6 for (@{ $self->iterator_types }) {
24 48 ▶ if ($type eq $_) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type eq $_) 5 43 48
25 5 $type_ok = 1;
26 5 last;
27 }
28 }
29 6 ▶ croak "Unknown iterator type: '$type'" unless $type_ok;
Branch: 1 branch
BranchTrueFalseTotal
unless $type_ok 1 5 6
30 5 ▶ unless ($self->is_point_or_rect($point_or_rect)) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->is_point_or_rect($point_or_rect)) 3 2 5
31 3 croak "Invalid point or rect";
32 }
33  
34  
35 21 ▶ $self->foreach($type, $point_or_rect, sub {
Subroutine __ANON__: called CC=4 SCAR=13.9
36 21 my ($o, $id, $toffset) = @_;
37  
38 21 ▶ return if $toffset < $offset;
Branch: 1 branch
BranchTrueFalseTotal
if $toffset < $offset 1 20 21
39 20 push @result => $o;
40 20 ▶ return unless defined $limit;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $limit 0 20 20
41 20 ▶ return if @result < $limit;
Branch: 1 branch
BranchTrueFalseTotal
if @result < $limit 18 2 20
42 2 return 0;
43 2 });
44 2 return \@result;
45 }
46  
47 5 1;
48 __END__
↑ Summary rtree/small/matras.h »