lib/BalanceOfPower/Nation/Role/Shareholder.pm

filter: Statementstmt 93.7% 15 / 16 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 86.9% 20 / 23 CC 2 SCAR 3.6
CC
2
Cov
89%
get_stocks
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« lib/BalanceOfPower/Relations/MilitarySupport.pm ↑ Summary lib/BalanceOfPower/Relations/Crisis.pm »
1 package BalanceOfPower::Nation::Role::Shareholder;
2 11 $BalanceOfPower::Nation::Role::Shareholder::VERSION = '0.200000';
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 2 ▶ my $self = shift;
Subroutine get_stocks: called CC=2 SCAR=7.4
Pod undocumented
15 2 my $q = shift;
16 2 ▶ if($q <= $self->available_stocks)
Branch: 1 branch
BranchTrueFalseTotal
if ($q <= $self->available_stocks) { } 2 0 2
17 {
18 2 $self->available_stocks($self->available_stocks - $q);
19 }
20 else
21 {
22 0 return 0;
23 }
24 }
25  
26 11 1;
« lib/BalanceOfPower/Relations/MilitarySupport.pm ↑ Summary lib/BalanceOfPower/Relations/Crisis.pm »