Branch Coverage

lib/Sysync/File.pm
Criterion Covered Total %
branch 28 90 31.1


line true false branch
64 0 1 unless $self->is_valid_host($host)
69 0 1 if (-e "$sysdir/hosts/default.conf")
77 1 0 if ($self->is_valid_host($host))
103 2 0 unless defined $stack
111 0 2 unless $block
113 1 0 if (my $file = $item->{'file'}) { }
0 0 elsif (my $directory = $item->{'directory'}) { }
0 0 elsif (my $type = $item->{'import'}) { }
115 0 1 if ($item->{'directory'} or $item->{'import'})
120 0 1 if ($item->{'source'})
122 0 0 if ($item->{'source'} =~ m[^/]) { }
135 0 1 unless ($owner)
139 0 1 unless ($group)
143 0 1 unless ($item->{'mode'})
157 0 0 unless ($owner)
161 0 0 unless ($group)
172 0 0 if ($type eq 'host') { }
0 0 elsif ($type eq 'config') { }
176 0 0 if ($self->is_valid_host($h)) { }
179 0 0 if (my $file_block = $fetch_host->{'files'})
181 0 0 if (grep {$_ eq "$sysdir/hosts/$h.conf";} @$stack)
201 0 0 if ($source =~ m[^/]) { }
209 0 0 unless $config
211 0 0 if (my $file_block = $config->{'files'})
213 0 0 if (grep {$_ eq $source;} @$stack)
270 0 7 if (-e "$sysdir/hosts/default.conf")
276 7 0 if ($self->is_valid_host($host))
284 7 0 unless $default_host_config->{'users'}
285 0 7 unless $host_config->{'users'}
287 7 0 unless $default_host_config->{'groups'}
288 0 7 unless $host_config->{'groups'}
292 0 7 unless $user_groups
295 7 0 if ($group eq 'all') { }
307 0 7 unless $user
320 0 7 if $host_groups{$group}
329 84 7 unless ($host_groups{$user->{'username'}} or $user->{'gid'})
360 0 7 unless -e "$sysdir/users/$username.conf"
381 7 14 if ($file =~ /(.*?)\.conf$/)
415 7 14 if ($file =~ /(.*?)\.conf$/)
434 0 0 unless -e "$sysdir/groups/$group.conf"
438 0 0 unless $group_conf->{'users'} and ref $group_conf->{'users'} eq "ARRAY"
456 0 0 if (scalar @_ >= 1) { }
458 0 0 if ($_[0]) { }
489 0 0 if (scalar @_ >= 1) { }
491 0 0 if ($_[0]) { }