lib/Reaction/UI/ViewPort/Action/Role/Apply.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran 33.3% 2 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 100% 2 / 2 totaltotal 67.5% 27 / 40 CC 5 SCAR 16.7
CC
5
Cov
67%
apply
9.4
can_apply
2.0
BEGIN
1.0
CRAP 5.3
« lib/ComponentUI/TestModel/Foo/SearchSpec.pm ↑ Summary lib/Reaction/UI/WidgetClass.pm »
1 package Reaction::UI::ViewPort::Action::Role::Apply;
2  
3 4 ▶use Reaction::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use MooseX::Types::Moose qw/Str CodeRef/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 requires 'do_apply';
7 4 has apply_label => (is => 'rw', isa => Str, lazy_build => 1);
8 4 has on_apply_callback => (is => 'rw', isa => CodeRef);
9  
10 3 ▶sub _build_apply_label { 'apply' }
Subroutine _build_apply_label: called CC=1 SCAR=0.0
11  
12 0 ▶sub can_apply { 1 }
Subroutine can_apply: not called CC=1 SCAR=6.9
Pod documented
13  
14 2 ▶sub apply {
Subroutine apply: called CC=5 SCAR=22.5
Pod documented
15 2 my $self = shift;
16 2 ▶ if ($self->can_apply && (my $result = $self->do_apply)) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can_apply and my $result = $self->do_apply) { } 2 0 2
Condition33%1/3
$self->can_apply and my $result = $self->do_apply
!ll&&!rl&&r
002
MC/DC0%0/2
$self->can_apply and my $result = $self->do_apply
$self->can_apply my $result = $self->do_apply
Truth table33%1/3
A and B
A= $self->can_applyB= my $result = $self->do_apply
ABresult
0X0
100
111
17 2 ▶ $self->on_apply_callback->($self => $result) if $self->has_on_apply_callback;
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_on_apply_callback 0 2 2
18 2 return 1;
19 } else {
20 0 ▶ if( my $coderef = $self->can('close_label') ){
Branch: 1 branch
BranchTrueFalseTotal
if (my $coderef = $self->can("close_label")) 0 0 0
21 0 $self->$coderef( $self->close_label_cancel );
22 }
23 0 return 0;
24 }
25 };
26  
27 11 ▶around accept_events => sub { ( 'apply', shift->(@_) ) };
Subroutine __ANON__: called CC=1 SCAR=0.0
28  
29 4 1;
30  
31 __END__
« lib/ComponentUI/TestModel/Foo/SearchSpec.pm ↑ Summary lib/Reaction/UI/WidgetClass.pm »