GIN/Query/Manual.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 88.1% 37 / 42 CC 3 SCAR 4.0
CC
3
Cov
91%
consistent
2.1
extract_values
2.0
BEGIN
1.0
CRAP 1.5
« GIN/Extract/Attributes.pm ↑ Summary GIN/Core.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Search::GIN::Query::Manual;
4 # ABSTRACT: Create manual GIN queries
5  
6 1 our $VERSION = '0.11';
7  
8 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 with qw(
12 Search::GIN::Query
13 Search::GIN::Keys::Deep
14 );
15  
16 1 has method => (
17 isa => "Str",
18 is => "ro",
19 predicate => "has_method",
20 );
21  
22 1 has values => (
23 isa => "Any",
24 is => "ro",
25 required => 1,
26 );
27  
28 1 has _processed => (
29 is => "ro",
30 lazy_build => 1,
31 );
32  
33 1 has filter => (
34 isa => "CodeRef|Str",
35 is => "ro",
36 );
37  
38 1 ▶sub _build__processed {
Subroutine _build__processed: called CC=1 SCAR=0.0
39 1 my $self = shift;
40 1 return [ $self->process_keys( $self->values ) ];
41 }
42  
43 1 ▶sub extract_values {
Subroutine extract_values: called CC=2 SCAR=7.1
Pod undocumented
44 1 my $self = shift;
45 1 my $EMPTY = q{};
46  
47 return (
48 1 ▶ values => $self->_processed,
Branch: 1 branch
BranchTrueFalseTotal
$self->has_method ? : 0 1 1
49 method => $self->has_method ? $self->method : $EMPTY,
50 );
51 }
52  
53 1 ▶sub consistent {
Subroutine consistent: called CC=2 SCAR=7.6
Pod undocumented
54 1 my ( $self, $index, $obj ) = @_;
55  
56 1 ▶ if ( my $filter = $self->filter ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $filter = $self->filter) { } 0 1 1
57 0 return $obj->$filter;
58 } else {
59 1 return 1;
60 }
61 }
62  
63 1 __PACKAGE__->meta->make_immutable;
64  
65 1 1;
66  
67 __END__
« GIN/Extract/Attributes.pm ↑ Summary GIN/Core.pm »