Workflow/Transition/Deterministic.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 2 / 2 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 84.6% 22 / 26 CC 4 SCAR 11.2
CC
4
Cov
90%
apply
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 3.1
« Workflow/YAML.pm ↑ Summary Workflow/State/TransitionSet.pm »
1 #!/usr/bin/perl
2  
3 package Class::Workflow::Transition::Deterministic;
4 5 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 has to_state => (
9 does => "Class::Workflow::State",
10 is => "rw",
11 required => 0,
12 );
13  
14 # FIXME augment + inner
15 5 requires "apply_body";
16  
17 10 ▶sub apply {
Subroutine apply: called CC=4 SCAR=14.1
Pod documented
18 10 my ( $self, $instance, @args ) = @_;
19  
20 10 my ( $set_instance_attrs, @rv ) = $self->apply_body( $instance, @args );
21 10 ▶ $set_instance_attrs ||= {}; # should really die if it's bad
Condition50%1/2
$set_instance_attrs ||= {}
l!l
100
MC/DC0%0/1
$set_instance_attrs ||= {}
$set_instance_attrs
Truth table50%1/2
A
A= $set_instance_attrs
Aresult
11
00
22  
23 10 ▶ my $new_instance = $self->derive_and_accept_instance(
Condition50%1/2
$self->to_state || croak("$self has no 'to_state'")
l!l
100
MC/DC0%0/1
$self->to_state || croak("$self has no 'to_state'")
$self->to_state
Truth table50%1/2
A
A= $self->to_state
Aresult
11
00
24 $instance => {
25 state => ( $self->to_state || croak "$self has no 'to_state'" ),
26 %$set_instance_attrs,
27 },
28 @args,
29 );
30  
31 10 ▶ return wantarray ? ($new_instance, @rv) : $new_instance;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 6 4 10
32 }
33  
34 5 __PACKAGE__;
35  
36 __END__
« Workflow/YAML.pm ↑ Summary Workflow/State/TransitionSet.pm »