Branch Coverage

blib/lib/Parse/HTTP/UserAgent/Base/Parsers.pm
Criterion Covered Total %
branch 266 334 79.6


line true false branch
10 190 0 ref $_ eq 'ARRAY' ? :
14 186 476 if (my(@match) = $e =~ / \A [.]NET (?: \s+ CLR \s+ )? (.+?) \z /msx)
18 180 296 if ($e =~ / \A Win(dows|NT|[0-9]+)? /imsx)
19 178 2 if ($1 and $1 ne '64')
33 22 26 unless $self->[6]
36 12 44 if ($e =~ m[ \A (Opera \s+ Mini) / (.+?) \z ]msx)
46 24 2 @buf ? :
52 2 58 if (${$v_ref;} and not ${$v_ref;} =~ / [0-9] /msx)
57 8 52 if (${$os_ref;} and ${$os_ref;} =~ m[ http:// ]msx)
72 10 34 if ($is_30) { }
76 10 10 if (index($others[$i], 'Maxthon') != -1)
93 36 262 if (index(uc $e, 'MAXTHON') != -1)
97 46 216 if (index(uc $e, 'MSIE') != -1)
106 0 44 unless ($maxthon)
112 10 34 if ($is_30) { }
113 4 6 if ($self->[8])
119 0 34 unless ($msie)
129 10 34 $is_30 ? :
132 22 0 $maxthon ? :
22 22 $mv ? :
147 2 168 if (@{$extras;} == 2 and index($extras->[1], 'Lunascape') != -1)
153 76 94 if @{$dotnet;}
155 6 164 if ($extras->[0] and $extras->[0] eq 'Mac_PowerPC')
162 44 244 if (index($e, 'Trident/') != -1)
165 44 0 if ($tk_name eq 'Trident' and $tk_version)
166 2 42 if ($tk_version eq '7.0' and $self->[25] ne '11.0') { }
4 38 elsif ($tk_version eq '6.0' and $self->[25] ne '10.0') { }
189 4 226 lc $thing eq 'touch' ? :
201 104 66 @extras ? :
210 10 2 if (ref $extra eq 'ARRAY') { }
212 10 10 if $_ ne 'like'
220 12 44 if (index($e, 'rv:') != -1)
227 0 12 unless $self->_parse_msie(undef, $thing, $extra, 'MSIE', $version)
229 2 0 if ($self->[22] and $self->[6])
233 2 0 $_ eq 'ARM' ? :
239 0 2 @extras ? :
251 10 34 if (ref $e eq 'ARRAY' and @{$e;} > 0 and index(lc $e->[-1], 'fennec') != -1)
281 10 0 unless $self->[8]
283 0 0 if (lc $self->[8] eq 'tablet') { }
0 0 elsif (index($self->[8], ' ') != -1) { }
306 12 48 if ($ipad)
308 4 8 if ($junkv and $junkv eq 'Mobile')
316 12 44 $ipad ? :
4 56 $ep ? :
320 60 0 $extra ? :
321 36 24 if ($thing->[-1] and length $thing->[-1] <= 5)
328 58 2 @{$thing;} && length $thing->[-1] > 1 ? :
330 0 60 if ($self->[14] and lc $self->[14] eq 'macintosh')
335 6 54 if ($thing->[0] and lc $thing->[0] eq 'iphone')
340 2 4 if ($check_os and index($check_os, 'Mac OS X') != -1)
341 2 0 if ($self->[14])
346 2 0 if (not $self->[8] and $self->[21])
348 2 0 if ($v and $v =~ / [a-zA-Z]{2}_[a-zA-Z]{2} /msx)
359 0 60 if ($self->[14] and length $self->[14] == 1)
364 2 58 if ($self->[8] and not $self->[8] =~ /[a-zA-Z]+/gmsx)
370 26 34 if @junk
371 60 0 if $extra
373 60 0 @extras ? :
383 2 14 if ($rest[0] and index($rest[0], 'OPR/', 0) != -1) { }
385 2 0 if (ref $extra eq 'ARRAY')
395 2 14 $opera ? :
403 2 0 if (not $extra and $others[0] and index($others[0], 'AppleWebKit') != -1)
410 42 0 if $extra
415 38 220 if ($junk eq 'Mobile')
419 42 178 if (index($junk, 'Version') != -1)
427 42 0 if ($self->[4])
433 42 0 if @build
434 40 2 @build ? :
437 40 2 if ($device and $build)
442 0 40 if (@btest)
448 42 0 if (@extras >= 3 and $extras[0] and $extras[0] eq 'KHTML,')
456 38 4 $is_phone ? :
457 42 0 @extras_final ? :
466 2 34 @{$thing;} && index($thing->[-1], 'rv:') != -1 ? :
469 2 34 if $name ne 'Opera'
474 22 12 if ($extra)
479 10 12 $swap ? :
480 10 12 if ($swap)
482 10 0 if $vjunk
486 2 32 if $ffaker
493 16 18 if ($tk_parsed_as_lang)
495 16 0 if $extra
500 24 10 if (@{$thing;} and $self->_is_strength($thing->[-1])) { }
508 22 12 $extra ? :
510 20 14 @extras ? :
518 8 6 if $compatible
523 6 8 if (@{$thing;} and $self->_is_strength($thing->[-1])) { }
531 14 0 $extra ? :
532 6 8 @extras ? :
539 76 22 defined $extra->[1] ? :
542 98 0 if ($version)
548 96 2 $extra->[0] ? :
552 88 10 if (@{$thing;} and index($thing->[-1], 'rv:') != -1)
555 0 88 if ($len_thing == 3) { }
22 66 elsif ($len_thing <= 2) { }
557 0 0 if ($self->[14] and $self->[14] eq 'Macintosh')
560 0 0 if @{$thing;}
563 10 12 if ($thing->[0] eq 'X11' or index($thing->[-1], 'Intel') != -1) { }
6 6 elsif (index(lc $thing->[0], 'android') != -1 or index(lc $thing->[0], 'maemo') != -1) { }
566 2 8 if (index(lc $thing->[-1], 'linux arm') != -1) { }
581 2 4 if (lc $self->[4] eq 'tablet')
586 4 2 if ($len_thing > 1) { }
587 2 2 if ($thing->[-1] ne 'WOW64')
606 98 0 $extra ? :
609 96 2 @extras ? :
619 50 0 if ($self->[11] and $self->[25])
622 6 44 if $self->[11] eq 'Netscape6'
623 2 48 if $self->[11] eq 'Beonex'
628 0 130 unless $e
629 46 84 if (my $s = $self->_is_strength($e))
633 4 80 if ($e =~ / \s i\d86 /msx)
635 4 0 if $os
636 2 2 if $lang
639 6 74 if (not $self->[14] and $e =~ / Win(?:NT|dows) /imsx)
643 2 72 if ($e =~ / \A [a-z]{2} \z /msx)
647 2 70 if ($e =~ m[ \A (Epiphany) / (.+?) \z ]imsx)
654 50 0 @buf ? :
655 8 42 if $before ne $self->[11]
660 0 0 if (ref $self->[21] eq 'ARRAY' and $self->[21][0] eq 'Gecko')
662 0 0 if ($self->[11] and $self->[25])
673 8 18 if ($self->[14] and length $self->[14] == 2)
684 22 6 if not $os || $skip_os or $os ne 'windows' and not $skip_os or ref $self->[6] ne 'ARRAY' or not $self->[6][0] or not $self->[6][0] =~ / NT\s?(\d.*?) \z /imsx
701 26 38 if (my $s = $self->_is_strength($e))
708 4 22 $buf[0] eq 'X11' ? :
710 12 14 @buf ? :
711 12 14 if ($junk)
713 12 0 if $junk
721 20 30 unless @{$t;}
723 6 24 if $mname eq 'Mozilla' or $mname eq 'Emacs-W3'
725 6 18 if (index($mname, 'Nokia') != -1)
728 4 0 if ($device and $num and $os and $series and index($os, 'SymbianOS') != -1)
743 10 8 $t->[0] && !($t->[0] =~ / \d+ [.]? \d /msx) ? :
2 18 @rest ? :
745 2 18 $extra ? :
751 16 4 @extras ? :
761 74 36 unless $ok
764 18 18 if (@moz == 1)
766 18 0 if ($name and $version)
781 48 44 unless $compatible and @{$thing;}
785 40 4 $mname eq 'Mozilla' ? :
788 4 36 if $thing->[0] and $thing->[0] eq $name || $thing->[0] eq $moz
794 4 40 if ($name eq 'MSIE')
795 0 4 if ($self->_is_generic_bogus_ie($extra)) { }
2 2 elsif ($extra) { }
807 2 0 if @{$dotnet;}
811 2 0 if index($moz, ' ') != -1
815 16 24 $extra ? :
40 2 unless @extras
817 2 40 if ($lang and index($lang, 'MSIE ') != -1)
832 24 16 @extras ? :
847 4 0 if $self->[14]
849 0 4 if $extra and ref $extra eq 'ARRAY'
850 0 4 if @others
852 4 0 @extras ? :
864 4 16 if (index($name, 'Symbian') != -1)
868 2 14 if ($name eq 'Mozilla' and @parts)
870 0 2 unless $name and $version
875 14 2 @parts ? :
877 0 16 unless $self->[25]
886 0 8 unless $os and $series_device
890 0 8 unless $device
897 8 0 @extras ? :
910 2 0 if ($parsable)
912 2 0 if (@parts > 2)
916 2 0 @parts ? :
924 2 0 if ($thing->[0] and index(lc $thing->[0], 'googlebot-mobile') != -1)
928 2 0 @{$thing;} > 0 ? :