Branch Coverage

blib/lib/Encode/Detect/Upload.pm
Criterion Covered Total %
branch 96 206 46.6


line true false branch
84 0 2 if (@_ == 1 and ref $_[0] eq 'HASH') { }
2 0 elsif (@_ % 2 == 0) { }
93 2 0 if ($param)
120 1 9 if not $agent and $$self{'die_on_missing'}
124 6 3 if $agent =~ /Windows/
125 1 2 if $agent =~ /\b(?:Macintosh|Mac)\b/
126 1 1 if $agent =~ /Linux/
145 0 0 unless $has_ipcountry or $has_geoip
148 0 0 unless $ip
149 0 0 unless $ip =~ /\A(?:0|[1-9]\d*)(?:\.(?:0|[1-9]\d*)){3}\z/ and not grep(($_ > 255), split(/\./, $ip, 0))
153 0 0 if ($has_ipcountry)
156 0 0 if $country eq '**'
157 0 0 defined $country ? :
159 0 0 if ($has_geoip)
162 0 0 if ($data_file) { }
163 0 0 unless -e $data_file
190 1 2 unless defined $country_code
191 0 2 unless my $country = $$country_lang{lc $country_code}
193 1 1 if (wantarray) { }
212 1 1 unless defined $country_code
213 0 1 unless my $country = $$country_lang{lc $country_code}
235 1 5 if not $accept and $$self{'die_on_missing'}
243 6 1 if (wantarray) { }
244 0 6 if $seen{$lang}
266 1 5 unless defined $lang_code
268 1 4 unless my $language = $$lang_charset{$lang_code}
288 1 2 unless defined $lang
296 2 2 unless $$lang_charset{$sublang}
297 2 0 unless $lang_seen{$sublang}++
302 1 1 if ($lang =~ s/-.+\z//)
303 1 0 if ($$lang_charset{$lang})
304 1 0 unless $lang_seen{$lang}++
309 2 0 unless $$lang_charset{$sublang}
310 0 0 unless $lang_seen{$sublang}++
334 1 7 unless $lang
336 0 7 unless my $group = $$lang_charset{$lang}
338 1 6 if ($os)
340 0 1 unless $os =~ /\A(?:windows|linux|macintosh)\z/
344 6 1 if (wantarray) { }
367 1 6 unless $text
370 0 7 if $words{$1}++
372 0 7 if @words >= $max
462 0 5 if (@_ == 1 and ref $_[0] eq 'HASH') { }
5 0 elsif (@_ % 2 == 0) { }
504 2 3 if ($conf{'ranking'})
510 0 2 unless $rank{'lang'}{'repeat'}
512 0 6 unless $rank{'char'}{$os}{'repeat'}
517 5 0 unless ($conf{'os'})
521 0 5 unless $conf{'os'}
524 0 5 if $conf{'os'} eq 'linux'
543 4 1 if $@
545 1 4 if ($is_utf8) { }
560 1 4 $is_utf8 ? :
562 5 15 unless @{$char_hash{'W'};} or @{$char_hash{'M'};} or @{$char_hash{'L'};}
563 5 15 unless @sequence
565 0 10 if ($char_meta{$charset}{'pos'}) { }
578 0 5 if ($has_detect)
580 0 0 if defined $mozilla
581 0 0 if ($mozilla)
584 0 0 if ($charset_encode) { }
586 0 0 if ($char_meta{$mozilla}) { }
589 0 0 if ($rank{'mozilla_move'} and $char_meta{$mozilla}{'pos'} != 1)
591 0 0 if $pos_new < 1
593 0 0 if $$_{'pos'} >= $pos_new
602 0 0 if ($rank{'mozilla_insert'})
624 1 4 if (wantarray) { }
645 2 3 if ($$conf{'lang'}) { }
646 2 0 unless ref $$conf{'lang'}
653 0 3 if ($$conf{'country'}) { }
654 0 0 ref $$conf{'country'} ? :
659 0 3 if ($$conf{'ip'} and $has_ipcountry || $has_geoip)
660 0 0 unless ref $$conf{'ip'}
663 0 0 unless $country
664 0 0 if ($country_meta{$country}) { }
676 0 3 if (ref $$conf{'country_extra'})
678 0 0 if ($$conf{'country_extra'}{$position})
679 0 0 unless ref $$conf{'country_extra'}{$position}
683 0 0 if ($country_meta{$country}) { }
687 0 0 if $position eq 'start'
698 0 0 if ref $$conf{'country_extra'}{'start'}
699 0 0 if ref $$conf{'country_extra'}{'end'}
709 0 0 if $country_seen{$lang}
718 3 0 if ($$conf{'accept_lang'})
719 3 0 unless ref $$conf{'accept_lang'}
723 0 3 if $accept_seen{$lang}
732 0 3 if (ref $$conf{'lang_extra'})
735 0 0 if ($$conf{'lang_extra'}{$position})
736 0 0 unless ref $$conf{'lang_extra'}{$position}
746 0 3 if $lang_meta{$lang}
747 0 3 $accept_seen{$lang} && $country_seen{$lang} ? :
760 0 0 if $lang_meta{$lang}{'pos'}
772 3 3 unless @{$lang_hash{'A'};} or @{$lang_hash{'C'};}
773 0 3 unless @sequence
775 0 3 if ($lang_meta{$lang}{'pos'}) { }
787 0 0 if $lang_meta{$lang}{'pos'}
792 3 0 if ($$rank{'lang_both'}) { }
793 0 0 unless $lang_meta{$b}{'start'} <=> $lang_meta{$a}{'start'} or $lang_meta{$b}{'both'} <=> $lang_meta{$a}{'both'}
816 0 5 $$conf{'inc_linux'} ? :
819 0 5 unless @charsets
823 0 10 if $$char_error{$charset}
824 0 10 if ($$char_meta{$charset}) { }
830 10 0 if ($charset_encode) { }
851 0 10 $@ ? :