| 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
MC/DC100%1/1
$opts{'offset'} || 0
$opts{'offset'}
Truth table100%2/2
A
A= $opts{'offset'}
| |||||||||||||
| 18 | 6 | my $limit = $opts{limit}; | |||||||||||
| 19 | 6 | my @result; | |||||||||||
| 20 | |||||||||||||
| 21 | 6 | my $type_ok = 0; | |||||||||||
| 22 | 6 | ▶ | $type //= ''; | ||||||||||
|
Condition50%1/2
$type //= ""
MC/DC0%0/1
$type //= ""
$type
Truth table50%1/2
A
A= $type
| |||||||||||||
| 23 | 6 | for (@{ $self->iterator_types }) { | |||||||||||
| 24 | 48 | ▶ | if ($type eq $_) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | 5 | $type_ok = 1; | |||||||||||
| 26 | 5 | last; | |||||||||||
| 27 | } | ||||||||||||
| 28 | } | ||||||||||||
| 29 | 6 | ▶ | croak "Unknown iterator type: '$type'" unless $type_ok; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 5 | ▶ | unless ($self->is_point_or_rect($point_or_rect)) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 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
| |||||||||||||
| 39 | 20 | push @result => $o; | |||||||||||
| 40 | 20 | ▶ | return unless defined $limit; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | 20 | ▶ | return if @result < $limit; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 42 | 2 | return 0; | |||||||||||
| 43 | 2 | }); | |||||||||||
| 44 | 2 | return \@result; | |||||||||||
| 45 | } | ||||||||||||
| 46 | |||||||||||||
| 47 | 5 | 1; | |||||||||||
| 48 | __END__ | ||||||||||||