| 1 | package Beanstalk::Job; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use base qw(Class::Accessor::Fast); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 3 | our $VERSION = "1.07"; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 3 | __PACKAGE__->mk_accessors( | |||||||||||||||||||||||||||
| 11 | qw(id client buried reserved data error) | ||||||||||||||||||||||||||||
| 12 | ); | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | ▶ | sub stats { | ||||||||||||||||||||||||||
|
Subroutine
stats: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | $self->{_stats} = $self->client->stats_job($self->id) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | or $self->error($self->client->error); | ||||||||||||||||||||||||||||
| 18 | 0 | $self->{_stats}; | |||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | sub delete { | ||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 0 | ▶ | my $ret = $self->client->delete($self->id) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | or $self->error($self->client->error); | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | $self->reserved(0); | |||||||||||||||||||||||||||
| 28 | 0 | $self->buried(0); | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | $ret; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub touch { | ||||||||||||||||||||||||||
|
Subroutine
touch: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 34 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | my $ret = $self->client->touch($self->id) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | or $self->error($self->client->error); | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | $ret; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub peek { | ||||||||||||||||||||||||||
|
Subroutine
peek: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 0 | ▶ | my $ret = $self->client->peek($self->id) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | or $self->error($self->client->error); | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | $ret; | |||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | ▶ | sub release { | ||||||||||||||||||||||||||
|
Subroutine
release: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 52 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 53 | 0 | my $opt = shift; | |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | ▶ | my $ret = $self->client->release($self->id, $opt) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 56 | or $self->error($self->client->error); | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | $self->reserved(0); | |||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | 0 | $ret; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 0 | ▶ | sub bury { | ||||||||||||||||||||||||||
|
Subroutine
bury: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 64 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 65 | 0 | my $opt = shift; | |||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | 0 | ▶ | unless ($self->client->bury($self->id, $opt)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 68 | 0 | $self->error($self->client->error); | |||||||||||||||||||||||||||
| 69 | 0 | return undef; | |||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 0 | $self->reserved(0); | |||||||||||||||||||||||||||
| 73 | 0 | $self->buried(1); | |||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 0 | return 1; | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 0 | ▶ | sub args { | ||||||||||||||||||||||||||
|
Subroutine
args: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 79 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 80 | 0 | my $data = $self->data; | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 0 | ▶ | return unless defined($data); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 83 | 0 | $self->client->decoder->($data); | |||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | 0 | ▶ | sub tube { | ||||||||||||||||||||||||||
|
Subroutine
tube: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 87 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | 0 | ▶ | my $stats = $self->{_stats} || $self->stats | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{'_stats'} || $self->stats
MC/DC0%0/2
$self->{'_stats'} || $self->stats
$self->{'_stats'}
$self->stats
Truth table0%0/3
A || B
A= $self->{'_stats'}B= $self->stats
| |||||||||||||||||||||||||||||
| 90 | or return undef; | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 0 | $stats->tube; | |||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | 0 | ▶ | sub ttr { | ||||||||||||||||||||||||||
|
Subroutine
ttr: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 96 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | 0 | ▶ | my $stats = $self->{_stats} || $self->stats | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{'_stats'} || $self->stats
MC/DC0%0/2
$self->{'_stats'} || $self->stats
$self->{'_stats'}
$self->stats
Truth table0%0/3
A || B
A= $self->{'_stats'}B= $self->stats
| |||||||||||||||||||||||||||||
| 99 | or return undef; | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | 0 | $stats->ttr; | |||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 0 | ▶ | sub priority { | ||||||||||||||||||||||||||
|
Subroutine
priority: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 105 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | 0 | ▶ | my $stats = $self->{_stats} || $self->stats | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{'_stats'} || $self->stats
MC/DC0%0/2
$self->{'_stats'} || $self->stats
$self->{'_stats'}
$self->stats
Truth table0%0/3
A || B
A= $self->{'_stats'}B= $self->stats
| |||||||||||||||||||||||||||||
| 108 | or return undef; | ||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | 0 | $stats->pri; | |||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | 3 | 1; | |||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | __END__ | ||||||||||||||||||||||||||||