blib/lib/Game/Fanorona/Move.pm

filter: Statementstmt 97.1% 34 / 35 Branchbran 75.0% 3 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 90.0% 9 / 10 Podpod 100% 5 / 5 totaltotal 94.9% 56 / 59 CC 4 SCAR 4.9
CC
4
Cov
95%
is_paika
3.0
to
2.0
__ANON__
1.1
CRAP 1.6
« blib/arch/Game/Fanorona/Install/Files.pm ↑ Summary Fanorona.xs »
1 package Game::Fanorona::Move;
2  
3 43 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 43 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 43 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 43 ▶use Object::Proto::Sugar;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 43 our $VERSION = '0.02';
10  
11 43 has from => (is => 'ro');
12  
13 0 ▶has steps => (is => 'ro', default => sub { [] });
Subroutine __ANON__: not called CC=1 SCAR=1.2
14  
15 1946 ▶sub to {
Subroutine to: called CC=2 SCAR=7.1
Pod documented
16 1946 my ($self) = @_;
17 1946 my $steps = $self->steps;
18 1946 ▶ return @$steps ? $steps->[-1]{to} : undef;
Branch: 1 branch
BranchTrueFalseTotal
@$steps ? : 1946 0 1946
19 }
20  
21 15354 ▶sub length {
Subroutine length: called CC=1 SCAR=0.0
Pod documented
22 15354 my ($self) = @_;
23 15354 return scalar @{ $self->steps };
24 }
25  
26 3926 ▶sub taken {
Subroutine taken: called CC=1 SCAR=0.0
Pod documented
27 3926 my ($self) = @_;
28 3926 return map { @{ $_->{taken} } } @{ $self->steps };
29 }
30  
31 10 ▶sub is_paika {
Subroutine is_paika: called CC=3 SCAR=11.0
Pod documented
32 10 my ($self) = @_;
33 10 my $steps = $self->steps;
34 10 ▶ return @$steps == 1 && !@{ $steps->[0]{taken} } ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
@$steps == 1 && !@{$steps->[0]{'taken'};} ? : 8 2 10
Condition100%3/3
@$steps == 1 and not @{$steps->[0]{"taken"};}
!ll&&!rl&&r
118
MC/DC100%2/2
@$steps == 1 and not @{$steps->[0]{"taken"};}
@$steps == 1 not @{$steps->[0]{"taken"};}
Truth table100%3/3
A and not(B)
A= @$steps == 1B= not @{$steps->[0]{"taken"};}
ABresult
0X0
100
111
35 }
36  
37 1 ▶sub points {
Subroutine points: called CC=1 SCAR=0.0
Pod documented
38 1 my ($self) = @_;
39 1 return ($self->from, map { $_->{to} } @{ $self->steps });
40 }
41  
42 43 1;
43  
44 __END__
« blib/arch/Game/Fanorona/Install/Files.pm ↑ Summary Fanorona.xs »