Branch Coverage

lib/BalanceOfPower/World.pm
Criterion Covered Total %
branch 145 202 71.7


line true false branch
106 0 1339 unless ($nation)
112 1339 0 if (@nations > 0) { }
126 0 6 unless $nation
127 0 6 if exists $self->nation_codes->{uc $nation}
130 4 23 if uc $_ eq uc $nation
151 0 16 unless open my $nations_file, '<', $file
158 72 16 if (not $n =~ /^#/) { }
161 58 14 if ($government eq 'd') { }
14 0 elsif ($government eq 'D') { }
197 15 1 if ($flags)
200 14 1 if exists $flags->{'trades'}
202 1 14 if exists $flags->{'diplomacy'}
204 15 0 if exists $flags->{'alliances'}
214 28 44 unless $self->silent
216 28 44 unless $self->silent
218 28 44 unless $self->silent
239 2 14 if ($trades) { }
241 2 0 unless $self->silent
246 5 9 unless $self->silent
248 16 0 if ($diplomacy) { }
250 7 9 unless $self->silent
255 0 0 unless $self->silent
257 1 15 if ($alliances) { }
259 1 0 unless $self->silent
264 6 9 if not $self->silent
334 4 43 unless ($turn)
339 8 39 if $self->autoplay
371 0 188 if @newgov > 0
372 52 136 unless $previous_production
392 544 208 if (@prev_prods > 0) { }
402 0 752 if (@retreats)
407 0 752 if $next_prods[$i] < 0
408 28 724 if $next_prods[$i] > 50
413 0 188 if ($cost_for_retreat)
439 4 0 if not $quote or $quote == 0
442 0 0 $nation->production_for_domestic >= $quote ? :
443 0 0 $nation->production_for_export >= $quote ? :
472 122 66 if (@ordered_best_w >= 5)
476 120 490 if ($ordered_best_w[$i]{'nation'} eq $nation_name)
488 122 66 if (@ordered_best_p >= 5)
492 120 490 if ($ordered_best_p[$i]{'nation'} eq $nation_name)
506 0 188 if (@wins > 0)
527 177 0 unless ($command)
529 64 113 if (@nation_orders > 0) { }
540 1 63 if ($command =~ /^DELETE TRADEROUTE (.*)->(.*)$/) { }
3 60 elsif ($command =~ /^ADD ROUTE$/) { }
1 59 elsif ($command =~ /^LOWER DISORDER$/) { }
19 40 elsif ($command =~ /^BUILD TROOPS$/) { }
6 34 elsif ($command =~ /^BOOST PRODUCTION$/) { }
6 28 elsif ($command =~ /DECLARE WAR TO (.*)$/) { }
3 25 elsif ($command =~ /^MILITARY SUPPORT (.*)$/) { }
1 24 elsif ($command =~ /^RECALL MILITARY SUPPORT (.*)$/) { }
8 16 elsif ($command =~ /^AID INSURGENTS IN (.*)$/) { }
1 15 elsif ($command =~ /^TREATY (.*) WITH (.*)$/) { }
1 14 elsif ($command =~ /^ECONOMIC AID FOR (.*)$/) { }
1 13 elsif ($command =~ /^REBEL MILITARY SUPPORT (.*)$/) { }
4 9 elsif ($command =~ /^DIPLOMATIC PRESSURE ON (.*)$/) { }
1 8 elsif ($command =~ /^RECALL REBEL MILITARY SUPPORT (.*)$/) { }
2 6 elsif ($command =~ /^MILITARY AID FOR (.*)$/) { }
6 0 elsif ($command =~ /^PROGRESS$/) { }
564 4 0 unless ($self->war_busy($attacker->name) or $self->war_busy($defender->name))
573 3 0 if ($supported->accept_military_support($supporter->name, $self)) { }
609 1 0 if ($self->at_civil_war($nation2->name)) { }
621 4 0 if ($nation->prestige >= 6)
625 4 0 if ($under_infl ne $nation->name) { }
670 1 44 if (@route_adders > 1)
677 1 0 if ($self->suitable_route_creator($node1)) { }
679 0 1 if (@route_adders == 0) { }
691 1 0 if ($self->suitable_new_route($node1, $second))
697 1 0 if $complete
699 0 1 if ($complete == 0)
711 1 0 if @route_adders == 0
723 43 22 if ($decision)
741 0 28 if ($player_command)
743 0 0 if ($player->stocks($nation) > $quote) { }
745 0 0 if ($winner)
759 0 177 if ($winner) { }
790 20 157 if ($self->at_war($n->name))
794 17 160 if ($self->at_civil_war($n->name))
805 177 0 if ($prod != 0) { }
838 162 15 unless ($self->get_civil_war($n->name))
841 1 161 if ($n->internal_disorder_status eq 'Civil war')
855 8 0 if ($nation1->production_for_export >= 25 and $nation2->internal_disorder_status ne 'Civil war')
894 2 15 if ($winner)
933 3 7 if $cw
949 0 1 if ($diplomatic_status eq 'HATE')
956 0 1 if ($self->get_treaties_for_nation($nation1->name) >= $nation1->treaty_limit or $self->get_treaties_for_nation($nation2->name) >= $nation2->treaty_limit and not $present_treaty)
965 1 0 if ($nation1->prestige >= 7)
967 0 1 if ($present_treaty and $present_treaty->type ne 'alliance') { }
976 1 0 if ($type eq 'COM') { }
0 0 elsif ($type eq 'NAG') { }
978 1 0 if (not $present_treaty)
980 1 0 if ($self->route_exists($nation1->name, $nation2->name)) { }
1025 10 0 unless (grep {$_ eq $n;} @already)
1028 5 5 if $self->war_busy($from) or $self->war_busy($n)
1031 4 6 if $cost > 4
1032 5 5 if $youcan eq 'OK'
1033 5 5 if $youcan eq 'OK'
1038 9 1 unless (grep {$_ eq $n;} @already)
1059 0 0 if ($type eq 'parcel') { }
1066 0 0 $nations[0] ne $out{'from'} ? :