Conveyor/Ticket/Processor/Conveyor.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 100% 1 / 1 totaltotal 52.1% 24 / 46 CC 5 SCAR 26.5
CC
5
Cov
47%
run
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 14.2
« Conveyor/YAML/Marshall/Payload/Transaction.pm ↑ Summary Conveyor/Test/Stage.pm »
1 1 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Data::Conveyor::Ticket::Processor::Conveyor;
6 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $Data::Conveyor::Ticket::Processor::Conveyor::VERSION = '1.103130';
8 }
9 # ABSTRACT: Stage-based conveyor-belt-like ticket handling system
10  
11 1 ▶use parent 'Class::Scaffold::Storable';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 __PACKAGE__->mk_framework_object_accessors(ticket => 'ticket')
13 ->mk_scalar_accessors(qw(poll_delegate))
14 ->mk_boolean_accessors(qw(transactional_authority));
15  
16 # the poll delegate allows the upper service layer to interrupt processing
17 # by throwing an exception, if it thinks it is necessary.
18 1 ▶use constant DEFAULTS => (transactional_authority => 1);
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 0 ▶sub run {
Subroutine run: not called CC=5 SCAR=34.0
Pod documented
21 0 my $self = shift;
22 0 my $previous_stage = '';
23 0 ▶ while ($self->ticket->stage ne $previous_stage) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->ticket->stage ne $previous_stage) 0 0 0
24 0 ▶ last if $self->ticket->stage eq $self->delegate->FINAL_TICKET_STAGE;
Branch: 1 branch
BranchTrueFalseTotal
if $self->ticket->stage eq $self->delegate->FINAL_TICKET_STAGE 0 0 0
25 0 $previous_stage = $self->ticket->stage;
26 0 ▶ if ( $self->poll_delegate
Branch: 1 branch
BranchTrueFalseTotal
if ($self->poll_delegate and $self->poll_delegate->can("callback")) 0 0 0
Condition0%0/3
$self->poll_delegate and $self->poll_delegate->can("callback")
!ll&&!rl&&r
000
MC/DC0%0/2
$self->poll_delegate and $self->poll_delegate->can("callback")
$self->poll_delegate $self->poll_delegate->can("callback")
Truth table0%0/3
A and B
A= $self->poll_delegateB= $self->poll_delegate->can("callback")
ABresult
0X0
100
111
27 && $self->poll_delegate->can('callback')) {
28 0 $self->poll_delegate->callback($self->ticket);
29 }
30  
31 # We need to set the ticket to active, because it won't have been
32 # open()ed - we just process a ticket from start to end, without
33 # repeatedly writing and re-reading it.
34 0 $self->ticket->stage->set_active;
35 0 $self->delegate->make_obj('ticket_dispatcher')
36 ->new(transactional_authority => $self->transactional_authority)
37 ->dispatch($self->ticket);
38 }
39 0 $self->ticket->store;
40 }
41 1 1;
42  
43  
44 __END__
« Conveyor/YAML/Marshall/Payload/Transaction.pm ↑ Summary Conveyor/Test/Stage.pm »