Branch Coverage

blib/lib/CharsetDetector.pm
Criterion Covered Total %
branch 101 190 53.1


line true false branch
7904 1 10 unless (defined $_[0])
7911 2 8 defined $_[1] && $len > $_[1] ? :
7916 4 6 if (in_safe_list($det1)) { }
7921 3 3 if (defined $det2) { }
7929 0 10 if ($@) { }
7943 0 0 defined $_[1] && $len > $_[1] ? :
7950 0 0 if ($@) { }
7963 1 9 if (${$_[0];} eq '')
7970 1 8 if (($$ai[$$_encoding{'utf8'}] = utf8_probability($bytes)) == 100)
7973 2 6 if (($$ai[$$_encoding{'iso-2022-jp'}] = iso_2022_jp_probability($bytes)) == 100)
7982 0 6 if (($$ai[$$_encoding{'iso-2022-kr'}] = iso_2022_kr_probability($bytes)) == 100)
7991 0 6 if (($$ai[$$_encoding{'utf16'}] = utf16_probability($bytes)) == 100)
7995 0 6 if (($$ai[$$_encoding{'ascii'}] = ascii_probability($bytes)) == 100)
7999 0 6 if (($$ai[$$_encoding{'cp936'}] = gbk_probability($bytes)) == 100)
8002 0 6 if (($$ai[$$_encoding{'big5-eten'}] = big5_probability($bytes)) == 100)
8007 0 6 if (($$ai[$$_encoding{'euc-jp'}] = euc_jp_probability($bytes)) == 100)
8012 0 6 if (($$ai[$$_encoding{'shiftjis'}] = sjis_probability($bytes)) == 100)
8017 0 6 if (($$ai[$$_encoding{'euc-kr'}] = euc_kr_probability($bytes)) == 100)
8024 9 63 if ($$ai[$i] > $j)
8029 0 6 if ($j <= 50)
8034 3 3 if (${$_[0];} =~ /charset\s*=\s*([A-Za-z0-9\-\_]+)/i) { }
8036 0 3 if ($charset eq '' or $charset eq 'iso-8859-1') { }
8053 0 0 unless (defined $_[0])
8060 0 0 defined $_[1] && $len > $_[1] ? :
8068 0 0 if (in_safe_list($det1)) { }
8081 0 0 if (defined $det2) { }
8110 0 0 $skip ? :
8111 0 0 if ($num == 100)
8116 0 0 $skip ? :
8117 0 0 if ($num == 100)
8119 0 0 if ($num == 100)
8123 0 0 $skip ? :
8124 0 0 if ($num == 100)
8127 0 0 $skip ? :
8128 0 0 if ($num == 100)
8131 0 0 $skip ? :
8132 0 0 if ($num == 100)
8135 0 0 $skip ? :
8136 0 0 if ($num == 100)
8139 0 0 $skip ? :
8140 0 0 if ($num == 100)
8143 0 0 $skip ? :
8144 0 0 if ($num == 100)
8147 0 0 $skip ? :
8148 0 0 if ($num == 100)
8151 0 0 $skip ? :
8154 0 0 if ($$ai[$i] > $j)
8159 0 0 if ($j <= 50)
8166 0 0 if (${$_[0];} =~ /charset\s*=\s*([A-Za-z0-9\-\_]+)/i) { }
8169 0 0 if ($charset eq '' or $charset eq 'iso-8859-1') { }
8190 4 6 if ($_[0] == $$_encoding{'utf8'} or $_[0] == $$_encoding{'cp936'} or $_[0] == $$_encoding{'shiftjis'} or $_[0] == $$_encoding{'euc-jp'} or $_[0] == $$_encoding{'utf16'}) { }
8205 0 3 if ('euc-cn' eq $_[0]) { }
3 0 elsif ('gb18030' eq $_[0]) { }
0 0 elsif ('utf-8-strict' eq $_[0]) { }
8221 3 0 if ($_[0] =~ /gb18030/i) { }
8226 0 0 $rtn ? :
8232 1 9 if ('ascii' eq $_[0]) { }
8245 45 42 if ($$bytes[$j] < 0) { }
0 42 elsif ($$bytes[$j] == 27) { }
8254 3 84 if ($i <= 0)
8269 164 99 if ($$bytes[$j] >= 0 and $$bytes[$j] < 128)
8273 13 10 if (-64 <= $$bytes[$j] and $$bytes[$j] <= -33 and $j + 1 < $k and -128 <= $$bytes[$j + 1] and $$bytes[$j + 1] <= -65)
8283 23 5 if (-32 <= $$bytes[$j] and $$bytes[$j] <= -17 and $j + 2 < $k and -128 <= $$bytes[$j + 1] and $$bytes[$j + 1] <= -65 and -128 <= $$bytes[$j + 2] and $$bytes[$j + 2] <= -65)
8296 5 4 if ($i1 == $k)
8301 1 3 if ($i > 98)
8305 0 3 if ($i > 95 and $l > 30) { }
8315 6 0 (scalar @$bytes <= 1 || -2 != $$bytes[0] || -1 != $$bytes[1]) && (-1 != $$bytes[0] || -2 != $$bytes[1]) ? :
8331 32 57 if ($$bytes[$i] >= 0)
8335 32 25 if (-95 <= $$bytes[$i] and $$bytes[$i] <= -9 and -95 <= $$bytes[$i + 1] and $$bytes[$i + 1] <= -2) { }
25 0 elsif (-127 <= $$bytes[$i] and $$bytes[$i] <= -2 and -128 <= $$bytes[$i + 1] && $$bytes[$i + 1] <= -2 || 64 <= $$bytes[$i + 1] && $$bytes[$i + 1] <= 126) { }
8345 6 26 if ($$GBFreq[$i1][$k1] != 0) { }
11 15 elsif (15 <= $i1 and $i1 < 55) { }
8365 13 12 if (64 <= $$bytes[$i + 1] and $$bytes[$i + 1] <= 126) { }
8371 3 22 if ($$GBKFreq[$j1][$i2] != 0)
8398 32 57 if ($$bytes[$i] >= 0)
8402 36 0 if (-95 <= $$bytes[$i] and $$bytes[$i] <= -7 and 64 <= $$bytes[$i + 1] && $$bytes[$i + 1] <= 126 || -95 <= $$bytes[$i + 1] && $$bytes[$i + 1] <= -2)
8413 4 32 if (64 <= $$bytes[$i + 1] and $$bytes[$i + 1] <= 126) { }
8420 2 34 if ($$Big5Freq[$i1][$j1] != 0) { }
23 12 elsif (3 <= $i1 and $i1 <= 37) { }
8448 32 57 if ($$bytes[$i] >= 0)
8452 32 4 if (-95 <= $$bytes[$i] and $$bytes[$i] <= -2 and -95 <= $$bytes[$i + 1] and $$bytes[$i + 1] <= -2)
8461 24 8 if ($$JPFreq[$i1][$j1] != 0) { }
8 0 elsif (15 <= $i1 and $i1 < 55) { }
8484 0 0 if ($i + 3 < $len and $$bytes[$i] == 27 and $$bytes[$i + 1] == 36 and $$bytes[$i + 2] == 41 and $$bytes[$i + 3] == 67)
8500 2 0 if ($i + 2 < $len and $$bytes[$i] == 27 and $$bytes[$i + 1] == 36 and $$bytes[$i + 2] == 66)
8523 35 77 if ($$bytes[$i] >= 0)
8527 32 0 if ($i + 1 < $j and -127 <= $$bytes[$i] && $$bytes[$i] <= -97 || -32 <= $$bytes[$i] && $$bytes[$i] <= -17 and 64 <= $$bytes[$i + 1] && $$bytes[$i + 1] <= 126 || -128 <= $$bytes[$i + 1] && $$bytes[$i + 1] <= -4)
8540 6 26 if ($j1 < 159) { }
8542 6 0 if ($j1 > 127) { }
8553 21 11 if ($i1 < 160) { }
8561 2 30 if ($i1 < 94 and $j1 < 94 and $$JPFreq[$i1][$j1] != 0)
8591 32 57 if ($$bytes[$i] >= 0)
8595 32 4 if (-95 <= $$bytes[$i] and $$bytes[$i] <= -2 and -95 <= $$bytes[$i + 1] and $$bytes[$i + 1] <= -2)
8604 4 28 if ($$KRFreq[$i1][$j1] != 0) { }
13 15 elsif (15 <= $i1 and $i1 < 55) { }