Branch Coverage

blib/lib/ElasticSearch/QueryParser.pm
Criterion Covered Total %
branch 153 160 95.6


line true false branch
284 0 194 unless defined $text
299 8 136 unless $$self{'_done'} or $$opts{'fix'}
302 58 136 if ($@)
315 0 0 unless defined $text
332 883 257 if $next
406 255 856 unless my $token = $self->_next_token
410 666 190 if ($$allowed{$type}) { }
17 173 elsif (defined $$allowed{$type}) { }
411 160 506 if $type eq '_SPACE'
415 8 9 unless $$self{'_opts'}{'fix'}
432 173 292 unless (defined $clause)
434 143 9 if @{$$self{'_stack'};} > 1 or not $$self{'_opts'}{'fix'} or $$self{'_done'}
440 28 264 unless length $clause
454 8 37 unless ($$self{'_stack'}[-1]{'clauses'})
455 4 4 if $$opts{'fix'}
458 3 34 unless ($$opts{'allow_bool'})
459 1 2 unless $$opts{'fix'}
464 26 4 if defined $next and length $next
467 2 2 if $$opts{'fix'}
478 3 24 unless ($$opts{'allow_bool'})
479 1 2 unless $$opts{'fix'}
484 4 17 unless defined $next
486 1 20 if $next =~ s/^[+-]+// and not $$opts{'fix'}
489 16 4 if length $next
492 2 2 if $$opts{'fix'}
503 17 3 if defined $next and length $next
505 2 1 if $$self{'_opts'}{'fix'}
518 18 2 if ($rparen and $$rparen[0] eq '_RPAREN') { }
1 1 elsif ($$self{'_opts'}{'fix'}) { }
520 7 11 if $next
529 19 0 $clause ? :
536 7 39 unless ($$self{'_opts'}{'allow_boost'})
537 3 4 unless $$self{'_opts'}{'fix'}
541 4 35 unless (defined $val and length $val)
542 2 2 if $$self{'_opts'}{'fix'}
556 21 19 if ($$self{'current'} eq '_PHRASE') { }
559 17 4 if ($$opts{'allow_slop'}) { }
561 11 6 $fuzzy ? :
564 2 2 unless $fix
571 15 4 if ($$opts{'allow_fuzzy'}) { }
572 11 4 if (defined $fuzzy) { }
573 9 2 if ($fuzzy <= 1) { }
577 1 1 unless $fix
587 2 2 unless $fix
618 5 9 unless ($$opts{'fields'} and !ref($$opts{'fields'}) || $$opts{'fields'}{$field})
621 3 2 if $$opts{'fix'}
625 6 3 if $field
627 2 1 if $$self{'_opts'}{'fix'}
640 0 18 unless (defined $next and length $next)
641 0 0 unless $$opts{'fix'}
646 8 8 if $$opts{'fields'} and !ref($$opts{'fields'}) || $$opts{'fields'}{$field}
650 5 5 unless $$opts{'fix'}
672 5 8 unless ($term =~ /^[^*?]{$min}/)
673 1 1 $min == 1 ? :
2 3 unless $$self{'_opts'}{'fix'}
678 1 2 unless length $term
690 2 24 unless ($$opts{'allow_ranges'})
691 1 1 unless $$opts{'fix'}
695 4 20 unless (defined $to)
696 2 2 unless $$opts{'fix'}
707 5 5 unless $$self{'_opts'}{'fix'}
709 1 4 $$self{'_opts'}{'escape_reserved'} ? :
718 1 1 unless $$self{'_opts'}{'fix'}
744 180 866 if $text =~ /\G$WS/cg
746 61 805 if $text =~ /\G(AND\b | && | OR\b | \|{2})/cgx
748 31 774 if $text =~ /\G(NOT\b | !)/cgx
750 26 748 if $text =~ /\G([-+])/cg
752 21 727 if $text =~ /\G[(]/cg
754 21 706 if $text =~ /\G[)]/cg
756 52 654 if $text =~ /\G\^($DECIMAL)?/cg
758 51 603 if $text =~ /\G[~]($DECIMAL)?/cg
760 29 574 if $text =~ /\G " ( (?: $ESC_CHAR | [^"\\])*) "/cgx
762 16 558 if $text =~ /\G (_exists_|_missing_): ((?:$TERM_START_CHAR $TERM_CHAR*)?) /cgx
767 19 539 if $text =~ /\G ($TERM_START_CHAR $TERM_CHAR*):/cgx
769 201 338 if $text =~ /\G ( $TERM_START_CHAR $TERM_CHAR*) (?!$TERM_CHAR | [*?]) /cgx
774 17 321 if $text =~ /\G ( (?:$TERM_START_CHAR | [*?]) (?:$TERM_CHAR | [*?])* )/cgx
779 28 293 if $text =~ /\G \[ ( $QUOTE_RANGE | [^ \]]+ ) (?: $RANGE_SEP ( $QUOTE_RANGE | [^ \]]* ) )? \] /cgx
787 2 291 if $text =~ /\G \{ ( $QUOTE_RANGE | [^ }]+ ) (?: $RANGE_SEP ( $QUOTE_RANGE | [^ }]* ) )? \} /cgx
797 18 273 if $text =~ /\G ( ["&|!(){}[\]~^:+\-] )/cgx
800 3 270 if $text =~ /\G\\$/cg