lib/BalanceOfPower/Commands/MilitaryAid.pm

filter: Statementstmt 100% 17 / 17 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 91.3% 21 / 23 CC 3 SCAR 7.9
CC
3
Cov
95%
IA
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« lib/BalanceOfPower/Commands/LowerDisorder.pm ↑ Summary lib/BalanceOfPower/Commands/RecallMilitarySupport.pm »
1 package BalanceOfPower::Commands::MilitaryAid;
2 11 $BalanceOfPower::Commands::MilitaryAid::VERSION = '0.200000';
3 11 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use BalanceOfPower::Constants ":all";
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 11 extends 'BalanceOfPower::Commands::TargetNation';
8  
9 sub IA
10 {
11 4 ▶ my $self = shift;
Subroutine IA: called CC=3 SCAR=11.0
Pod undocumented
12 4 my $actor = $self->get_nation();
13  
14 4 my @friends = $self->world->shuffle("Choosing nation to military aid for " . $actor->name, $self->world->get_friends($actor->name));
15 4 for(@friends)
16 {
17 2 my $f = $_;
18 2 ▶ if($self->world->get_nation($f)->army < MINIMUM_ARMY_FOR_AID)
Branch: 1 branch
BranchTrueFalseTotal
if ($self->world->get_nation($f)->army < 4) 2 0 2
19 {
20 2 return "MILITARY AID FOR $f";
21 }
22 }
23 2 return undef;
24 }
25  
26 11 1;
« lib/BalanceOfPower/Commands/LowerDisorder.pm ↑ Summary lib/BalanceOfPower/Commands/RecallMilitarySupport.pm »