Branch Coverage

blib/lib/MongoDB/_URI.pm
Criterion Covered Total %
branch 98 160 61.2


line true false branch
186 24 0 if &Int()->($v)
196 15 4 if (&looks_like_number($v))
203 2 1 if &Int()->($v) and $v >= -1
207 3 0 if &Int()->($v)
211 10 0 if &Int()->($v)
218 0 1462 unless defined $str
219 70 1392 if ($str =~ s/%([0-9a-f]{2})/chr hex $1;/egi)
229 12 0 if ($tag =~ /\S/)
231 1 11 if (@kv != 2)
247 6 267 unless @kv == 2
251 6 261 unless ($valid->{$lc_k})
252 0 6 if ($txt_record) { }
259 2 259 if (exists $parsed{$lc_k} and not exists $options_with_list_type{$lc_k})
263 3 256 if ($lc_k eq 'authmechanismproperties') { }
5 251 elsif ($lc_k eq 'compressors') { }
14 237 elsif ($lc_k eq 'authsource') { }
6 231 elsif ($lc_k eq 'readpreferencetags') { }
55 176 elsif ($self->_valid_str_to_bool_options->{$lc_k}) { }
68 108 elsif (my $opt_validation = $self->_extra_options_validation->{$lc_k}) { }
265 3 0 if (defined $temp)
267 2 1 if (exists $parsed{$lc_k}{'CANONICALIZE_HOST_NAME'})
269 2 0 if (defined $temp)
284 0 6 unless $valid_compressors->{$compressor}
294 5 1 if (defined $temp)
300 47 8 if (defined $temp)
305 30 38 unless (ref $opt_validation eq 'CODE')
310 22 46 if (not $valid) { }
321 9 192 if (exists $parsed{'tlsinsecure'} or exists $parsed{'tlsallowinsecure'})
322 8 1 if (exists $parsed{'tlsallowinvalidcertificates'} or exists $parsed{'tlsallowinvalidhostnames'})
326 4 5 if (exists $parsed{'tls'} and exists $parsed{'ssl'} and $parsed{'tls'} != $parsed{'ssl'})
336 0 0 unless scalar @split_name > 2
348 0 0 if ($srv_data) { }
350 0 0 unless $rr->type eq 'SRV'
353 0 0 unless ($target =~ /\.\Q$domain_name\E$/)
356 0 0 if ($phase and $phase eq 'init') { }
368 0 0 if not defined $minimum_ttl or $rr->ttl < $minimum_ttl
372 0 0 if (defined $txt_data)
375 0 0 unless $rr->type eq 'TXT'
378 0 0 if (scalar @txt_answers > 1) { }
0 0 elsif (scalar @txt_answers == 1) { }
389 0 0 unless (@hosts)
391 0 0 if ($phase and $phase eq 'init') { }
399 0 0 if $minimum_ttl < 60 and $phase and $phase ne 'init'
420 0 2 unless (defined $result{'hostids'} and length $result{'hostids'})
424 1 1 if ($result{'hostids'} =~ /,/)
428 1 0 if ($result{'hostids'} =~ /:\d+$/)
432 0 0 if (defined $result{'options'})
442 0 0 unless $result{'options'}
446 0 0 if (defined $result{'username'} or defined $result{'password'})
457 0 0 scalar keys %$options ? :
474 0 0 if (defined $self->{'expires'} and $self->{'expires'} <= &MongoDB::_URI::time())
482 0 0 unless ($ok)
486 0 0 unless $ok
489 0 0 unless @current == @new
492 0 0 unless $new[$index] eq $current[$index]
504 5 537 unless (defined $hostids and length $hostids)
509 34 546 if $hostid =~ m[/] and $hostid =~ /\.sock/
512 15 531 if substr($hostid, 0, 1) eq '['
516 3 528 unless length $host
518 136 392 if (defined $port)
519 9 127 unless $port =~ /^\d+$/
521 5 122 unless $port >= 1 and $port <= 65535
526 120 387 /:/ ? :
539 0 0 unless ($uri =~ /^$uri_re$/)
555 2 556 if ($uri =~ m[^mongodb\+srv://])
561 5 551 unless ($uri =~ /^$uri_re$/)
570 68 483 if (defined $result{'username'})
573 6 62 if __userinfo_invalid_chars($result{'username'})
577 46 499 if (defined $result{'password'})
580 3 43 if __userinfo_invalid_chars($result{'password'})
586 227 244 if (defined $result{'db_name'})
589 1 226 if $result{'db_name'} =~ m[/]
593 207 263 if (defined $result{'options'})
599 932 1780 if defined $result{$attr}
607 0 57 unless defined $str
609 23 8 $str eq 'false' ? :
26 31 $str eq 'true' ? :
610 8 49 unless defined $ret
622 0 0 if ($] ge '5.008') { }
627 0 0 if length $str == do { use bytes; length $str }