Branch Coverage

blib/lib/URI/Heuristic.pm
Criterion Covered Total %
branch 46 62 74.1


line true false branch
100 9 7 if defined $_
104 0 7 if defined $_
109 3 4 if (my $httplang = $ENV{'HTTP_ACCEPT_LANGUAGE'})
112 3 0 if ($httplang =~ /^\s*([a-zA-Z]+)[_-]([a-zA-Z]{2})\s*$/)
119 0 9 unless defined $_
120 5 4 if /^[a-zA-Z]+_([a-zA-Z]{2})(?:[.\@]|$)/
126 1 1 if $fqdn =~ /\.([a-zA-Z]{2})$/
127 1 1 if defined $_
149 0 26 if $DEBUG
150 0 26 unless defined $_
155 0 26 if (/^(www|web|home)[a-z0-9-]*(?:\.|$)/i) { }
6 20 elsif (/^(ftp|gopher|news|wais|https|http)[a-z0-9-]*(?:\.|$)/i) { }
3 17 elsif ($^O ne 'MacOS' and m[^/] || m[^\.\.?/] || m(^[a-zA-Z]:[/\\])) { }
0 17 elsif ($^O eq 'MacOS' and /:/) { }
2 15 elsif (/^\w+([\.\-]\w+)*\@(\w+\.)+\w{2,3}$/) { }
12 3 elsif (not /^[a-zA-Z][a-zA-Z0-9.+\-]*:/) { }
171 0 0 unless (/^(ftp|gopher|news|wais|http|https|mailto):/)
174 0 0 $a =~ /^file:/ ? :
180 12 0 if (s[^([-\w]+(?:\.[-\w]+)*)([/:\?\#]|$)][$2]) { }
184 3 9 if (/^:(\d+)\b/)
186 1 2 if ($1 =~ /^[56789]?443$/) { }
1 1 elsif ($1 eq '21') { }
193 9 3 if (not $host =~ /\./ and $host ne "localhost")
195 2 7 if (exists $ENV{'URL_GUESS_PATTERN'}) { }
199 6 1 if (&MY_COUNTRY())
201 3 3 if ($special) { }
216 0 9 if $DEBUG
218 8 1 if (gethostbyname("$guess."))
219 0 8 if $DEBUG
223 0 1 if $DEBUG
233 0 26 if $DEBUG