Branch Coverage

blib/lib/File/CleanupTask.pm
Criterion Covered Total %
branch 147 206 71.3


line true false branch
206 0 21 unless ($$self{'cmd_gzip'})
241 0 0 unless GetOptions $rh_params, 'conf=s', 'taskname|task=s', 'dryrun', 'verbose', 'help'
253 0 0 if ($$rh_params{'help'})
257 0 0 unless ($$rh_params{'conf'})
261 0 0 if ($$rh_params{'dryrun'})
300 0 20 unless (-e $config_file)
311 0 2120 unless (exists $allowed_values{$key})
318 0 2120 if (not $can_symlink and $key eq 'enable_symlinks_integrity_in_path' || $key eq 'keep_if_linked_in') { }
339 0 800 unless (exists $$self{'_rhh_task_configs'}{$taskname}{$ckey})
354 20 0 if ($$self{'params'}{'taskname'})
355 20 0 if (grep {$_ eq $$self{'params'}{'taskname'};} @a_all_tasknames) { }
398 24 0 if ($taskname)
414 0 24 unless (-d $path)
424 0 24 if ($all_or_nothing_path and not -d $all_or_nothing_path)
435 0 24 if ($all_or_nothing_path and index($all_or_nothing_path, $path) < 0)
448 8 16 $max_days ? :
460 10 14 if $path_symlink
469 1 23 if ($all_or_nothing_path)
477 4 20 if ($path_backup)
478 0 4 unless ($self->_ensure_path($path_backup))
491 24 0 if ($path)
541 18 0 if (-d $f)
574 28 89 if (my $f_target = readlink $f)
588 20 8 if (-d $f_target)
589 20 0 if ($f_target = $self->_path_check($f_target))
625 0 202 if (not $path) { }
647 18 17 if exists $$rh_delete_once_empty{'paths'}{$path}
663 0 18 if (not $path) { }
684 144 1111 if exists $$rh_never_delete{'paths'}{$path}
697 0 2473 unless ($path)
699 29 2444 if (-l $path)
710 2441 3 -e $path ? :
758 18 6 if ($recursive) { }
768 373 0 unless (exists $summary{$dir})
783 87 1172 if ($symlinks_integrity)
789 1254 5 if (not $will_check_integrity)
793 971 283 if (not exists $empties{$f})
806 746 0 if ($action eq 'delete' and -f $f || -l $f)
830 12 361 if (not $prune_empty) { }
43 318 elsif ($self->_never_delete_contains($rh_never_delete, $dir)) { }
24 294 elsif ($ndel < $nf) { }
854 84 210 if ($dont_del_pattern)
861 0 294 if ($matches) { }
867 0 294 if (not defined $d_time) { }
11 283 elsif ($$self{'keep_above_epoch'} and $d_time >= $$self{'keep_above_epoch'}) { }
880 60 223 $self->_is_folder_empty($dir) ? :
904 373 0 if (my $f_parent = $self->_parent_path($dir))
923 0 21 if ($symlinks_integrity)
928 21 0 unless ($will_check_integrity)
940 1 0 if (-d $f and $prune_empty and $self->_is_folder_empty($f) and not $self->_never_delete_contains($rh_never_delete, $f) and !$$self{'keep_above_epoch'} || (stat $f)[9] <= $$self{'keep_above_epoch'})
1013 99 893 if (-d $f and not -l $f)
1020 101 792 if ($self->_never_delete_contains($$rh_params{'never_delete'}, $f)) { }
1031 50 742 if ($pattern)
1040 43 749 if ($dont_del_pattern)
1048 11 781 if (not $file_must_be_considered) { }
1052 20 761 if ($file_must_be_kept) { }
1064 4 757 if ($File::CleanupTask::Config{'d_lstat'} and -l $f) { }
1069 0 761 if (not defined $f_time) { }
4 757 elsif ($$self{'keep_above_epoch'} and $f_time >= $$self{'keep_above_epoch'}) { }
1082 9 748 if ($backup_path) { }
1093 893 0 if ($action)
1118 1270 2577 defined $add_to_top ? :
1121 1230 2617 if ($add_to_top) { }
1147 0 288 unless opendir my $dh, $dirname
1148 1135 288 if $_ ne '.'
1176 1014 256 if ($action eq 'delete') { }
9 247 elsif ($action eq 'backup') { }
1180 0 1014 if ($self->dryrun) { }
1205 9 0 if ($self->_ensure_path($to))
1210 7 2 if ($backup_gzip and $$self{'cmd_gzip'})
1214 3 4 if ($from and not $from =~ /[.](gz|tgz)$/i and not readlink $from) { }
1222 0 3 if ($self->dryrun) { }
1240 0 9 if ($self->dryrun) { }
1245 0 9 unless (move($from, $to_file))
1261 3 10 unless (-e $path and -d $path)
1264 0 3 if $@
1267 0 13 unless (-e $path and -d $path)
1334 2 1265 if (exists $$rh_symlinks{$f})
1342 3 0 $action eq 'nothing' ? :
1345 3 0 unless (exists $symlinks_marked{$sym_cparent})
1363 1264 3 if (not exists $symlinks_marked{$f}) { }
1380 3 0 if (scalar @sym_nothing) { }
1386 3 0 if $f_parent
1415 1 23 $rh_delete_once_empty ? :
1418 374 896 if (-d $f and not -l $f)
1422 16 358 if ($$rh_undelete_dirs{$f})
1428 16 0 if $f_parent
1443 23 1 unless $rh_delete_once_empty
1452 9 31 if ($propagate_action)
1454 5 4 index($f, $propagate_action) == 0 ? :
1463 4 31 if (not $propagate_action and $self->_delete_once_empty_contains($rh_delete_once_empty, $f) and $action eq 'nothing')
1474 5 35 if ($propagate_action and $f ne $propagate_action)
1505 0 424 unless ($f_path)
1515 0 424 unless ($directories)
1517 0 0 if (-e 'File::Spec'->catpath($volume, $cwd, $file)) { }
1556 5 82 if (my $sym_target = readlink $sym_path)
1558 3 2 unless (exists $$rh_symlinks{$sym_target_cpath})
1586 50 127 if ($pattern =~ m[^/(.*)/$])
1596 0 24 if (not scalar keys %$rh_never_delete) { }
1611 0 1 if (not scalar keys %$rh_delete_once_empty) { }
1628 0 24 if (not $ra_plan && scalar @$ra_plan) { }
1648 0 2644 if $self->verbose
1676 0 0 if ($message) { }