Condition Coverage

blib/lib/MongoDB/_Topology.pm
Criterion Covered Total %
condition 61 143 42.6


and 3 conditions

line !l l&&!r l&&r condition
310 0 0 0 $cluster_time and exists $cluster_time->{'clusterTime'}
0 0 0 $cluster_time and exists $cluster_time->{'clusterTime'} and ref $cluster_time->{'clusterTime'} eq 'BSON::Timestamp'
382 305 25 0 $type eq 'Single' and @addresses > 1
446 106 0 0 $link and $link->is_connected
465 53 0 0 defined $op and defined $op->session
488 0 0 0 $mode eq 'primary' and $self->current_primary
0 0 0 $mode eq 'primary' and $self->current_primary and $self->next_scan_time > &MongoDB::_Topology::time()
500 0 0 0 $mode eq 'primary' and $self->type eq 'ReplicaSetWithPrimary' || 1 == keys %{$self->servers;}
519 0 0 0 $server and my $link = $self->_get_server_link($server)
540 53 0 0 $self->current_primary and $self->next_scan_time > &MongoDB::_Topology::time()
727 133 9 117 defined $timeout and $timeout < 0
740 0 0 0 @servers == 1 and $servers[0]->type eq 'Standalone'
776 3 26 3 $self->type eq 'ReplicaSetWithPrimary' || $self->type eq 'ReplicaSetNoPrimary' and $max_staleness_sec < &max(90, $self->heartbeat_frequency_sec + 10)
974 0 0 0 $link and $link->connected
1044 223 0 0 $self->current_primary and $self->current_primary->address eq $address
1106 0 1007 53 not $self->server_selection_try_once and $scan_ready_time > $max_time
1177 0 0 0 $link->supports_clusterTime and defined $self->cluster_time
1211 0 0 0 $e->$MongoDB::_Topology::_isa('MongoDB::DatabaseError') and $e->code == 11
1218 0 0 0 $e->$MongoDB::_Topology::_isa('MongoDB::NetworkError') and $link->server
0 0 0 $e->$MongoDB::_Topology::_isa('MongoDB::NetworkError') and $link->server and $link->server->type ne 'Unknown'
0 0 0 $e->$MongoDB::_Topology::_isa('MongoDB::NetworkError') and $link->server and $link->server->type ne 'Unknown' and $link->server->type ne 'PossiblePrimary'
1350 16 1 0 $new_server->me and lc $new_server->me ne $new_server->address
1360 1 0 0 length $primary and $self->servers->{$primary}
0 0 0 length $primary and $self->servers->{$primary} and $self->servers->{$primary}->type eq 'Unknown'
1389 32 8 20 defined $set_version and defined $election_id
1390 7 0 13 defined $max_election_id and defined $max_set_version
7 8 5 defined $max_election_id and defined $max_set_version and $max_set_version > $set_version || $max_set_version == $set_version && "$max_election_id" gt "$election_id"
1410 32 16 6 defined $set_version and !defined($max_set_version) || $set_version > $max_set_version
1460 7 0 1 $new_server->me and $new_server->me ne $new_server->address
1467 5 0 2 length $primary and $self->servers->{$primary}
0 0 2 length $primary and $self->servers->{$primary} and $self->servers->{$primary}->type eq 'Unknown'

or 2 conditions

line l !l condition
566 0 0 $no_cooldown // 0
652 116 401 $last_update || 0
1005 106 0 $@ || 'Unknown error'
1265 0 0 $is_master || {}

or 3 conditions

line l !l&&r !l&&!r condition
370 0 2 45 $type eq 'Single' or $type eq 'ReplicaSetNoPrimary'
409 0 0 53 $type eq 'Sharded' or $type eq 'Unknown'
500 0 0 0 $self->type eq 'ReplicaSetWithPrimary' || 1 == keys %{$self->servers;}
534 53 0 0 $self->type eq 'Single' || $self->type eq 'Sharded'
550 0 0 0 $self->type eq 'ReplicaSetWithPrimary' or 1 == keys %{$self->servers;}
700 3 0 216 $server_min_wire_version > $self->max_wire_version or $server_max_wire_version < $self->min_wire_version
776 16 13 3 $self->type eq 'ReplicaSetWithPrimary' || $self->type eq 'ReplicaSetNoPrimary'
908 3 3 1 $self->_find_primary_server(@candidates) || $self->_find_secondary_server($read_pref, @candidates)
926 6 3 2 $self->_find_secondary_server($read_pref, @candidates) || $self->_find_primary_server(@candidates)
1023 0 0 0 $self->type eq 'Single' or &first(sub { $_ eq $server->type; } , 'Standalone', 'Mongos', 'RSPrimary', 'RSSecondary')
1061 10 106 0 $update_time //= &MongoDB::_Topology::time()
1342 0 2 15 not $self->servers->{$new_server->address} or $self->replica_set_name ne $new_server->set_name
1390 3 4 6 $max_set_version > $set_version || $max_set_version == $set_version && "$max_election_id" gt "$election_id"
1410 11 3 8 !defined($max_set_version) || $set_version > $max_set_version