Condition Coverage

blib/lib/HTTP/BrowserDetect.pm
Criterion Covered Total %
condition 333 417 79.8


and 3 conditions

line !l l&&!r l&&r condition
648 2883 2664 732 index($ua, "gecko") != -1 and index($ua, "like gecko") == -1
2913 0 2634 $ua =~ m[applewebkit/([\d.\+]+)] and not $tests->{'edgehtml'}
678 6539 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 42 $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 8736 25 6 index($ua, "yahoo") != -1 and index($ua, "jp.co.yahoo") == -1
8371 0 42 $ua =~ /^java/ and not $self->{'browser'}
1378 7706 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
1765 5520 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
1774 1716 2976 2556 $os and not $os_string
1853 1158 5786 264 defined $browser and $browser eq "opera"
1580 1318 18 $browser eq "chrome" and $ua =~ m[crios/(\d+)\.(\d+)([\d.]*)]
2892 0 6 $browser eq "pubsub" and $ua =~ m[apple-pubsub/(\d+)\.?(\d+)?([\d.]*)]
2808 6 78 $browser eq "obigo" and $self->{'user_agent'} =~ m[(obigo[\w\-]*|teleca)[\/ ]\w(\d+)(\w*)]i
2808 0 6 $browser eq "polaris" and $ua =~ m[polaris[ \/](\d+)\.?(\d+)?([\d\.]*)]
2472 0 336 $browser eq "ucbrowser" and $ua =~ m[ucbrowser[\/ ]*(\d+)\.?(\d+)?([\d\.]*)]
2466 0 6 $browser eq "samsung" and $ua =~ m[samsungbrowser/(\d+)\.(\d+)\s]
2051 3800 960 2448 not defined $major and defined $self->{'browser_string'}
2103 771 3557 2880 defined $beta and $beta eq ""
2114 144 18 6 $major == 4 and $minor == 5
2115 144 18 6 $major == 4 and ".$minor" >= "0.5"
2118 150 12 6 defined $beta and index($beta, "gold") != -1
2141 1638 47 23 $major == 5 and $minor == 5
2153 242 6 71 $version_tests->{'ie7'} && $tests->{'trident'} && defined $self->engine_version && $self->engine_version >= 4
2172 258 6 0 index($ua, "opera/4") != -1 and index($ua, "nintendo dsi") == -1
2207 6288 0 36 index($ua, "nokia") != -1 and index($ua, "windows phone") == -1
2391 7993 60 276 $browser_tests->{'ucbrowser'} and $self->{'user_agent'} =~ m[ucweb/2.0\s*\(([^\;\)]*\;){3,4}\s*([^\;\)]*?)\s*\)]i
7865 68 108 $browser_tests->{'obigo'} || index($ua, 'brew') != -1 and $self->{'user_agent'} =~ m[\d+x\d+ ([\d\w\- ]+?)( \S+\/\S+)*$]i
2635 107 630 3 defined $self->{'browser'} && $self->{'browser'} eq 'realplayer'
2851 272 8 1295 $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+(\.\d+)?)/
2858 586 1 1641 $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+)/
2865 538 22 1554 $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+(\.\d+)/
2872 293 8 1123 $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+\.\d+([\.\d\+]*)/
2921 242 0 10 $self->major == 1 and $self->{'user_agent'} =~ /\s ( [a-z]{2} ) \)/msx
2930 1695 6 3 $self->aol and $self->{'user_agent'} =~ /;([A-Z]{2})_([A-Z]{2})\)/
2935 1677 10 14 $self->meta_app and $self->{'user_agent'} =~ m[ ;FBLC/ ([a-z]{2}) (?: [_-] ([A-Z]{2}) )? ]x
2941 1683 0 4 $self->instagram and $self->{'user_agent'} =~ / (?: [(] | ;[ ] ) ([a-z]{2}) [_-] ([A-Z]{2}) [;)] /x
2960 132 0 9 $self->webview && $1 eq 'wv'
4667 9 132 $part =~ /^\s*([a-z]{2})\s*$/ and not $self->webview && $1 eq 'wv'
3028 0 0 0 $self->chrome and $self->browser_major
0 0 0 $self->chrome and $self->browser_major and $self->browser_major >= 41
3034 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 6460 19184 $self->{'tests'}{$test} || 0
523 3853 46823 $self->{'os_tests'}{$test} || 0
532 4578 57025 $self->{'browser_tests'}{$test} || 0
560 1916 22466 $self->{'version_tests'}{$test} || 0
570 2751 19602 $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'
2630 0 0 $self->{'realplayer_version'} || 0
2676 884 0 $minor ||= ""
2704 20 2 $minor ||= ""

or 3 conditions

line l !l&&r !l&&!r condition
547 131 0 30565 $self->{'robot_tests'}{$test} || $false_result
678 944 786 4473 $tests->{'trident'} or index($ua, "msie") != -1
1730 0 4473 $tests->{'trident'} or index($ua, "msie") != -1 or index($ua, "microsoft internet explorer") != -1
1332 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 4922 6 $browser_string || $BROWSER_NAMES{$browser}
1024 42 3018 4193 $self->android and index($ua, "; wv)") > 0 or $self->chrome and $self->android and $self->browser_major >= 30
1096 18 0 8779 index($ua, "libwww-perl") != -1 or index($ua, "lwp-") != -1
6 18 8725 index($ua, "binglocalsearch") != -1 or index($ua, "bingbot") != -1
24 6 8719 index($ua, "binglocalsearch") != -1 or index($ua, "bingbot") != -1 or index($ua, "bingpreview") != -1
30 6 8635 index($ua, "libcurl") != -1 or $ua =~ /^curl/
1314 7 14 8776 $browser_tests->{'applecoremedia'} or $browser_tests->{'dalvik'}
14 7 8769 $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 3936 index($ua, "macintosh") != -1 or index($ua, "mac_") != -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
1765 6 6 6 $self->mobile || $self->tablet
2115 6 90 72 $major == 4 and ".$minor" >= "0.5" or $major >= 5
2120 78 6 84 $major == 5 or $major == 6
2142 29 1562 117 ".$minor" >= "0.5" or $major >= 6
2160 6 0 35 index($ua, "aol 3.0") != -1 or $version_tests->{'ie3'}
2163 0 0 41 index($ua, "aol 4.0") != -1 or $version_tests->{'ie4'}
2170 0 6 258 index($ua, "opera 3") != -1 or index($ua, "opera/3") != -1
2172 0 0 264 index($ua, "opera 4") != -1 or index($ua, "opera/4") != -1 and index($ua, "nintendo dsi") == -1
2176 0 0 264 index($ua, "opera 5") != -1 or index($ua, "opera/5") != -1
2179 12 0 252 index($ua, "opera 6") != -1 or index($ua, "opera/6") != -1
2182 18 12 234 index($ua, "opera 7") != -1 or index($ua, "opera/7") != -1
2207 1014 6 7254 index($ua, "android") != -1 or index($ua, "silk-accelerated") != -1
24 12 7218 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1
36 6 7212 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1 or index($ua, "rim tablet os") != -1
84 330 6336 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'}
330 12 6324 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1
342 36 6288 $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 6288 $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 6192 $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 6192 $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 6186 $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 6186 $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 6186 $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 6180 $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 6180 $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 6174 $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 6174 $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 6174 $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 6168 $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 6168 $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 6168 $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
2313 6 0 7989 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
2387 6 6 6055 $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'}
2391 72 104 7865 $browser_tests->{'obigo'} || index($ua, 'brew') != -1
2447 48 6 894 $model =~ /^KF/ or $model =~ /kindle fire/i
2791 684 4855 5316 @a == 0 or $a[0] < $b[0]
2792 0 3643 1673 @b == 0 or $b[0] < $a[0]
3034 0 0 0 $self->browser_major == 40 || $self->browser_major >= 42