lib/BalanceOfPower/Relations/Treaty.pm

filter: Statementstmt 39.3% 13 / 33 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 3 totaltotal 30.7% 16 / 52 CC 5 SCAR 22.0
CC
5
Cov
32%
short_tag
20.0
dump
6.0
__ANON__
2.0
CRAP 9.0
« blib/lib/BalanceOfPower/Role/Historian.pm ↑ Summary blib/lib/BalanceOfPower/Commands/RebelMilitarySupport.pm »
1 package BalanceOfPower::Relations::Treaty;
2 11 $BalanceOfPower::Relations::Treaty::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  
6 11 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 11 with 'BalanceOfPower::Relations::Role::Relation';
9  
10 11 has type => (
11 is => 'ro',
12 );
13  
14 around 'print' => sub {
15 0 ▶ my $orig = shift;
Subroutine __ANON__: not called CC=1 SCAR=6.9
16 0 my $self = shift;
17 0 return $self->short_tag . ": " .
18 $self->$orig();
19 11 };
20  
21 sub short_tag
22 {
23 0 ▶ my $self = shift;
Subroutine short_tag: not called CC=4 SCAR=30.0
Pod undocumented
24 0 ▶ if($self->type eq 'alliance')
Branch: 3 branches
BranchTrueFalseTotal
if ($self->type eq 'alliance') { } 0 0 0
elsif ($self->type eq 'no aggression') { } 0 0 0
elsif ($self->type eq 'commercial') { } 0 0 0
25 {
26 0 return 'ALL';
27 }
28 elsif($self->type eq 'no aggression')
29 {
30 0 return 'NAG';
31 }
32 elsif($self->type eq 'commercial')
33 {
34 0 return 'COM';
35 }
36 else
37 {
38 0 return '???';
39 }
40  
41 }
42 sub dump
43 {
44 0 ▶ my $self = shift;
Subroutine dump: not called CC=2 SCAR=17.9
Pod undocumented
45 0 my $io = shift;
46 0 ▶ my $indent = shift || "";
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
47 0 print {$io} $indent . join(";", $self->node1, $self->node2, $self->type) . "\n";
48 }
49 sub load
50 {
51 0 ▶ my $self = shift;
Subroutine load: not called CC=1 SCAR=6.9
Pod undocumented
52 0 my $data = shift;
53 0 $data =~ s/^\s+//;
54 0 chomp $data;
55 0 my ($node1, $node2, $type) = split ";", $data;
56 0 return $self->new(node1 => $node1, node2 => $node2, type => $type);
57 }
58  
59 11 1;
« blib/lib/BalanceOfPower/Role/Historian.pm ↑ Summary blib/lib/BalanceOfPower/Commands/RebelMilitarySupport.pm »