KiokuDB/Backend/Role/Query/GIN.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 90.0% 27 / 30 CC 2 SCAR 2.5
CC
2
Cov
95%
search
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« KiokuDB/Set/Transient.pm ↑ Summary KiokuDB/TypeMap/Entry/Passthrough.pm »
1 #!/usr/bin/perl
2  
3 package KiokuDB::Backend::Role::Query::GIN;
4 1 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 with qw(
9 Search::GIN::Extract
10 Search::GIN::Driver
11 );
12  
13 1 has distinct => (
14 isa => "Bool",
15 is => "rw",
16 default => 0, # FIXME what should the default be?
17 );
18  
19 sub search {
20 3 ▶ my ( $self, $query, @args ) = @_;
Subroutine search: called CC=2 SCAR=7.0
Pod undocumented
21  
22 3 my %args = (
23 distinct => $self->distinct,
24 @args,
25 );
26  
27 3 my @spec = $query->extract_values($self);
28  
29 3 my $ids = $self->fetch_entries(@spec);
30  
31 3 ▶ $ids = unique($ids) if $args{distinct};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"distinct"} 0 3 3
32  
33 3 ▶ return $ids->filter(sub {[ $self->get(@$_) ]});
Subroutine __ANON__: called CC=1 SCAR=0.0
34 }
35  
36 sub search_filter {
37 3 ▶ my ( $self, $objects, $query, @args ) = @_;
Subroutine search_filter: called CC=1 SCAR=0.0
Pod undocumented
38 3 ▶ return $objects->filter(sub { [ grep { $query->consistent($self, $_) } @$_ ] });
Subroutine __ANON__: called CC=1 SCAR=0.0
39 }
40  
41 1 __PACKAGE__
42  
43 __END__
« KiokuDB/Set/Transient.pm ↑ Summary KiokuDB/TypeMap/Entry/Passthrough.pm »