Condition Coverage

blib/lib/HTTP/BrowserDetect.pm
Criterion Covered Total %
condition 330 409 80.6


and 3 conditions

line !l l&&!r l&&r condition
643 2883 2562 732 index($ua, "gecko") != -1 and index($ua, "like gecko") == -1
2913 0 2532 $ua =~ m[applewebkit/([\d.\+]+)] and not $tests->{'edgehtml'}
673 6437 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
994 6179 966 6 $self->android and index($ua, "; wv)") > 0
5789 810 546 $self->chrome and $self->android
6599 96 450 $self->chrome and $self->android and $self->browser_major >= 30
1053 8592 24 6 index($ua, "yahoo") != -1 and index($ua, "jp.co.yahoo") == -1
8227 0 42 $ua =~ /^java/ and not $self->{'browser'}
1335 7563 491 598 exists $robot_tests->{'robot'} and $robot_tests->{'robot'} eq "unknown"
1354 705 276 36 $self->{'user_agent'} eq $full_string and $self->{'user_agent'} =~ m[\/.*\/]
981 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
1371 0 365 652 $full_string and $full_string =~ s[[/ \.v]*(\d+)(\.\d+)?([\.\w]*)$][]
1536 1926 36 42 $tests->{'x11'} and index($ua, "cros") != -1
90 1854 0 index($ua, "samsung") == -1 and index($ua, "sun") != -1
1724 5418 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
1733 1716 2970 2460 $os and not $os_string
1812 1159 5685 264 defined $browser and $browser eq "opera"
1547 1328 18 $browser eq "chrome" and $ua =~ m[crios/(\d+)\.(\d+)([\d.]*)]
2869 0 6 $browser eq "pubsub" and $ua =~ m[apple-pubsub/(\d+)\.?(\d+)?([\d.]*)]
2785 6 78 $browser eq "obigo" and $self->{'user_agent'} =~ m[(obigo[\w\-]*|teleca)[\/ ]\w(\d+)(\w*)]i
2785 0 6 $browser eq "polaris" and $ua =~ m[polaris[ \/](\d+)\.?(\d+)?([\d\.]*)]
2450 0 335 $browser eq "ucbrowser" and $ua =~ m[ucbrowser[\/ ]*(\d+)\.?(\d+)?([\d\.]*)]
2444 0 6 $browser eq "samsung" and $ua =~ m[samsungbrowser/(\d+)\.(\d+)\s]
1976 3685 961 2462 not defined $major and defined $self->{'browser_string'}
2028 773 3468 2867 defined $beta and $beta eq ""
2039 144 18 6 $major == 4 and $minor == 5
2040 144 18 6 $major == 4 and ".$minor" >= "0.5"
2043 150 12 6 defined $beta and index($beta, "gold") != -1
2066 1637 47 24 $major == 5 and $minor == 5
2078 242 6 71 $version_tests->{'ie7'} && $tests->{'trident'} && defined $self->engine_version && $self->engine_version >= 4
2097 258 6 0 index($ua, "opera/4") != -1 and index($ua, "nintendo dsi") == -1
2132 6272 0 36 index($ua, "nokia") != -1 and index($ua, "windows phone") == -1
2316 7886 60 276 $browser_tests->{'ucbrowser'} and $self->{'user_agent'} =~ m[ucweb/2.0\s*\(([^\;\)]*\;){3,4}\s*([^\;\)]*?)\s*\)]i
7758 68 108 $browser_tests->{'obigo'} || index($ua, 'brew') != -1 and $self->{'user_agent'} =~ m[\d+x\d+ ([\d\w\- ]+?)( \S+\/\S+)*$]i
2560 103 648 1 defined $self->{'browser'} && $self->{'browser'} eq 'realplayer'
2776 280 8 1290 $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+(\.\d+)?)/
2783 601 1 1588 $self->{'engine_version'} && $self->{'engine_version'} =~ /^(\d+)/
2790 562 23 1508 $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+(\.\d+)/
2797 288 14 1103 $self->{'engine_version'} && $self->{'engine_version'} =~ /^\d+\.\d+([\.\d\+]*)/
2846 247 0 8 $self->major == 1 and $self->{'user_agent'} =~ /\s ( [a-z]{2} ) \)/msx
2855 1640 10 3 $self->aol and $self->{'user_agent'} =~ /;([A-Z]{2})_([A-Z]{2})\)/
2873 147 0 1 $self->webview && $1 eq 'wv'
4711 1 147 $part =~ /^\s*([a-z]{2})\s*$/ and not $self->webview && $1 eq 'wv'
2941 0 0 0 $self->chrome and $self->browser_major
0 0 0 $self->chrome and $self->browser_major and $self->browser_major >= 41
2947 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
505 6225 16762 $self->{'tests'}{$test} || 0
518 3822 46744 $self->{'os_tests'}{$test} || 0
527 4676 53439 $self->{'browser_tests'}{$test} || 0
555 1915 22415 $self->{'version_tests'}{$test} || 0
565 2687 19503 $self->{'device_tests'}{$test} || 0
2555 0 0 $self->{'realplayer_version'} || 0
2601 919 0 $minor ||= ""
2629 4 2 $minor ||= ""

or 3 conditions

line l !l&&r !l&&!r condition
542 133 0 30462 $self->{'robot_tests'}{$test} || $false_result
673 944 786 4449 $tests->{'trident'} or index($ua, "msie") != -1
1730 0 4449 $tests->{'trident'} or index($ua, "msie") != -1 or index($ua, "microsoft internet explorer") != -1
1344 18 2661 index($ua, "chrome/") != -1 or index($ua, "crios") != -1
24 12 2625 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1
36 6 2619 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1 or index($ua, "rim tablet os") != -1
906 66 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/
734 36 6 1688 index($ua, "aol") != -1 or index($ua, "america online browser") != -1
810 264 12 696 index($ua, " mobile safari/") != -1 or index($ua, "mobilesafari") != -1
865 18 90 60 index($ua, "netscape") != -1 or not $tests->{'gecko'}
951 1080 4898 6 $browser_string || $BROWSER_NAMES{$browser}
994 6 3012 4133 $self->android and index($ua, "; wv)") > 0 or $self->chrome and $self->android and $self->browser_major >= 30
1053 18 0 8634 index($ua, "libwww-perl") != -1 or index($ua, "lwp-") != -1
6 18 8580 index($ua, "binglocalsearch") != -1 or index($ua, "bingbot") != -1
24 6 8574 index($ua, "binglocalsearch") != -1 or index($ua, "bingbot") != -1 or index($ua, "bingpreview") != -1
30 6 8490 index($ua, "libcurl") != -1 or $ua =~ /^curl/
1271 7 15 8630 $browser_tests->{'applecoremedia'} or $browser_tests->{'dalvik'}
15 7 8623 $browser_tests->{'applecoremedia'} or $browser_tests->{'dalvik'} or $browser_tests->{'adm'}
1290 491 0 0 $ROBOT_NAMES{$id} || $ROBOT_NAMES{$r}
1414 0 12 2946 index($ua, "win16") != -1 or index($ua, "windows 3") != -1
12 0 2946 index($ua, "win16") != -1 or index($ua, "windows 3") != -1 or index($ua, "windows 16-bit") != -1
12 60 2874 index($ua, "win95") != -1 or index($ua, "windows 95") != -1
24 6 2844 index($ua, "win 9x 4.90") != -1 or index($ua, "windows me") != -1
12 12 2820 index($ua, "win98") != -1 or index($ua, "windows 98") != -1
1481 90 0 3708 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
1536 456 6 3840 index($ua, "macintosh") != -1 or index($ua, "mac_") != -1
18 216 3606 index($ua, "ipod") != -1 or index($ua, "iphone") != -1
234 144 3462 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
1553 0 0 462 index($ua, "68k") != -1 or index($ua, 68000) != -1
120 6 336 index($ua, "ppc") != -1 or index($ua, "powerpc") != -1
1724 6 6 6 $self->mobile || $self->tablet
2040 6 90 72 $major == 4 and ".$minor" >= "0.5" or $major >= 5
2045 78 6 84 $major == 5 or $major == 6
2067 30 1561 117 ".$minor" >= "0.5" or $major >= 6
2085 6 0 35 index($ua, "aol 3.0") != -1 or $version_tests->{'ie3'}
2088 0 0 41 index($ua, "aol 4.0") != -1 or $version_tests->{'ie4'}
2095 0 6 258 index($ua, "opera 3") != -1 or index($ua, "opera/3") != -1
2097 0 0 264 index($ua, "opera 4") != -1 or index($ua, "opera/4") != -1 and index($ua, "nintendo dsi") == -1
2101 0 0 264 index($ua, "opera 5") != -1 or index($ua, "opera/5") != -1
2104 12 0 252 index($ua, "opera 6") != -1 or index($ua, "opera/6") != -1
2107 18 12 234 index($ua, "opera 7") != -1 or index($ua, "opera/7") != -1
2132 966 6 7196 index($ua, "android") != -1 or index($ua, "silk-accelerated") != -1
24 12 7160 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1
36 6 7154 index($ua, "blackberry") != -1 or index($ua, "bb10") != -1 or index($ua, "rim tablet os") != -1
84 330 6320 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'}
330 12 6308 $browser_tests->{'obigo'} or $browser_tests->{'ucbrowser'} or index($ua, "up.browser") != -1
342 36 6272 $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 6272 $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 6176 $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 6176 $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 6170 $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 6170 $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 6170 $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 6164 $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 6164 $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 6158 $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 6158 $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 6158 $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 6152 $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 6152 $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 6152 $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
2238 6 0 7891 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
2312 6 6 6035 $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'}
2316 72 104 7758 $browser_tests->{'obigo'} || index($ua, 'brew') != -1
2372 48 6 852 $model =~ /^KF/ or $model =~ /kindle fire/i
2716 403 3903 4713 @a == 0 or $a[0] < $b[0]
2717 0 3273 1440 @b == 0 or $b[0] < $a[0]
2947 0 0 0 $self->browser_major == 40 || $self->browser_major >= 42