lib/App/ElasticSearch/Utilities/QueryString/BareWords.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 96.8% 31 / 32 CC 2 SCAR 2.2
CC
2
Cov
100%
handle_token
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« script/es-open.pl ↑ Summary
1 package App::ElasticSearch::Utilities::QueryString::BareWords;
2 # ABSTRACT: Mostly fixing case and tracking dangling words
3  
4 2 ▶use v5.16;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION = '9.1'; # VERSION
8  
9 2 ▶use CLI::Helpers qw(:output);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 with 'App::ElasticSearch::Utilities::QueryString::Plugin';
14  
15 1 ▶sub _build_priority { 1; }
Subroutine _build_priority: called CC=1 SCAR=0.0
16  
17 1 my %BareWords = (
18 and => { query_string => 'AND', invert => 0, dangles => 1 },
19 or => { query_string => 'OR', invert => 0, dangles => 1 },
20 not => { query_string => 'NOT', invert => 1, dangles => 1 },
21 );
22  
23  
24 22 ▶sub handle_token {
Subroutine handle_token: called CC=2 SCAR=6.9
Pod undocumented
25 22 my ($self,$token) = @_;
26  
27 22 debug(sprintf "%s - evaluating token '%s'", $self->name, $token);
28 22 ▶ return exists $BareWords{lc $token} ? [$BareWords{lc $token}] : undef;
Branch: 1 branch
BranchTrueFalseTotal
exists $BareWords{lc $token} ? : 6 16 22
29 }
30  
31 # Return True;
32 1 1;
33  
34 __END__
« script/es-open.pl ↑ Summary