Component/Result.pm

filter: Statementstmt 87.5% 28 / 32 Branchbran 75.0% 3 / 4 Conditioncond 45.4% 5 / 11 MC/DCmcdc 33.3% 2 / 6 Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 76.9% 50 / 65 CC 8 SCAR 18.6
CC
8
Cov
77%
new
11.9
BEGIN
1.0
BEGIN
1.0
CRAP 6.4
« Component/Base.pm ↑ Summary Component/Table.pm »
1 package Games::Sudoku::Component::Result;
2 {
3 2 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶ use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 2 our $VERSION = '0.01';
8
9 use overload
10 2 ▶ '0+' => \&result,
Subroutine BEGIN: called CC=1 SCAR=0.0
11 '""' => \&result,
12 3 ▶ '<=>' => sub { $_[0]->result <=> $_[1] },
Subroutine __ANON__: called CC=1 SCAR=0.0
13 2 ▶ 'cmp' => sub { $_[0]->result cmp $_[1] };
Subroutine __ANON__: called CC=1 SCAR=0.0
14
15 3 ▶ sub new {
Subroutine new: called CC=8 SCAR=24.7
Pod documented
16 3 my $class = shift;
17 3 ▶ my $this = bless {}, (ref $class || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
18
19 3 ▶ if (@_ == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == 1) { } 1 2 3
20 1 ▶ if (ref $_[0] eq 'HASH') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $_[0] eq 'HASH') { } 0 1 1
21 0 my %options = %{ $_[0] };
22 0 ▶ $this->{result} = $options{result} || 0;
Condition0%0/2
$options{'result'} || 0
l!l
00
MC/DC0%0/1
$options{'result'} || 0
$options{'result'}
Truth table0%0/2
A
A= $options{'result'}
Aresult
11
00
23 0 ▶ $this->{reason} = $options{reason} || '';
Condition0%0/2
$options{'reason'} || ''
l!l
00
MC/DC0%0/1
$options{'reason'} || ''
$options{'reason'}
Truth table0%0/2
A
A= $options{'reason'}
Aresult
11
00
24 }
25 else {
26 1 $this->{result} = $_[0];
27 }
28 }
29 else {
30 2 my %options = @_;
31 2 ▶ $this->{result} = $options{result} || 0;
Condition100%2/2
$options{'result'} || 0
l!l
11
MC/DC100%1/1
$options{'result'} || 0
$options{'result'}
Truth table100%2/2
A
A= $options{'result'}
Aresult
11
00
32 2 ▶ $this->{reason} = $options{reason} || '';
Condition100%2/2
$options{'reason'} || ''
l!l
11
MC/DC100%1/1
$options{'reason'} || ''
$options{'reason'}
Truth table100%2/2
A
A= $options{'reason'}
Aresult
11
00
33 }
34
35 3 $this;
36 }
37
38 11 ▶ sub result { $_[0]->{result} }
Subroutine result: called CC=1 SCAR=0.0
Pod documented
39 2 ▶ sub reason { $_[0]->{reason} }
Subroutine reason: called CC=1 SCAR=0.0
Pod documented
40 }
41
42 2 1;
43 __END__
« Component/Base.pm ↑ Summary Component/Table.pm »