Branch Coverage

blib/lib/String/Trigram.pm
Criterion Covered Total %
branch 58 86 67.4


line true false branch
32 0 312 unless $_ =~ /^(cmpBase|minSim|warp|ignoreCase|keepOnlyAlNums|padding|debug|ngram)$/l
39 0 39 if (not $params{'cmpBase'} or ref(@{$params{'cmpBase'};} ne 'ARRAY'))
45 0 39 if ($params{'minSim'} < 0 or $params{'minSim'} > 1)
49 0 39 if (defined $params{'ngram'} and $params{'ngram'} <= 0)
53 0 39 if ($params{'warp'} == 0)
57 0 39 if ($params{'padding'} < 0 or $params{'padding'} > $params{'ngram'} - 1)
92 0 31 unless defined $s2
100 6 25 unless $$result{$s1}
106 0 3 if (not $newCmpBase or ref(@$newCmpBase ne 'ARRAY'))
126 0 1 if (not $newStrings or ref(@$newStrings ne 'ARRAY'))
144 0 1 if (defined $newMinSim and $newMinSim < 0 || $newMinSim > 1)
150 1 2 if $newMinSim
158 0 0 if (defined $newWarp and $newWarp <= 0)
162 0 0 if $newWarp
170 0 0 if $newIgnoreCase
178 0 0 if $newKeepOnlyAlNums
186 0 0 if (defined $newPadding and $newPadding < 0 || $newPadding > $$self{'ngram'} - 1)
192 0 0 if $newPadding
200 0 0 if defined $newDebug
226 2 51 if @_
234 0 53 if ref $result ne 'HASH'
257 3 50 if $$self{'keepOnlyAlNums'}
258 52 1 if $$self{'ignoreCase'}
274 159 180 unless exists $$self{'trigIdx'}{$trigram}
284 204 7 unless exists $trigNumBuf{$trigram}{$actName}
288 205 6 if ($trigNumBuf{$trigram}{$actName} > 0)
321 0 8 if ref $outStrList ne 'ARRAY'
335 1 7 if ($self->getSimilarStrings($inpStr, $rslt, @_) == 0)
355 0 4 if ($val == $maxVal) { }
2 2 elsif ($val > $maxVal) { }
440 0 50 if ($$self{'debug'})
461 47 3 if ($actSim > $curMinSim)
480 48 2 if ($curWarp == 1) { }
523 7 51 if $keepAlNums
524 57 1 if $ignoreCase
526 2 56 if exists $$seen{$tmpStr}
546 26 13 unless exists $$params{'ngram'}
547 37 2 unless exists $$params{'minSim'}
548 37 2 unless exists $$params{'warp'}
549 36 3 unless exists $$params{'ignoreCase'}
551 36 3 unless exists $$params{'keepOnlyAlNums'}
553 35 4 unless exists $$params{'padding'}
554 38 1 unless exists $$params{'debug'}