Branch Coverage

blib/lib/Text/Names.pm
Criterion Covered Total %
branch 119 188 63.3


line true false branch
701 0 12 unless $namesInitialized
706 1 11 unless $namesInitialized
724 0 3 unless $name =~ /\w.*,.*\w/
727 1 57 if $name =~ /\b$prefix$/i
729 0 2 if $name =~ /^\w\b/
737 9 11 unless $p
739 2 9 if $#sub_parts >= 2
746 1 3 if $#first_surname > -1 and $#surname_first > -1
759 0 11 unless $namesInitialized
761 2 9 if ($name =~ /[,\s]/)
768 1 10 unless $fscore or $mscore
769 3 7 if $fscore and not $mscore
770 0 7 if $mscore and not $fscore
777 1 6 if $fscore / $mscore >= $threshold
778 4 2 if $mscore / $fscore >= $threshold
782 0 2 if ($fem_end) { }
783 0 0 if $fscore / $mscore >= $threshold / 4
785 2 0 if $mscore / $fscore >= $threshold / 4
793 0 999 unless $n =~ /^(.+?)\s+(.+?)\s/
797 0 1219 unless $n =~ /^(.+?)\s+(.+?)\s/
801 0 4275 unless $n =~ /^(.+?)\s+(.+?)\s/
809 0 0 unless defined $n
817 57 1 if $given
826 0 123 unless defined $in
853 0 116 unless defined $in
866 7 109 if (not $in =~ /,/ and $in =~ /^(.*?\s)((?:[A-Z][\-\.\s]{0,2}){1,3})$/) { }
0 109 elsif ($in =~ /^[^,]+\s\w\.?$/) { }
885 67 49 if ($in =~ /(.*),\s*(.*)/) { }
890 0 49 if ($#bits == -1)
894 0 49 if ($lastname =~ /^Jr\.?$/i and $#bits > -1)
898 3 46 if $jr
930 0 38 unless defined $in
942 1 37 if ($in =~ /;/) { }
14 23 elsif (not $in =~ /,/) { }
956 4 19 if ($in =~ /$AND/i) { }
964 0 4 if ($t =~ /,.+,.+,.+$AND/)
976 0 4 if ($in =~ /$AND.*,/i) { }
990 3 16 if ($in =~ /,.+,/) { }
996 12 4 unless $tok =~ /[\w\.]${SPACE}[\w\.]/i
999 3 0 if ($silly >= 2 and $#tokens % 2 == 1)
1020 14 5 if ($#bits <= 0)
1039 0 38 if (defined $_[-1] and $_[-1] eq 'reverse')
1049 38 57 unless $_
1050 2 55 if (/^([A-Z](\.|\s|$)\s?)+$/ and $#new > -1) { }
1051 0 2 if ($new[-1] =~ /,/) { }
1061 0 55 unless $a
1063 0 55 $reverse ? :
1071 0 6 unless defined $in
1076 0 6 if ($l =~ s/\s+(Jr\.?|[IV]{2,10})\s*$//)
1082 0 6 if ($f =~ /^\s*([A-Z](?:\.|\s|$))(.+)$/) { }
1089 1 5 if ($f =~ /^([^\s]+?)\s+((?:[A-Z](?:\.|\s+|$)\s*)+)$/)
1100 2 7 unless $ABBREVIATIONS_LC{lc $a}
1101 7 0 $ABBREVIATIONS_LC{lc $a}{lc $b} ? :
1107 0 14 unless defined $a and defined $b
1112 0 14 if defined $firsta and not defined $firstb
1113 0 14 if defined $firstb and not defined $firsta
1114 0 14 if defined $lasta and not defined $lastb
1115 0 14 if defined $lastb and not defined $lasta
1117 14 0 if defined $lasta
1118 14 0 if defined $lastb
1121 2 12 unless (equivtext($lasta, $lastb))
1122 1 1 if (not $opts{'loose'}) { }
1150 2 17 if ($i > $#at) { }
1 16 elsif ($i > $#bt) { }
1162 13 3 if (not equivtext($at[$i], $bt[$i])) { }
1165 3 10 unless equivtext(substr($at[$i], 0, 1), substr($bt[$i], 0, 1))
1170 5 5 if (length $at[$i] > 2) { }
1172 4 1 if (length $bt[$i] > 2) { }
1173 3 1 if (abbreviationOf($at[$i], $bt[$i])) { }
1 0 elsif (abbreviationOf($bt[$i], $at[$i])) { }
1191 5 0 if length $bt[$i] > 2
1216 21 22 length $a > 1 && length $b > 1 ? :
1230 0 58 unless defined $n
1239 0 58 if ($n =~ s/^\s*,\s+//)
1242 0 58 if ($n =~ s/^([^,]+?)\s*,\s*$/$1/)
1274 0 58 if $n =~ m[http://]
1277 2 56 unless ($n =~ /[A-Z]/)
1282 5 53 unless ($n =~ /,/ or $n =~ /\w \w/)
1288 57 1 if ($n =~ /[a-z]/ and not $n =~ /[A-Z]{2,} [A-Z]{2,}/) { }
1307 0 5 if grep {lc $_ eq lc $s;} @NAME_PREFIXES
1320 0 0 if (scalar @first_parts > 3)
1330 0 0 if $value =~ s/(\w)[^\s\.]+/$1./
1333 0 0 if $first =~ /(\w)[^\s\.]+/
1356 0 0 if (scalar @parts < 3) { }
1361 0 0 if $variation =~ /-/ and $alias =~ / /
1362 0 0 if $variation =~ / / and $alias =~ /-/
1363 0 0 unless $variation =~ /-/ or $alias =~ /-/
1364 0 0 unless $variation =~ / / or $alias =~ / /
1374 0 0 if $reduced
1379 0 0 if (scalar @aliases > 25)
1391 0 0 if (scalar @parts <= 1) { }
1412 0 86 unless defined $_
1476 56 4 unless $txt =~ /\b[A-Z]{2,}\b/ or $txt =~ /\b[a-z]{4,}\b/
1478 4 0 if ($args{'notSentence'})