Branch Coverage

blib/lib/cPanel/SyncUtil.pm
Criterion Covered Total %
branch 89 184 48.3


line true false branch
56 0 0 if (not -l _) { }
86 1 1 if ($type == 1) { }
87 1 0 ref $args[-1] eq 'HASH' ? :
97 0 5 unless $dir and -d $dir
100 2 28 if $File::Find::name eq '.'
103 2 26 if (exists $ignore_name{$File::Find::name} or exists $ignore_name{$filename})
126 5 0 wantarray ? :
131 0 0 unless -d $_
138 0 0 unless -d $_
145 0 0 if defined $dir and not $dir =~ /\.bak$/ and not $dir =~ /^\./ and -d $dir and not -l $dir
162 0 0 if (@_ == 3) { }
0 0 elsif (@_ == 2) { }
172 0 0 defined $group ? :
173 0 0 unless $chown =~ /^\w+(\:\w+)?$/
175 0 0 unless -d $dir
182 0 3 ref $verbose ? :
184 0 3 $$args_hr{'verbose'} ? :
186 0 3 if (not -d $base) { }
0 3 elsif (not chdir $base) { }
195 1 2 if (not -d $archive) { }
0 2 elsif ($archive eq '.') { }
206 8 10 if ($file =~ /\.bz2$/ and not -e $file . '.bz2.bz2')
216 0 2 unless (chdir $archive)
220 1 1 if (@files) { }
222 2 1 if -f $file
230 0 2 unless (chdir $pwd)
239 2 1 ref $verbose ? :
250 0 3 if (-e '.cpanelsync')
251 0 0 unless open my $cps_fh, '<', '.cpanelsync'
255 0 0 if $ftype eq 'f'
260 0 3 unless open my $cpsw_fh, '>', '.cpanelsync'
264 0 34 if ($file =~ m[/\.cpanelsync$] or $file =~ m[/\.cpanelsync.lock$]) { }
0 34 elsif ($file =~ /===/) { }
272 8 26 if ($file =~ /\.bz2$/)
275 8 0 if -e $file and -e $tfile
278 0 26 ref $$args_hr{'get_mode_string'} eq 'CODE' ? :
280 0 26 if (-l $file) { }
9 17 elsif (-d $file) { }
288 0 17 if -z $file and $$args_hr{'verbose'}
291 0 17 if (exists $oldmd5s{$file} and $md5sum ne $oldmd5s{$file}) { }
8 9 elsif (-e $file . '.bz2') { }
296 0 8 if ($mtime > (stat _)[9])
323 0 0 if ref $opts_ref ne 'HASH'
326 0 0 wantarray ? :
331 1 1 ref $verbose ? :
334 0 2 unless ($dir and -d $dir)
338 0 2 if $$args_hr{'verbose'}
341 0 2 unless (chdir $dir)
348 0 2 if (-e '.cpanelsync')
349 0 0 unless open my $cps_fh, '<', '.cpanelsync'
351 0 0 unless $line =~ /^f/
359 0 2 unless open my $cpsw_fh, '>', '.cpanelsync'
363 0 10 if $file eq './.cpanelsync' or $file eq './.cpanelsync.lock'
365 0 10 if ($file =~ /===/) { }
0 10 elsif ($file =~ /\.bz2$/) { }
374 0 0 if -e $tfile
377 5 5 ref $$args_hr{'get_mode_string'} eq 'CODE' ? :
379 0 10 if (-l $file) { }
2 8 elsif (-d $file) { }
384 0 2 unless print {$cpsw_fh;} "d===$file===$perms\n"
387 0 8 if -z $file and $$args_hr{'verbose'}
390 0 8 if (exists $oldmd5s{$file} and $md5sum ne $oldmd5s{$file}) { }
0 16 elsif (-e $file . '.bz2' and $mtime > (stat _)[9]) { }
396 0 8 unless print {$cpsw_fh;} "f===$file===$perms===$md5sum\n"
399 0 2 unless print {$cpsw_fh;} ".\n"
400 0 2 unless close $cpsw_fh
402 2 0 if (open my $lock_fh, '>>', '.cpanelsync.lock') { }
411 0 2 unless (chdir $pwd)
416 0 2 if $$args_hr{'verbose'}
422 0 1 unless ($dir and -d $dir)
428 0 0 if (not -e $cpanelsync or -z _ or not -e $cpanelsync_lock)
434 0 1 unless (chdir $dir)
440 0 5 if $file =~ /\.bz2$/
441 0 5 if (-e $file . '.bz2')
443 0 0 if ((stat $file)[9] > $archive_mtime) { }
444 0 0 unless unlink $file . '.bz2'
450 0 5 unless (-e $file)
453 0 5 unless bzip_file($file, $verbose)
460 0 1 unless (chdir $pwd)
464 0 1 unless bzip_file($dir . '.tar', $verbose)
472 0 1 unless ($cpanelsync_file and -e $cpanelsync_file)
473 0 0 if (-e '.cpanelsync') { }
481 1 0 if (open my $cpanelsync_fh, '<', $cpanelsync_file) { }
483 2 4 unless $line =~ /^f/
492 1 0 wantarray ? :
497 0 6 $verbose ? :
498 0 6 unless -f $file
499 1 5 unless ($bzip)
503 0 6 unless -e $file . '.bz2'
508 0 1 if $bzip
510 1 5 if (-x 'File::Spec'->catfile($dir, 'bzip2'))
515 0 1 unless ($bzip)