Scorecard/Frame/TenPinTenth.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 6 / 6 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 6 / 6 Podpod 100% 3 / 3 totaltotal 100% 47 / 47 SCAR 17.9
CC
6
Cov
100%
is_done
4.0
roll_ok
3.0
BEGIN
1.0
CRAP 6.0
« Scorecard.pm ↑ Summary
1 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Games::Bowling::Scorecard::Frame::TenPinTenth;
5 {
6 4 $Games::Bowling::Scorecard::Frame::TenPinTenth::VERSION = '0.105';
7 }
8 4 ▶use parent qw(Games::Bowling::Scorecard::Frame);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 # ABSTRACT: ten pin's weird 10th frame
10  
11  
12 sub is_done {
13 151 ▶ my ($self) = @_;
Subroutine is_done: called CC=4 SCAR=13.9
Pod documented
14  
15 151 my @balls = $self->balls;
16  
17 151 ▶ return 1 if @balls == 3 or @balls == 2 and $balls[0] + $balls[1] < 10;
Branch: 1 branch
BranchTrueFalseTotal
if @balls == 3 or @balls == 2 and $balls[0] + $balls[1] < 10 25 126 151
Condition100%6/6
@balls == 3 or @balls == 2 and $balls[0] + $balls[1] < 10
l!l&&r!l&&!r
1632103
@balls == 2 and $balls[0] + $balls[1] < 10
!ll&&!rl&&r
86409
MC/DC100%3/3
@balls == 3 or @balls == 2 and $balls[0] + $balls[1] < 10
@balls == 3 @balls == 2 $balls[0] + $balls[1] < 10
Truth table100%4/4
A or B and C
A= @balls == 3B= @balls == 2C= $balls[0] + $balls[1] < 10
ABCresult
1XX1
0111
00X0
0100
18 126 return;
19 }
20  
21  
22 sub is_pending {
23 29 ▶ return 0;
Subroutine is_pending: called CC=1 SCAR=0.0
Pod documented
24 }
25  
26  
27 sub roll_ok {
28 30 ▶ my ($self, $ball) = @_;
Subroutine roll_ok: called CC=3 SCAR=11.0
Pod documented
29  
30 30 eval { $self->SUPER::roll_ok($ball) };
31  
32 30 ▶ if (my $error = $@) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $error = $@) 12 18 30
33 12 ▶ return if $error =~ /would bring the frame above 10/;
Branch: 1 branch
BranchTrueFalseTotal
if $error =~ /would bring the frame above 10/ 11 1 12
34 1 die $error;
35 }
36 }
37  
38 4 300;
39  
40 __END__
« Scorecard.pm ↑ Summary