lib/BalanceOfPower/Nation/Role/Shareholder.pm

filter: Statementstmt 68.7% 11 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 60.8% 14 / 23 CC 2 SCAR 11.0
CC
2
Cov
61%
get_stocks
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« blib/lib/BalanceOfPower/Commands/AidInsurgents.pm ↑ Summary blib/lib/BalanceOfPower/Relations/MilitarySupport.pm »
1 package BalanceOfPower::Nation::Role::Shareholder;
2 11 $BalanceOfPower::Nation::Role::Shareholder::VERSION = '0.300010';
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 11 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 11 has available_stocks => (
8 is => 'rw',
9 default => 0
10 );
11  
12 sub get_stocks
13 {
14 0 ▶ my $self = shift;
Subroutine get_stocks: not called CC=2 SCAR=17.9
Pod undocumented
15 0 my $q = shift;
16 0 ▶ if($q <= $self->available_stocks)
Branch: 1 branch
BranchTrueFalseTotal
if ($q <= $self->available_stocks) { } 0 0 0
17 {
18 0 $self->available_stocks($self->available_stocks - $q);
19 }
20 else
21 {
22 0 return 0;
23 }
24 }
25  
26 11 1;
« blib/lib/BalanceOfPower/Commands/AidInsurgents.pm ↑ Summary blib/lib/BalanceOfPower/Relations/MilitarySupport.pm »