lib/BalanceOfPower/Commands/RecallRebelMilitarySupport.pm

filter: Statementstmt 39.1% 9 / 23 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 2 totaltotal 33.3% 11 / 33 CC 4 SCAR 19.7
CC
4
Cov
33%
IA
12.0
get_available_targets
6.0
BEGIN
1.0
CRAP 7.1
« lib/BalanceOfPower/Commands/MilitarySupport.pm ↑ Summary lib/BalanceOfPower/Relations/RelPack.pm »
1 package BalanceOfPower::Commands::RecallRebelMilitarySupport;
2 13 $BalanceOfPower::Commands::RecallRebelMilitarySupport::VERSION = '0.400115';
3 13 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 13 ▶use BalanceOfPower::Constants ':all';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 13 extends 'BalanceOfPower::Commands::TargetNation';
8  
9 sub get_available_targets
10 0 ▶{
Subroutine get_available_targets: not called CC=2 SCAR=17.9
Pod undocumented
11 0 my $self = shift;
12 0 my @supported = $self->world->rebel_supporter($self->actor);
13 0 my @out = ();
14 0 for(@supported)
15 {
16 0 push @out, $_->destination($self->actor);
17 }
18 0 return @out;
19 }
20  
21 sub IA
22 0 ▶{
Subroutine IA: not called CC=3 SCAR=24.8
Pod undocumented
23 0 my $self = shift;
24 0 my $actor = $self->get_nation();
25 0 ▶ if($actor->army <= ARMY_TO_RECALL_SUPPORT)
Branch: 1 branch
BranchTrueFalseTotal
if ($actor->army <= 2) 0 0 0
26 {
27 0 my @supports = $self->get_available_targets();
28 0 ▶ if(@supports > 0)
Branch: 1 branch
BranchTrueFalseTotal
if (@supports > 0) 0 0 0
29 {
30 0 @supports = $self->world->shuffle("Choosing support to recall", @supports);
31 0 return "RECALL REBEL MILITARY SUPPORT " . $supports[0];
32 }
33 }
34 0 return undef;
35 }
36  
37 13 1;
« lib/BalanceOfPower/Commands/MilitarySupport.pm ↑ Summary lib/BalanceOfPower/Relations/RelPack.pm »