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

filter: Statementstmt 80.9% 17 / 21 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 62.8% 22 / 35 CC 3 SCAR 16.3
CC
3
Cov
65%
BUILD
12.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.1
« Games/AssaultCube/Log/Line/Killed.pm ↑ Summary Games/AssaultCube/ServerQuery/Response.pm »
1 # the mastermode role
2 package Games::AssaultCube::Log::Line::Base::MasterMode;
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_mastermode_from_name get_mastermode_name );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 has 'mastermode' => (
12 isa => 'Int',
13 is => 'ro',
14 lazy => 1,
15 2 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
16 2 my $self = shift;
17 2 return get_mastermode_from_name( $self->mastermode_name );
18 },
19 2 );
20  
21 has 'mastermode_name' => (
22 isa => 'Str',
23 is => 'ro',
24 lazy => 1,
25 1 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
26 1 my $self = shift;
27 1 return get_mastermode_name( $self->mastermode );
28 },
29 2 );
30  
31 0 ▶sub BUILD {
Subroutine BUILD: not called CC=3 SCAR=24.8
Pod undocumented
32 0 my $self = shift;
33  
34 # check role
35 0 ▶ if ( ! exists $self->{'mastermode'} and ! exists $self->{'mastermode_name'} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->{"mastermode"} or exists $self->{"mastermode_name"}) 0 0 0
Condition0%0/3
exists $self->{"mastermode"} or exists $self->{"mastermode_name"}
l!l&&r!l&&!r
000
MC/DC0%0/2
exists $self->{"mastermode"} or exists $self->{"mastermode_name"}
exists $self->{"mastermode"} exists $self->{"mastermode_name"}
Truth table0%0/3
A or B
A= exists $self->{"mastermode"}B= exists $self->{"mastermode_name"}
ABresult
1X1
011
000
36 0 die "Mastermode information is missing";
37 }
38 0 return;
39 }
40  
41 2 1;
42 __END__
« Games/AssaultCube/Log/Line/Killed.pm ↑ Summary Games/AssaultCube/ServerQuery/Response.pm »