Branch Coverage

lib/Encode/Guess/Educated.pm
Criterion Covered Total %
branch 73 140 52.1


line true false branch
78 0 1650 unless $wantarray
83 0 452961 unless $have == $want
88 0 750 unless $have >= $want
93 0 295912 unless blessed $self
98 0 6 unless not blessed $class
102 0 642342 unless caller 1 eq 'Encode::Guess::Educated'
107 0 304871 unless defined $scalar
112 0 478319 unless not ref $arg
119 0 147625 unless known_encoding $encoding
124 0 149795 unless looks_like_number $n
129 0 170 unless not looks_like_number $n
135 0 8476 unless $int =~ /^[0-9]+\z/
141 0 8022 unless $int =~ /^[1-9][0-9]*\z/
147 0 149795 unless $n >= $low and $n <= $high
152 0 432 unless reftype $arg eq $type
159 0 157246 unless length $string > 0
164 0 454 unless not $str =~ /[^\x00-\xFF]/
169 0 426 unless $str =~ /\P{ASCII}/
174 0 18 unless -e $path
175 0 18 unless -f _
176 0 18 unless -s _
232 0 0 $bool ? :
402 0 6 unless $keycount > 0
406 0 6 unless $keycount > 90
418 52 6 if (blessed $self) { }
432 754 31 if (blessed $self) { }
435 754 0 wantarray ? :
439 31 0 wantarray ? :
490 0 137889 unless $$bt[$byte]
491 0 137889 unless exists $$bt[$byte]{$encoding}
517 5250 1406 if (defined $weight) { }
525 0 6656 unless $bt and reftype $bt eq 'ARRAY'
529 0 6656 if (exists $$bt[$byte]{$encoding})
546 0 18 unless open my $fh, '<', $filename
547 0 18 unless binmode $fh
553 0 18 unless close $fh
555 0 18 unless defined $contents
556 0 18 unless length $contents
579 0 170 unless ($data =~ /\P{ASCII}/)
585 170 0 if (my $decoder = Encode::Guess::guess_encoding($data))
586 28 142 if (ref $decoder) { }
613 118000 19889 if (defined $worth) { }
631 0 142 unless $self->get_report_total_high_bytes
732 142 0 if (@converts == 1) { }
771 0 470 if $score == 0
772 142 328 $score == $high_score ? :
782 470 0 if (@converts == 1) { }
790 0 0 if $as_utf8 =~ /[\x80-\x9F]/
816 1168 52 if exists $B[0]{$enc}
827 86 6570 if ($@ or $unichr eq '�')
834 0 6570 if ord $unichr == 65533
839 1412 5158 unless (defined $count)
846 840 572 if ($unichr =~ /[\x80-\x9F]/)
854 480 64 unless ($unichr =~ /\p{Private_Use}/ or $unichr =~ /[\p{Common}\p{Inherited}]/ or $unichr =~ /[\p{Latin}\p{Greek}]/)
899 0 0 unless ($$href{$b} || 0) <=> ($$href{$a} || 0) or defined $$href{$b} <=> defined $$href{$a} or lc str2nummistr($a) cmp lc str2nummistr($b) or str2nummistr($a) cmp str2nummistr($b)
918 0 0 if (defined $$href{$enc}) { }
973 0 0 if (/[\pC\pZ]/) { }
976 0 0 if /\p{BC=NSM}/
979 0 0 unless /[\p{EA=F}\p{EA=W}]/
986 0 0 if (my $ci = charinfo($codepoint))
1018 4939 569 unless $seen{$name}++
1022 0 400 unless $$b[1] <=> $$a[1]
1064 1118 9702 if (not $seen_string{$+{'string'}}++ and ++$seen_char{$+{'char'}} < 2)
1073 142 0 if @hits
1086 156480 0 if (my $enc_obj = &Encode::find_encoding($enc)) { }
1110 0 0 if defined $$cache{$old}
1130 0 0 if (length $right) { }
1170 2724 14800 unless $seen{$_}++
1200 168146 0 unless debugging
1204 0 0 unless $fmt =~ /\n\z/