Tak/Result.pm

filter: Statementstmt 33.3% 6 / 18 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 16.6% 1 / 6 Podpod 0.0% 0 / 5 totaltotal 21.2% 7 / 33 SCAR 18.7
CC
3
Cov
27%
get
12.0
flatten
2.0
is_success
2.0
CRAP 6.5
« Tak/Router.pm ↑ Summary Tak/ConnectionReceiver.pm »
1 package Tak::Result;
2  
3 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 has type => (is => 'ro', required => 1);
6 1 has data => (is => 'ro', required => 1);
7  
8 0 ▶sub flatten { $_[0]->type, @{$_[0]->data} }
Subroutine flatten: not called CC=1 SCAR=6.9
Pod undocumented
9  
10 0 ▶sub is_success { $_[0]->type eq 'success' }
Subroutine is_success: not called CC=1 SCAR=6.9
Pod undocumented
11  
12 sub get {
13 0 ▶ my ($self) = @_;
Subroutine get: not called CC=3 SCAR=24.8
Pod undocumented
14 0 ▶ $self->throw unless $self->is_success;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_success 0 0 0
15 0 ▶ return wantarray ? @{$self->data} : $self->data->[0];
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
16 }
17  
18 sub throw {
19 0 ▶ my ($self) = @_;
Subroutine throw: not called CC=1 SCAR=6.9
Pod undocumented
20 0 die $self->exception;
21 }
22  
23 sub exception {
24 0 ▶ my ($self) = @_;
Subroutine exception: not called CC=1 SCAR=6.9
Pod undocumented
25 0 $self->type.': '.join ' ', @{$self->data};
26 }
27  
28 1 1;
« Tak/Router.pm ↑ Summary Tak/ConnectionReceiver.pm »