| 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::Monitor; | ||||||||||||||||||||||
| 6 | 1 | ▶ | BEGIN { | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 7 | 1 | $Data::Conveyor::Monitor::VERSION = '1.103130'; | |||||||||||||||||||||
| 8 | } | ||||||||||||||||||||||
| 9 | |||||||||||||||||||||||
| 10 | # ABSTRACT: Stage-based conveyor-belt-like ticket handling system | ||||||||||||||||||||||
| 11 | 1 | ▶ | use parent 'Class::Scaffold::Storable'; | ||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||
| 12 | |||||||||||||||||||||||
| 13 | 0 | ▶ | sub sort_by_stage_order { | ||||||||||||||||||||
|
Subroutine
sort_by_stage_order: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||
| 14 | 0 | my ($self, @activity) = @_; | |||||||||||||||||||||
| 15 | 0 | my %stage_order; | |||||||||||||||||||||
| 16 | 0 | my $order = 1; | |||||||||||||||||||||
| 17 | $stage_order{$_} = sprintf "%02d" => $order++ | ||||||||||||||||||||||
| 18 | 0 | for map { "$_" } | |||||||||||||||||||||
| 19 | map { | ||||||||||||||||||||||
| 20 | 0 | $self->delegate->make_obj('value_ticket_stage')->new_start($_), | |||||||||||||||||||||
| 21 | $self->delegate->make_obj('value_ticket_stage')->new_active($_), | ||||||||||||||||||||||
| 22 | $self->delegate->make_obj('value_ticket_stage')->new_end($_), | ||||||||||||||||||||||
| 23 | } $self->delegate->STAGE_ORDER; | ||||||||||||||||||||||
| 24 | my @sorted = | ||||||||||||||||||||||
| 25 | 0 | map { $_->[0] } | |||||||||||||||||||||
| 26 | 0 | sort { $a->[1] cmp $b->[1] } | |||||||||||||||||||||
| 27 | map { | ||||||||||||||||||||||
| 28 | 0 | ▶ | [ $_, ($stage_order{ $_->{stage} } || '00') . ($_->{status} || ' ') ] | ||||||||||||||||||||
|
Condition0%0/4
$stage_order{$_->{'stage'}} || '00'
$_->{'status'} || ' '
MC/DC0%0/1
$stage_order{$_->{'stage'}} || '00'
$stage_order{$_->{'stage'}}
MC/DC0%0/1
$_->{'status'} || ' '
$_->{'status'}
Truth table0%0/2
A
A= $stage_order{$_->{'stage'}}
Truth table0%0/2
A
A= $_->{'status'}
| |||||||||||||||||||||||
| 29 | } @activity; | ||||||||||||||||||||||
| 30 | 0 | ▶ | wantarray ? @sorted : \@sorted; | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||
| 32 | |||||||||||||||||||||||
| 33 | 0 | ▶ | sub sif_top { | ||||||||||||||||||||
|
Subroutine
sif_top: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||
| 34 | 0 | my ($self, %opt) = @_; | |||||||||||||||||||||
| 35 | 0 | my $result = $self->delegate->make_obj('service_result_container'); | |||||||||||||||||||||
| 36 | my @activity = | ||||||||||||||||||||||
| 37 | $opt{all} | ||||||||||||||||||||||
| 38 | 0 | ▶ | ? $self->get_activity | ||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||
| 39 | : $self->get_activity_running; | ||||||||||||||||||||||
| 40 | 0 | $result->result_push( | |||||||||||||||||||||
| 41 | $self->delegate->make_obj('service_result_tabular')->set_from_rows( | ||||||||||||||||||||||
| 42 | fields => [qw/count stage status rc oticket ochanged/], | ||||||||||||||||||||||
| 43 | rows => [ $self->sort_by_stage_order(@activity) ], | ||||||||||||||||||||||
| 44 | ) | ||||||||||||||||||||||
| 45 | ); | ||||||||||||||||||||||
| 46 | 0 | $result->result_push( | |||||||||||||||||||||
| 47 | $self->delegate->make_obj( | ||||||||||||||||||||||
| 48 | 'service_result_scalar', | ||||||||||||||||||||||
| 49 | result => | ||||||||||||||||||||||
| 50 | sprintf("%d open regtransfers\n", $self->count_open_regtransfers) | ||||||||||||||||||||||
| 51 | ) | ||||||||||||||||||||||
| 52 | ); | ||||||||||||||||||||||
| 53 | 0 | $result; | |||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||
| 55 | |||||||||||||||||||||||
| 56 | 0 | ▶ | sub get_activity { | ||||||||||||||||||||
|
Subroutine
get_activity: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||
| 57 | 0 | my $self = shift; | |||||||||||||||||||||
| 58 | 0 | $self->storage->get_activity; | |||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||
| 60 | |||||||||||||||||||||||
| 61 | 0 | ▶ | sub get_activity_running { | ||||||||||||||||||||
|
Subroutine
get_activity_running: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||
| 62 | 0 | my $self = shift; | |||||||||||||||||||||
| 63 | 0 | $self->storage->get_activity_running; | |||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||
| 65 | |||||||||||||||||||||||
| 66 | 0 | ▶ | sub count_open_regtransfers { | ||||||||||||||||||||
|
Subroutine
count_open_regtransfers: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||
| 67 | 0 | my $self = shift; | |||||||||||||||||||||
| 68 | 0 | $self->storage->count_open_regtransfers; | |||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||
| 70 | 1 | 1; | |||||||||||||||||||||
| 71 | |||||||||||||||||||||||
| 72 | |||||||||||||||||||||||
| 73 | __END__ | ||||||||||||||||||||||