Games/AssaultCube/Log/Line/Base/TeamInfo.pm

filter: Statementstmt 85.7% 18 / 21 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 71.4% 25 / 35 CC 3 SCAR 7.8
CC
3
Cov
77%
BUILD
3.8
__ANON__
2.0
BEGIN
1.0
CRAP 2.2
« Games/AssaultCube/Log/Line/Base/RoleInfo.pm ↑ Summary Games/AssaultCube/Log/Line/DemoStart.pm »
1 # The "teaminfo" role
2 package Games::AssaultCube::Log::Line::Base::TeamInfo;
3 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # Initialize our version
6 2 ▶use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 $VERSION = '0.04';
8  
9 2 ▶use Games::AssaultCube::Utils qw( get_team_from_name get_team_name );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 has 'team' => (
12 isa => 'Int',
13 is => 'ro',
14 lazy => 1,
15 9 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
16 9 my $self = shift;
17 9 return get_team_from_name( $self->team_name );
18 },
19 2 );
20  
21 has 'team_name' => (
22 isa => 'Str',
23 is => 'ro',
24 lazy => 1,
25 0 ▶ default => sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 0 my $self = shift;
27 0 return get_team_name( $self->team );
28 },
29 2 );
30  
31 4 ▶sub BUILD {
Subroutine BUILD: called CC=3 SCAR=13.3
Pod undocumented
32 4 my $self = shift;
33 4 ▶ if ( ! exists $self->{'team'} and ! exists $self->{'team_name'} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->{"team"} or exists $self->{"team_name"}) 0 4 4
Condition33%1/3
exists $self->{"team"} or exists $self->{"team_name"}
l!l&&r!l&&!r
040
MC/DC0%0/2
exists $self->{"team"} or exists $self->{"team_name"}
exists $self->{"team"} exists $self->{"team_name"}
Truth table33%1/3
A or B
A= exists $self->{"team"}B= exists $self->{"team_name"}
ABresult
1X1
011
000
34 0 die "Team information is missing";
35 }
36 4 return;
37 }
38  
39 2 1;
40 __END__
« Games/AssaultCube/Log/Line/Base/RoleInfo.pm ↑ Summary Games/AssaultCube/Log/Line/DemoStart.pm »