Notify/ReachMaxRetry.pm

filter: Statementstmt 55.5% 10 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 3 totaltotal 37.1% 13 / 35 CC 3 SCAR 16.1
CC
3
Cov
43%
__ANON__
12.0
hook_point
2.0
load
2.0
CRAP 5.0
↑ Summary Notify/Abort.pm »
1 package Qudo::Hook::Notify::ReachMaxRetry;
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 1 ▶use base 'Qudo::Hook';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶sub hook_point { 'post_work' }
Subroutine hook_point: not called CC=1 SCAR=6.9
Pod undocumented
7  
8 0 ▶sub load {
Subroutine load: not called CC=1 SCAR=6.9
Pod undocumented
9 0 my ($class, $klass) = @_;
10  
11 0 ▶ $klass->hooks->{post_work}->{'notify_reach_max_retry'} = sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
12 0 my $job = shift;
13  
14 0 ▶ if ($job->is_failed && ( $job->funcname->max_retries <= ($job->retry_cnt) )) {
Branch: 1 branch
BranchTrueFalseTotal
if ($job->is_failed and $job->funcname->max_retries <= $job->retry_cnt) 0 0 0
Condition0%0/3
$job->is_failed and $job->funcname->max_retries <= $job->retry_cnt
!ll&&!rl&&r
000
MC/DC0%0/2
$job->is_failed and $job->funcname->max_retries <= $job->retry_cnt
$job->is_failed $job->funcname->max_retries <= $job->retry_cnt
Truth table0%0/3
A and B
A= $job->is_failedB= $job->funcname->max_retries <= $job->retry_cnt
ABresult
0X0
100
111
15 $klass->plugin->{logger}->emergency(
16 0 sprintf('%s already retry max!!',$job->funcname)
17 );
18 }
19 0 };
20 }
21  
22 0 ▶sub unload {
Subroutine unload: not called CC=1 SCAR=6.9
Pod undocumented
23 0 my ($class, $klass) = @_;
24  
25 0 delete $klass->hooks->{post_work}->{'notify_reach_max_retry'};
26 }
27  
28  
29 1 1;
30 __END__
↑ Summary Notify/Abort.pm »