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.2';
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 sub y
26 {
27 105339 ▶ my $self = shift;
Subroutine y: called CC=2 SCAR=6.9
Pod documented
28  
29 105339 ▶ if (@_)
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 33781 71558 105339
30 {
31 33781 $self->{'y'} = shift;
32 }
33  
34 105339 return $self->{'y'};
35 }
36  
37 sub _to_s
38 {
39 1980 ▶ my $self = shift;
Subroutine _to_s: called CC=1 SCAR=0.0
40  
41 1980 return sprintf( "%d,%d", $self->x, $self->y );
42 }
43  
44 sub _init
45 {
46 33781 ▶ my ( $self, $args ) = @_;
Subroutine _init: called CC=1 SCAR=0.0
47  
48 33781 $self->x( $args->{x} );
49 33781 $self->y( $args->{'y'} );
50  
51 33781 return;
52 }
53  
54 sub _equal
55 {
56 1950 ▶ my ( $self, $other_xy ) = @_;
Subroutine _equal: called CC=2 SCAR=6.9
57  
58 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
59 }
60  
61  
62 8 1; # End of Games::ABC_Path::Solver::Base
63  
64 __END__
« blib/lib/Games/ABC_Path/Solver/Move.pm ↑ Summary blib/lib/Games/ABC_Path/Solver/Base.pm »