lib/VANAMBURG/OrderedSuit.pm

filter: Statementstmt 100% 12 / 12 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 4 / 6 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 81.4% 22 / 27 CC 5 SCAR 15.0
CC
5
Cov
86%
__ANON__
5.2
BEGIN
1.0
CRAP 4.5
« lib/VANAMBURG/Packet.pm ↑ Summary lib/VANAMBURG/FaceValue.pm »
1 package VANAMBURG::OrderedSuit;
2 5 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 extends 'VANAMBURG::Suit';
4 =head1 VANAMBURG::OrderedSuit
5  
6 An extension of VANAMBURG::Suit that adds a value attribute
7 indicating the order of the suit.
8  
9 =cut
10  
11 =head2 value
12  
13 The value indicating the order of the suit, useful for such
14 stacks as CHaSeD or SHoCkeD.
15  
16 =cut
17  
18 5 has 'value' => ( is => 'ro', isa => 'Int', required => 1 );
19  
20 =head2 equals
21  
22 Returns true (1) if the name, abbreviation and value of this object
23 is the same as that passed as a parameter.
24  
25 =cut
26  
27 6 ▶override 'equals' => sub {
Subroutine __ANON__: called CC=5 SCAR=16.5
28 6 my ( $self, $other ) = @_;
29 6 ▶ return 0 if ( !defined $other );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $other 0 6 6
30 6 ▶ if ( $self->name eq $other->name
Branch: 1 branch
BranchTrueFalseTotal
if ($self->name eq $other->name and $self->abbreviation eq $other->abbreviation and $self->value == $other->value) { } 5 1 6
Condition66%4/6
$self->name eq $other->name and $self->abbreviation eq $other->abbreviation and $self->value == $other->value
!ll&&!rl&&r
105
$self->name eq $other->name and $self->abbreviation eq $other->abbreviation
!ll&&!rl&&r
105
MC/DC33%1/3
$self->name eq $other->name and $self->abbreviation eq $other->abbreviation and $self->value == $other->value
$self->name eq $other->name $self->abbreviation eq $other->abbreviation $self->value == $other->value
Truth table50%2/4
A and B and C
A= $self->name eq $other->nameB= $self->abbreviation eq $other->abbreviationC= $self->value == $other->value
ABCresult
0XX0
10X0
1100
1111
31 && $self->abbreviation eq $other->abbreviation
32 && $self->value == $other->value )
33 {
34 5 return 1;
35 }
36 else {
37 1 return 0;
38 }
39 5 };
40  
41 5 1;
« lib/VANAMBURG/Packet.pm ↑ Summary lib/VANAMBURG/FaceValue.pm »