blib/lib/Games/ABC_Path/Solver/Coord.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 4 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 2 / 2 totaltotal 100% 50 / 50 CC 4 SCAR 4.1
CC
4
Cov
100%
x
2.0
y
2.0
_equal
2.0
CRAP 1.5
« blib/lib/Games/ABC_Path/Solver/Move.pm ↑ Summary blib/lib/Games/ABC_Path/Solver/Base.pm »
1 package Games::ABC_Path::Solver::Coord;
2 8 $Games::ABC_Path::Solver::Coord::VERSION = '0.6.1';
3 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 8 ▶use parent 'Games::ABC_Path::Solver::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 8 ▶use integer;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11  
12 sub x
13 {
14 108459 ▶ my $self = shift;
Subroutine x: called CC=2 SCAR=6.9
Pod documented
15  
16 108459 ▶ if (@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 33781 74678 108459
17 {
18 33781 $self->{x} = shift;
19 }
20  
21 108459 return $self->{x};
22 }
23  
24  
25  
26 sub y
27 {
28 105339 ▶ my $self = shift;
Subroutine y: called CC=2 SCAR=6.9
Pod documented
29  
30 105339 ▶ if (@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 33781 71558 105339
31 {
32 33781 $self->{'y'} = shift;
33 }
34  
35 105339 return $self->{'y'};
36 }
37  
38 sub _to_s
39 {
40 1980 ▶ my $self = shift;
Subroutine _to_s: called CC=1 SCAR=0.0
41  
42 1980 return sprintf("%d,%d", $self->x, $self->y);
43 }
44  
45 sub _init
46 {
47 33781 ▶ my ($self,$args) = @_;
Subroutine _init: called CC=1 SCAR=0.0
48  
49 33781 $self->x($args->{x});
50 33781 $self->y($args->{'y'});
51  
52 33781 return;
53 }
54  
55 sub _equal
56 {
57 1950 ▶ my ($self,$other_xy) = @_;
Subroutine _equal: called CC=2 SCAR=6.9
58  
59 1950 ▶ return (($self->x == $other_xy->x) && ($self->y == $other_xy->y));
Condition100%3/3
$self->x == $other_xy->x && $self->y == $other_xy->y
!ll&&!rl&&r
156031278
MC/DC100%2/2
$self->x == $other_xy->x && $self->y == $other_xy->y
$self->x == $other_xy->x $self->y == $other_xy->y
Truth table100%3/3
A && B
A= $self->x == $other_xy->xB= $self->y == $other_xy->y
ABresult
0X0
100
111
60 }
61  
62  
63 8 1; # End of Games::ABC_Path::Solver::Base
64  
65 __END__
« blib/lib/Games/ABC_Path/Solver/Move.pm ↑ Summary blib/lib/Games/ABC_Path/Solver/Base.pm »