Plucene/Search/PhraseScorer/Exact.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 10 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 40 / 40 CC 6 SCAR 14.7
CC
6
Cov
100%
_phrase_freq
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.3
« Plucene/Search/DateFilter.pm ↑ Summary Plucene/Index/SegmentsTermEnum.pm »
1 package Plucene::Search::PhraseScorer::Exact;
2  
3 =head1 NAME
4  
5 Plucene::Search::PhraseScorer::Exact - exact phrase scorer
6  
7 =head1 SYNOPSIS
8  
9 # isa Plucene::Search::PhraseScorer
10  
11 =head1 DESCRIPTION
12  
13 This is the eact phrase scorer
14  
15 =cut
16  
17 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 4 ▶use base 'Plucene::Search::PhraseScorer';
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 73 ▶sub _phrase_freq {
Subroutine _phrase_freq: called CC=6 SCAR=17.9
23 73 my $self = shift;
24 73 my $pp = $self->first;
25 73 ▶ while ($pp) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pp) 153 73 226
26 153 $pp->first_position;
27 153 push @{ $self->{pq} }, $pp;
28 153 $pp = $pp->next_in_list;
29 }
30  
31 73 $self->_pq_to_list;
32  
33 73 my $freq = 0;
34 73 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
$self->last->next_position and do { do { while ($self->first->position < $self->last->position) { do { return $freq unless $self->first->next_position } while $self->first->position < $self->last->position; $self->_first_to_last; } ; ++$freq } } 25 15 40
35 98 ▶ while ($self->first->position < $self->last->position) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->first->position < $self->last->position) 246 40 286
36 246 ▶ do {
Branch: 1 branch
BranchTrueFalseTotal
$self->first->position < $self->last->position and do { do { return $freq unless $self->first->next_position } } 207 188 395
37 453 ▶ return $freq unless $self->first->next_position;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->first->next_position 58 395 453
38 } while $self->first->position < $self->last->position;
39 188 $self->_first_to_last;
40 }
41 40 $freq++;
42 } while $self->last->next_position;
43 15 return $freq;
44 }
45  
46 4 1;
« Plucene/Search/DateFilter.pm ↑ Summary Plucene/Index/SegmentsTermEnum.pm »