Branch Coverage

lib/Catan/Game/Player.pm
Criterion Covered Total %
branch 48 70 68.5


line true false branch
44 0 0 if $self->{'resources'}{$_} > 0
94 0 30 unless @{$self->roads;} < 15
96 0 30 unless $self->has_connecting_property($location) or $self->has_connecting_road($location)
101 0 20 if @{$self->settlements;} == 2 and not $location->is_adjacent($self->settlements->[1]->location) and @{$self->roads;} == 1
103 18 12 unless $free
127 0 13 unless @{$self->settlements;} < 5
129 0 13 unless $free or $self->has_connecting_road($location)
132 5 8 unless $free
145 0 5 unless @{$self->cities;} < 4
151 5 8 if ($_->location->is_colliding($intersection)) { }
161 5 0 if ($city)
176 1 7 if $type eq 'VP'
185 0 7 unless $type
187 0 7 if $self->has_played_dc
190 0 7 if $type eq 'VP'
197 7 3 if ($_->type eq $type and not $card) { }
206 0 7 unless $card
232 47 394 $self->{'longest_road'} ? :
6 435 $self->{'largest_army'} ? :
238 0 1 $self->{'largest_army'} ? :
244 1 2 $self->{'longest_road'} ? :
264 350 1050 if grep $prop->location->is_colliding($_->location), @{$self->properties;}
288 0 3624 unless $paths and ref $paths eq 'ARRAY' and @$paths and $intersections and ref $intersections eq 'HASH' and keys %$intersections
301 4856 3264 if scalar grep($connecting_road->location->is_colliding($_->{'road'}->location), @$path)
305 1486 1778 if ($connecting_road->location->start eq $uuid) { }
1778 0 elsif ($connecting_road->location->end eq $uuid) { }
314 3264 0 if ($next_uuid)
323 2432 1192 if (@new_paths)
339 1 83 if ($_->code eq 'HR') { }
0 83 elsif ($_->code eq 'HRB') { }
0 83 elsif ($_->code eq 'HRG') { }
3 80 elsif ($_->code eq 'HRL') { }
0 80 elsif ($_->code eq 'HRO') { }
0 80 elsif ($_->code eq 'HRW') { }
343 5 0 if $v == 4