Branch Coverage

blib/lib/Complete/Util.pm
Criterion Covered Total %
branch 209 296 70.6


line true false branch
95 0 0 unless defined $ans
96 0 0 if (ref $ans ne "HASH")
99 0 0 if (@_)
128 0 0 unless defined $ans
129 0 0 if (ref $ans eq "HASH")
156 0 7 unless defined $ans
157 4 3 ref $ans eq 'HASH' ? :
181 0 5 unless defined $ans
182 1 2 @{$ans->{'words'} // [];} ? :
1 1 @$ans ? :
3 2 ref $ans eq 'HASH' ? :
188 3 9 if $_ < $m
209 0 0 $a[$i - 1] eq $b[$j - 1] ? :
305 0 55 unless my $array0 = delete $args{'array'}
310 0 55 if keys %args
319 0 55 if $COMPLETE_UTIL_TRACE
324 1 54 unless (@$array0)
329 3 51 $ci ? :
3 51 if $map_case
332 3 51 if ($exclude)
335 3 4 $ci ? :
1 6 if $map_case
342 4 50 if ($replace_map)
346 1 3 $ci ? :
0 4 if $map_case
349 1 3 $ci ? :
0 4 if $map_case
366 0 54 if $COMPLETE_UTIL_TRACE
369 18 182 $ci ? :
10 190 if $map_case
370 5 13 if $excluden and $excluden->{$eln}
373 27 168 if $summaries
374 78 117 if (0 == index($eln, $wordn))
376 19 59 if $summaries
378 4 10 if ($rmapn and $rmapn->{$eln})
384 3 1 if (0 == index($vn, $wordn))
386 0 3 if $summaries
391 0 40 if @words and $COMPLETE_UTIL_TRACE
395 52 2 unless $word_mode and not @words
397 1 1 if $wordn =~ /\A\W/
398 0 2 unless @split_wordn > 1
401 2 2 if $i
405 0 2 if $COMPLETE_UTIL_TRACE
410 4 4 if ($arrayn[$i] =~ /$re/)
416 0 4 if ($tmp =~ s/([a-z0-9_])([A-Z])/$1-$2/g)
417 0 0 if $ci
0 0 if $map_case
418 0 0 if ($tmp =~ /$re/)
424 4 4 unless $match
426 0 4 if $summaries
428 0 2 if @words and $COMPLETE_UTIL_TRACE
432 4 0 if ($char_mode and not @words and length $wordn and length $wordn <= 7)
435 0 4 if $COMPLETE_UTIL_TRACE
437 1 15 if ($arrayn[$i] =~ /$re/)
439 0 1 if $summaries
442 0 1 if @words and $COMPLETE_UTIL_TRACE
446 3 0 if ($char_mode and not @words and length $wordn and length $wordn <= 7)
449 0 3 if $COMPLETE_UTIL_TRACE
451 2 11 if ($arrayn[$i] =~ /$re/)
453 0 2 if $summaries
456 0 2 if @words and $COMPLETE_UTIL_TRACE
460 1 53 if ($fuzzy and not @words)
461 0 1 if $COMPLETE_UTIL_TRACE
464 0 1 if ($env eq 'xs') { }
0 1 elsif ($env eq 'flexible') { }
0 1 elsif ($env eq 'pp') { }
1 0 elsif (eval { do { require Text::Levenshtein::Flexible; 1 } }) { }
498 0 3 if $l <= 0
505 0 3 if (defined $editdists{$chopped}) { }
506 3 0 if ($editdist_flex) { }
508 2 1 unless defined $d
517 0 1 unless $d <= $maxd
519 0 1 if $summaries
523 0 1 if @words and $COMPLETE_UTIL_TRACE
527 4 50 if ($rmapn and @words)
530 1 3 $ci ? :
0 4 if $map_case
534 3 1 if (my $w = $$rev_rmapn{$wordsn[$i]})
543 19 70 $summaries ? :
548 1 57 $ci ? :
554 0 55 if $COMPLETE_UTIL_TRACE
579 0 4 unless my $hash = delete $args{'hash'}
583 0 4 if keys %args
589 1 3 if ($summaries) { }
1 2 elsif ($summaries_from_hash_values) { }
688 0 22 unless my $elems = delete $args{'elems'}
694 0 22 if keys %args
702 19 3 unless $summaries
706 0 10 $ci ? :
707 0 10 if (exists $summaries_for{$elem})
716 20 2 @mentioned_elems ? :
719 4 18 if ($remaining) { }
7 11 elsif ($uniq) { }
725 0 13 if ($ci) { }
728 0 21 $ci ? :
10 11 unless $ci ? $mem{lc $_} : $mem{$_}
739 0 6 $ci ? :
3 19 $summaries ? :
743 17 5 if @mentioned_elems
744 6 31 ref $_ eq 'HASH' ? :
748 16 6 unless @$cae_res == 1
749 2 4 if @$remaining_elems <= 1
750 4 0 unless ref $cae_res->[0] eq "HASH"
751 0 4 defined $cae_res->[0]{'summary'} ? :
824 0 9 unless my $keys = delete $args{'keys'}
829 0 9 if keys %args
837 8 1 unless $keys_summaries
841 0 3 $ci ? :
842 0 3 if (exists $keys_summaries_for{$key})
852 10 6 if $i % 2 == 0
854 6 3 if (@mentioned_elems == 0 or @mentioned_elems % 2 == 1) { }
857 4 2 @mentioned_keys ? :
860 0 6 if ($remaining_keys) { }
6 0 elsif ($uniq) { }
866 0 2 if ($ci) { }
869 0 18 $ci ? :
16 2 unless $ci ? $mem{lc $_} : $mem{$_}
879 0 3 $ci ? :
1 5 $keys_summaries ? :
884 2 4 if @mentioned_elems
885 3 9 ref $_ eq 'HASH' ? :
889 4 2 unless @$cae_res == 1
890 0 2 if @$remaining_elems <= 1
891 2 0 unless ref $cae_res->[0] eq "HASH"
892 0 2 defined $cae_res->[0]{'summary'} ? :
900 1 2 unless $complete_value
904 2 0 if @mentioned_elems
957 1 9 unless @_
958 1 8 if @_ < 2
970 8 67 ref $entry ? :
4 71 ref $_ ? :
971 29 5 unless &List::Util::first(sub { (ref $entry ? $entry->{'word'} : $entry) eq (ref $_ ? $_->{'word'} : $_); } , @{$$final{"words"};})
978 9 11 if (ref $ans eq 'ARRAY') { }
11 0 elsif (ref $ans eq 'HASH') { }
983 3 8 if ($ans->{'final'})
990 8 9 if ($_ eq 'words') { }
6 3 elsif ($_ eq 'static') { }
993 4 2 if (exists $final->{$_}) { }
1005 6 2 $encounter_hash ? :
1033 1 4 ref $answer eq 'HASH' ? :
1036 0 5 if keys %args
1039 5 0 if (defined $prefix)
1041 1 12 if (ref $_ eq 'HASH') { }
1048 3 2 if (defined $suffix)
1050 1 8 if (ref $_ eq 'HASH') { }
1086 0 0 ref $answer eq 'HASH' ? :
1087 0 0 if keys %args
1090 0 0 if (@$words == 1)