Condition Coverage

blib/lib/HTTP/BrowserDetect.pm
Criterion Covered Total %
condition 339 423 80.1


and 3 conditions

line !l l&&!r l&&r condition
648 2883 2658 732 index($ua, "gecko") != -1 and index($ua, "like gecko") == -1
2913 0 2628 $ua =~ m[applewebkit/([\d.\+]+)] and not $tests->{'edgehtml'}
678 6533 6 636 $ua =~ m[ (firebird|iceweasel|phoenix|namoroka|firefox|fxios) \/ ( [^.]* ) # Major version number is everything before first dot \. # The first dot ( [\d]* ) # Minor version nnumber is digits after first dot ]ox and index($ua, "not firefox") == -1
927 480 168 index($ua, "mozilla") != -1 and index($ua, "compatible") == -1
1024 6233 978 36 $self->android and index($ua, "; wv)") > 0
5873 798 540 $self->chrome and $self->android
6671 96 444 $self->chrome and $self->android and $self->browser_major >= 30
1039 0 186 78 not ref $m and 0 < index($self->{'user_agent'}, $m)
1040 186 0 0 "Regexp" eq ref $m and $self->{'user_agent'} =~ /$m/
1096 8727 24 6 index($ua, "yahoo") != -1 and index($ua, "jp.co.yahoo") == -1
8361 0 42 $ua =~ /^java/ and not $self->{'browser'}
1378 7696 492 599 exists $robot_tests->{'robot'} and $robot_tests->{'robot'} eq "unknown"
1397 707 276 36 $self->{'user_agent'} eq $full_string and $self->{'user_agent'} =~ m[\/.*\/]
983 0 36 $self->{'user_agent'} eq $full_string and $self->{'user_agent'} =~ m[\/.*\/] and $self->{'user_agent'} =~ m[ ([\w]* # Words before fragment $robot_fragment # Match the fragment (\/[\d\.]+)? # Version [\w]*) # Beta stuff ]xi
1414 0 365 654 $full_string and $full_string =~ s[[/ \.v]*(\d+)(\.\d+)?([\.\w]*)$][]
1579 1926 36 42 $tests->{'x11'} and index($ua, "cros") != -1
90 1854 0 index($ua, "samsung") == -1 and index($ua, "sun") != -1
1767 5514 1710 18 not $os and $browser_tests->{'firefox'}
1710 0 18 not $os and $browser_tests->{'firefox'} and index($ua, "fennec") == -1
1710 6 12 not $os and $browser_tests->{'firefox'} and index($ua, "fennec") == -1 and $self->mobile || $self->tablet
1776 1716 2976 2550 $os and not $os_string
1855 1159 5778 264 defined $browser and $browser eq "opera"
1579 1311 18 $browser eq "chrome" and $ua =~ m[crios/(\d+)\.(\d+)([\d.]*)]
2884 0 6 $browser eq "pubsub" and $ua =~ m[apple-pubsub/(\d+)\.?(\d+)?([\d.]*)]
2800 6 78 $browser eq "obigo" and $self->{'user_agent'} =~ m[(obigo[\w\-]*|teleca)[\/ ]\w(\d+)(\w*)]i
2800 0 6 $browser eq "polaris" and $ua =~ m[polaris[ \/](\d+)\.?(\d+)?([\d\.]*)]
2464 0 336 $browser eq "ucbrowser" and $ua =~ m[ucbrowser[\/ ]*(\d+)\.?(\d+)?([\d\.]*)]
2458 0 6 $browser eq "samsung" and $ua =~ m[samsungbrowser/(\d+)\.(\d+)\s]
2053 3800 961 2440 not defined $major and defined $self->{'browser_string'}
2105 772 3548 2881 defined $beta and $beta eq ""
2116 144 18 6 $major == 4 and $minor == 5
2117 144 18 6 $major == 4 and ".$minor" >= "0.5"
2120 150 12 6 defined $beta and index($beta, "gold") != -1
2143 1638 47 23 $major == 5 and $minor == 5
2155 242 6 71 $version_tests->{'ie7'} && $tests->{'trident'} && defined $self->engine_version && $self->engine_version >= 4
2174 258 6 0 index($ua, "opera/4") != -1 and index($ua, "nintendo dsi") == -1
2209 6277 0 36 index($ua, "nokia") != -1 and index($ua, "windows phone") == -1
2393 7975 60 276 $browser_tests->{'ucbrowser'} and $self->{'user_agent'} =~ m[ucweb/2.0\s*\(([^\;\)]*\;){3,4}\s*([^\;\)]*?)\s*\)]i
7847 68 108 $browser_tests->{'obigo'} || index($ua, 'brew') != -1 and $self->{'user_agent'} =~ m[\d+x\d+ ([\d\w\- ]+?)( \S+\/\S+)*$]i
2637 111 627 2 defined $self->{'browser'} && $self->{'browser'} eq 'realplayer'
2853 272 8 1294 $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+(\.\d+)?)/
2860 584 1 1639 $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+)/
2867 528 21 1563 $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+(\.\d+)/
2874 299 12 1113 $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+\.\d+([\.\d\+]*)/
2923 259 0 8 $self->major == 1 and $self->{'user_agent'} =~ /\s ( [a-z]{2} ) \)/msx
2932 1686 6 3 $self->aol and $self->{'user_agent'} =~ /;([A-Z]{2})_([A-Z]{2})\)/
2937 1668 12 12 $self->meta_app and $self->{'user_agent'} =~ m[ ;FBLC/ ([a-z]{2}) (?: [_-] ([A-Z]{2}) )? ]x
2943 1676 0 4 $self->instagram and $self->{'user_agent'} =~ / (?: [(] | ;[ ] ) ([a-z]{2}) [_-] ([A-Z]{2}) [;)] /x
2962 144 0 9 $self->webview && $1 eq 'wv'
4697 9 144 $part =~ /^\s*([a-z]{2})\s*$/ and not $self->webview && $1 eq 'wv'
3030 0 0 0 $self->chrome and $self->browser_major
0 0 0 $self->chrome and $self->browser_major and $self->browser_major >= 41
3036 0 0 0 $self->opera and $self->browser_major
0 0 0 $self->opera and $self->browser_major and $self->browser_major == 40 || $self->browser_major >= 42

or 2 conditions

line l !l condition
510 6467 19205 $self->{'tests'}{$test} || 0
523 3853 46779 $self->{'os_tests'}{$test} || 0
532 4629 56955 $self->{'browser_tests'}{$test} || 0
560 1930 22432 $self->{'version_tests'}{$test} || 0
570 2750 19585 $self->{'device_tests'}{$test} || 0
724 78 0 $self->_match(['Facebook', '[FB_IAB/FB4A', '[FBAN/FBIOS'], ['Facebook Lite', '[FBAN/EMA'], ['Facebook Messenger', '[FB_IAB/Orca-Android', '[FB_IAB/MESSENGER', '[FBAN/MessengerForiOS'], ['Facebook Messenger Lite', '[FBAN/mLite', '[FBAN/MessengerLiteForiOS']) || 'Meta App'
2632 0 0 $self->{'realplayer_version'} || 0
2678 883 0 $minor ||= ""
2706 20 2 $minor ||= ""

or 3 conditions

line l !l&&r !l&&!r condition
547 133 0 30541 $self->{'robot_tests'}{$test} || $false_result
678 944 786 4467 $tests->{'trident'} or index($ua, "msie") != -1
1730 0 4467 $tests->{'trident'} or index($ua, "msie") != -1 or index($ua, "microsoft internet explorer") != -1
1326 18 2649 index($ua, "chrome/") != -1 or index($ua, "crios") != -1
24 12 2613 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1
36 6 2607 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1 or index($ua, "rim tablet os") != -1
906 54 1647 index($ua, "safari") != -1 or index($ua, "applewebkit") != -1
6 6 1629 index($ua, "playstation 3") != -1 or index($ua, "playstation portable") != -1
12 30 1599 index($ua, "playstation 3") != -1 or index($ua, "playstation portable") != -1 or index($ua, "netfront") != -1
30 6 1209 index($ua, "libcurl") != -1 or $ua =~ /^curl/
756 36 6 1688 index($ua, "aol") != -1 or index($ua, "america online browser") != -1
840 264 12 684 index($ua, " mobile safari/") != -1 or index($ua, "mobilesafari") != -1
895 18 90 60 index($ua, "netscape") != -1 or not $tests->{'gecko'}
981 1158 4916 6 $browser_string || $BROWSER_NAMES{$browser}
1024 36 3018 4193 $self->android and index($ua, "; wv)") > 0 or $self->chrome and $self->android and $self->browser_major >= 30
1096 18 0 8769 index($ua, "libwww-perl") != -1 or index($ua, "lwp-") != -1
6 18 8715 index($ua, "binglocalsearch") != -1 or index($ua, "bingbot") != -1
24 6 8709 index($ua, "binglocalsearch") != -1 or index($ua, "bingbot") != -1 or index($ua, "bingpreview") != -1
30 6 8625 index($ua, "libcurl") != -1 or $ua =~ /^curl/
1314 7 14 8766 $browser_tests->{'applecoremedia'} or $browser_tests->{'dalvik'}
14 7 8759 $browser_tests->{'applecoremedia'} or $browser_tests->{'dalvik'} or $browser_tests->{'adm'}
1333 492 0 0 $ROBOT_NAMES{$id} || $ROBOT_NAMES{$r}
1457 0 12 2952 index($ua, "win16") != -1 or index($ua, "windows 3") != -1
12 0 2952 index($ua, "win16") != -1 or index($ua, "windows 3") != -1 or index($ua, "windows 16-bit") != -1
12 60 2880 index($ua, "win95") != -1 or index($ua, "windows 95") != -1
24 6 2850 index($ua, "win 9x 4.90") != -1 or index($ua, "windows me") != -1
12 12 2826 index($ua, "win98") != -1 or index($ua, "windows 98") != -1
1524 90 0 3714 index($ua, "nt 5.0") != -1 or index($ua, "nt5") != -1
6 42 1176 index($ua, "winnt") != -1 or index($ua, "windows nt") != -1
48 6 1170 index($ua, "winnt") != -1 or index($ua, "windows nt") != -1 or index($ua, "nt4") != -1
48 0 1170 index($ua, "winnt") != -1 or index($ua, "windows nt") != -1 or index($ua, "nt4") != -1 or index($ua, "nt3") != -1
1579 456 6 3930 index($ua, "macintosh") != -1 or index($ua, "mac_") != -1
18 252 3660 index($ua, "ipod") != -1 or index($ua, "iphone") != -1
270 150 3510 index($ua, "ipod") != -1 or index($ua, "iphone") != -1 or index($ua, "ipad") != -1
0 0 1944 $ua =~ /\bsco\b/ or index($ua, "unix_sv") != -1
0 0 1944 index($ua, "dec") != -1 or index($ua, "osf1") != -1
0 0 1944 index($ua, "dec") != -1 or index($ua, "osf1") != -1 or index($ua, "declpha") != -1
0 0 1944 index($ua, "dec") != -1 or index($ua, "osf1") != -1 or index($ua, "declpha") != -1 or index($ua, "alphaserver") != -1
0 0 1944 index($ua, "dec") != -1 or index($ua, "osf1") != -1 or index($ua, "declpha") != -1 or index($ua, "alphaserver") != -1 or index($ua, "ultrix") != -1
0 0 1944 index($ua, "dec") != -1 or index($ua, "osf1") != -1 or index($ua, "declpha") != -1 or index($ua, "alphaserver") != -1 or index($ua, "ultrix") != -1 or index($ua, "alphastation") != -1
0 0 1902 index($ua, "vax") != -1 or index($ua, "openvms") != -1
1596 0 0 462 index($ua, "68k") != -1 or index($ua, 68000) != -1
120 6 336 index($ua, "ppc") != -1 or index($ua, "powerpc") != -1
1767 6 6 6 $self->mobile || $self->tablet
2117 6 90 72 $major == 4 and ".$minor" >= "0.5" or $major >= 5
2122 78 6 84 $major == 5 or $major == 6
2144 29 1562 117 ".$minor" >= "0.5" or $major >= 6
2162 6 0 35 index($ua, "aol 3.0") != -1 or $version_tests->{'ie3'}
2165 0 0 41 index($ua, "aol 4.0") != -1 or $version_tests->{'ie4'}
2172 0 6 258 index($ua, "opera 3") != -1 or index($ua, "opera/3") != -1
2174 0 0 264 index($ua, "opera 4") != -1 or index($ua, "opera/4") != -1 and index($ua, "nintendo dsi") == -1
2178 0 0 264 index($ua, "opera 5") != -1 or index($ua, "opera/5") != -1
2181 12 0 252 index($ua, "opera 6") != -1 or index($ua, "opera/6") != -1
2184 18 12 234 index($ua, "opera 7") != -1 or index($ua, "opera/7") != -1
2209 1008 6 7243 index($ua, "android") != -1 or index($ua, "silk-accelerated") != -1
24 12 7207 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1
36 6 7201 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1 or index($ua, "rim tablet os") != -1
84 330 6325 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'}
330 12 6313 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1
342 36 6277 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1
36 0 6277 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1
36 96 6181 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/
96 0 6181 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/
96 6 6175 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1
6 0 6175 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0
6 0 6175 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1
0 6 6169 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1
6 0 6169 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1 or index($ua, "wap ") != -1
6 6 6163 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1 or index($ua, "wap ") != -1 or index($ua, "wap/") != -1
6 0 6163 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1 or index($ua, "wap ") != -1 or index($ua, "wap/") != -1 or index($ua, "-wap") != -1
6 0 6163 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1 or index($ua, "wap ") != -1 or index($ua, "wap/") != -1 or index($ua, "-wap") != -1 or index($ua, "wap-") != -1
0 6 6157 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1 or index($ua, "wap ") != -1 or index($ua, "wap/") != -1 or index($ua, "-wap") != -1 or index($ua, "wap-") != -1 or index($ua, "wap") == 0
6 0 6157 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1 or index($ua, "wap ") != -1 or index($ua, "wap/") != -1 or index($ua, "-wap") != -1 or index($ua, "wap-") != -1 or index($ua, "wap") == 0 or index($ua, "wapper") != -1
6 0 6157 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1 or index($ua, "nokia") != -1 and index($ua, "windows phone") == -1 or index($ua, "alcatel") != -1 or $ua =~ /\bbrew\b/ or $ua =~ /\bbmp\b/ or index($ua, "ericsson") != -1 or index($ua, "sie-") == 0 or index($ua, "wmlib") != -1 or index($ua, " wap") != -1 or index($ua, "wap ") != -1 or index($ua, "wap/") != -1 or index($ua, "-wap") != -1 or index($ua, "wap-") != -1 or index($ua, "wap") == 0 or index($ua, "wapper") != -1 or index($ua, "zetor") != -1
2315 6 0 7970 index($ua, 'ipad') != -1 || $browser_tests->{'ie'} && index($ua, 'windows phone') == -1 && index($ua, 'arm') != -1 || index($ua, 'android') != -1 && index($ua, 'mobile') == -1 && index($ua, 'safari') != -1 || $browser_tests->{'firefox'} && index($ua, 'tablet') != -1 || index($ua, 'an10bg3') != -1 || index($ua, 'an10bg3dt') != -1 || index($ua, 'an10g2') != -1 || index($ua, 'an7bg3') != -1 || index($ua, 'an7dg3') != -1 || index($ua, 'an7dg3childpad') != -1 || index($ua, 'an7dg3st') != -1 || index($ua, 'an7fg3') != -1 || index($ua, 'an7g3') != -1 || index($ua, 'an8cg3') != -1 || index($ua, 'an8g3') != -1 || index($ua, 'an9g3') != -1 || index($ua, 'flyer') != -1 || index($ua, 'hp-tablet') != -1 || index($ua, 'jetstream') != -1 || index($ua, 'kindle') != -1 || index($ua, 'novo7') != -1 || index($ua, 'opera tablet') != -1 || index($ua, 'rim tablet') != -1 || index($ua, 'transformer') != -1 || index($ua, 'xoom') != -1
2389 6 6 6036 $browser_tests->{'firefox'} && index($ua, 'mobile') != -1 || $browser_tests->{'ie'} && index($ua, 'windows phone') == -1 && index($ua, 'arm') != -1 || index($ua, 'windows phone') != -1 || index($ua, 'up.browser') != -1 || index($ua, 'nokia') != -1 || index($ua, 'alcatel') != -1 || index($ua, 'ericsson') != -1 || index($ua, 'sie-') == 0 || index($ua, 'wmlib') != -1 || index($ua, ' wap') != -1 || index($ua, 'wap ') != -1 || index($ua, 'wap/') != -1 || index($ua, '-wap') != -1 || index($ua, 'wap-') != -1 || index($ua, 'wap') == 0 || index($ua, 'wapper') != -1 || index($ua, 'blackberry') != -1 || index($ua, 'mobile') != -1 || index($ua, 'palm') != -1 || index($ua, 'smartphone') != -1 || index($ua, 'windows ce') != -1 || index($ua, 'palmsource') != -1 || index($ua, 'iphone') != -1 || index($ua, 'ipod') != -1 || index($ua, 'ipad') != -1 || index($ua, 'opera mini') != -1 && index($ua, 'tablet') == -1 || index($ua, 'htc_') != -1 || index($ua, 'symbian') != -1 || index($ua, 'webos') != -1 || index($ua, 'samsung') != -1 || index($ua, 'zetor') != -1 || index($ua, 'android') != -1 || index($ua, 'symbos') != -1 || index($ua, 'opera mobi') != -1 || index($ua, 'fennec') != -1 || $ua =~ /\bbrew\b/ || index($ua, 'obigo') != -1 || index($ua, 'teleca') != -1 || index($ua, 'polaris') != -1 || index($ua, 'opera tablet') != -1 || index($ua, 'rim tablet') != -1 || index($ua, 'bb10') != -1 && index($ua, 'mobile') != -1 || $device_tests->{'psp'} || $device_tests->{'dsi'} || $device_tests->{'n3ds'}
2393 72 104 7847 $browser_tests->{'obigo'} || index($ua, 'brew') != -1
2449 48 6 888 $model =~ /^KF/ or $model =~ /kindle fire/i
2793 555 4828 5537 @a == 0 or $a[0] < $b[0]
2794 0 3754 1783 @b == 0 or $b[0] < $a[0]
3036 0 0 0 $self->browser_major == 40 || $self->browser_major >= 42