Conveyor/Ticket/Payload/Item.pm

filter: Statementstmt 48.2% 14 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 41.6% 5 / 12 Podpod 100% 7 / 7 totaltotal 52.0% 26 / 50 CC 2 SCAR 7.7
CC
2
Cov
45%
data
6.0
check
2.0
rc
2.0
CRAP 2.2
« Conveyor/Service/Result/Container.pm ↑ Summary Conveyor/Ticket/Payload/Instruction/Factory.pm »
1 5 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Data::Conveyor::Ticket::Payload::Item;
6 5 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 $Data::Conveyor::Ticket::Payload::Item::VERSION = '1.103130';
8 }
9 # ABSTRACT: Stage-based conveyor-belt-like ticket handling system
10  
11 #
12 # Base class for Data::Conveyor::Ticket::Payload::* items
13 5 ▶use parent 'Class::Scaffold::Storable';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 5 __PACKAGE__->mk_abstract_accessors(qw(DATA_PROPERTY))
15 ->mk_framework_object_accessors(exception_container => 'exception_container')
16 ->mk_boolean_accessors(qw(implicit));
17  
18 # implicit(): was this item created implicitly by txsel?
19 0 ▶sub check {
Subroutine check: not called CC=1 SCAR=6.9
Pod documented
20 0 my ($self, $ticket) = @_;
21 0 $self->data->check($self->exception_container, $ticket);
22 }
23  
24 0 ▶sub data {
Subroutine data: not called CC=2 SCAR=17.9
Pod documented
25 0 my $property = $_[0]->DATA_PROPERTY;
26 0 ▶ return $_[0]->$property if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 0 0 0
27 0 $_[0]->$property($_[1]);
28 }
29  
30 # For rc() and status(), we pass the payload item's owning ticket object to
31 # the exception container. The container needs to ask the ticket whether to
32 # ignore an exception. Why do the payload object and the payload items have an
33 # owning ticket, but the exception container does not? Because exception
34 # containers are filled from various places, and are passed around. In
35 # contrast, payload containers and payload items are always tied to a ticket.
36 #
37 # We also pass the payload item itself because it will eventually be passed to
38 # the exception handler, which uses it to decide the rc and status of each
39 # exception it is ask to handle. That is, the rc and exception aren't
40 # determined by the exception type alone. The same exception can have
41 # different rc and status values depending on which object type and command it
42 # is associated with.
43 0 ▶sub rc {
Subroutine rc: not called CC=1 SCAR=6.9
Pod documented
44 0 my ($self, $ticket) = @_;
45 0 $self->exception_container->rc($ticket, $self);
46 }
47  
48 0 ▶sub status {
Subroutine status: not called CC=1 SCAR=6.9
Pod documented
49 0 my ($self, $ticket) = @_;
50 0 $self->exception_container->status($ticket, $self);
51 }
52  
53 0 ▶sub has_problematic_exceptions {
Subroutine has_problematic_exceptions: not called CC=1 SCAR=6.9
Pod documented
54 0 my ($self, $ticket) = @_;
55 0 $self->exception_container->has_problematic_exceptions($ticket, $self);
56 }
57  
58 0 ▶sub prepare_comparable {
Subroutine prepare_comparable: not called CC=1 SCAR=6.9
Pod documented
59 0 my $self = shift;
60 0 $self->SUPER::prepare_comparable(@_);
61  
62 # Touch various accessors that will autovivify hash keys so we can be sure
63 # they exist, which is a kind of normalization for the purpose of
64 # comparing two objects of this class.
65 0 $self->exception_container;
66 0 $self->implicit;
67 }
68  
69 # do nothing here; business objects will override
70 0 ▶sub apply_instruction_container { }
Subroutine apply_instruction_container: not called CC=1 SCAR=0.0
Pod documented
71 5 1;
72  
73  
74 __END__
« Conveyor/Service/Result/Container.pm ↑ Summary Conveyor/Ticket/Payload/Instruction/Factory.pm »