Branch Coverage

blib/lib/cPanel/TaskQueue/Scheduler.pm
Criterion Covered Total %
branch 80 112 71.4


line true false branch
61 0 9 if @_ % 2
62 2 7 if $are_policies_set
63 3 4 unless @_
68 3 2 if ('-logger' eq $policy) { }
2 0 elsif ('-serializer' eq $policy) { }
85 0 2 if ref $module
86 0 2 unless $module =~ /^\w+(?:::\w+)*$/
88 0 2 if $@
89 0 2 unless _valid_serializer($module)
97 0 6 unless eval { do { $serializer->can($method) } }
103 6 29 unless (defined $the_serializer)
105 0 6 if $@
116 7 6 if &$pred()
144 0 29 if (defined $$args_ref{'serial'})
149 16 13 if (exists $$args_ref{'token'}) { }
153 8 6 unless defined $version and defined $name and defined $file
160 4 2 unless 'tqsched1' eq $version and $file =~ m[/\Q$name_match\E$]
167 0 13 if exists $$args_ref{'cache_dir'}
168 1 12 unless exists $$args_ref{'state_dir'}
169 1 11 unless exists $$args_ref{'name'}
176 0 13 exists $$args_ref{'cache_timeout'} ? :
0 13 exists $$args_ref{'state_timeout'} ? :
0 13 exists $$args_ref{'logger'} ? :
187 4 9 unless (eval { do { $$self{'disk_state'} = 'cPanel::StateFile'->new($state_args); 1 } })
191 0 4 unless $ex =~ /Not a recognized|Invalid version/
208 6 4 $$self{'disk_state'} ? :
214 1 0 $$self{'disk_state'} ? :
237 2 7 unless defined $magic and $magic eq $FILETYPE
238 2 5 unless defined $version and $version eq $CACHE_VERSION
242 2 3 if $$meta{'nextid'} > $$self{'next_id'}
263 1 26 unless defined $command
264 2 24 unless defined $args and 'HASH' eq ref $args
267 6 18 if exists $$args{'delay_seconds'}
268 17 7 if exists $$args{'at_time'}
270 1 23 if (eval { do { $command->isa('cPanel::TaskQueue::Task') } })
271 1 0 if (0 == $command->retries_remaining)
279 1 22 unless $command =~ /\S/
282 2 20 if (exists $$args{'attempts'})
283 1 1 unless $$args{'attempts'} > 0
301 0 18 unless (_is_valid_uuid($uuid))
319 0 5 unless (_is_valid_uuid($uuid))
332 0 3 unless (_is_valid_uuid($uuid))
340 0 3 unless defined $task
357 6 22 unless @{$$self{'time_queue'};}
367 1 3 unless @{$$self{'time_queue'};}
375 2 0 unless (defined $queue and eval { do { $queue->can('queue_task') } })
387 0 0 if time < $$item{'time'}
388 0 0 unless ($guard)
405 0 0 if $count and $guard
406 0 0 if $ex
438 17 4 if (not @{$$self{'time_queue'};} or $time >= $$self{'time_queue'}[-1]{'time'}) { }
3 1 elsif ($time < $$self{'time_queue'}[0]{'time'}) { }
450 2 1 unless $$self{'time_queue'}[$i]{'time'} > $time
462 0 1 unless 'HASH' eq ref $item
463 0 1 unless exists $$item{'task'} and exists $$item{'time'}
465 0 1 unless eval { do { $$item{'task'}->isa('cPanel::TaskQueue::Task') } }