lib/BalanceOfPower/Commands/InMilitaryRange.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 8 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod 0.0% 0 / 1 totaltotal 96.8% 31 / 32 CC 6 SCAR 16.7
CC
6
Cov
100%
get_available_targets
6.0
BEGIN
1.0
CRAP 5.3
« blib/lib/BalanceOfPower/Role/Logger.pm ↑ Summary lib/BalanceOfPower/Commands/BuildTroops.pm »
1 package BalanceOfPower::Commands::InMilitaryRange;
2 11 $BalanceOfPower::Commands::InMilitaryRange::VERSION = '0.200000';
3 11 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 11 extends 'BalanceOfPower::Commands::TargetNation';
6  
7 11 has crisis_needed => (
8 is => 'ro',
9 default => 0
10 );
11  
12 sub get_available_targets
13 {
14 41 ▶ my $self = shift;
Subroutine get_available_targets: called CC=6 SCAR=17.9
Pod undocumented
15 41 my $player = $self->actor;
16 41 my @out = ();
17 41 for($self->SUPER::get_available_targets())
18 {
19 164 my $n = $_;
20 164 my $push = 0;
21 164 ▶ if($self->world->in_military_range($player, $n))
Branch: 1 branch
BranchTrueFalseTotal
if ($self->world->in_military_range($player, $n)) 65 99 164
22 {
23 65 ▶ if($self->crisis_needed)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->crisis_needed) { } 35 30 65
24 {
25 35 ▶ if($self->world->crisis_exists($player, $n))
Branch: 1 branch
BranchTrueFalseTotal
if ($self->world->crisis_exists($player, $n)) 17 18 35
26 {
27 17 $push = 1;
28 }
29 }
30 else
31 {
32 30 $push = 1;
33 }
34 }
35 164 ▶ if($push)
Branch: 1 branch
BranchTrueFalseTotal
if ($push) 47 117 164
36 {
37 47 push @out, $n;
38 }
39 }
40 41 return @out;
41 }
42  
43 11 1;
« blib/lib/BalanceOfPower/Role/Logger.pm ↑ Summary lib/BalanceOfPower/Commands/BuildTroops.pm »