Branch Coverage

lib/Device/ScanShare.pm
Criterion Covered Total %
branch 52 110 47.2


line true false branch
12 0 46 if $Device::ScanShare::DEBUG
14 0 0 if $Device::ScanShare::DEBUG
20 0 1 unless $$self{'userdirs_abs_path'}
34 0 21 if defined $arg
36 1 20 unless (defined $$self{'base_path'})
39 0 1 unless $$self{'base_path'} =~ s[/[^/]+txt$][]i
56 0 0 unless $arg
61 0 0 if _is_windowspath($arg)
64 0 0 unless my $rel = _to_rel_unixpath($basepath, $arg)
74 0 0 unless $arg
75 0 0 unless $arg =~ /\\/
76 0 0 if $arg =~ m[/]
82 0 5 unless $arg
84 5 0 if $arg =~ /\\/
86 0 0 if $arg =~ m[^/]
91 0 10 unless $arg
95 10 0 if (-d "$basepath/$arg")
99 0 0 unless my $a = Cwd::abs_path($arg)
100 0 0 if -d $a
108 0 5 unless $arg
110 0 5 unless _is_unixpath($arg) or $arg = _to_abs_unixpath($basepath, $arg)
113 0 5 unless $arg =~ s[^$basepath/][]
126 0 1 unless $windowspath
138 0 1 unless exists $self->_data->{$windowspath}
151 0 24 unless $windowspath
153 1 23 unless exists $self->_data->{$windowspath}
168 0 5 unless $$argv{'label'}
169 0 5 unless $$argv{'path'}
177 5 0 if ($$argv{'path'} =~ m[^/])
180 1 4 unless my $abs = Cwd::abs_path($$argv{'path'})
184 0 4 unless my $base = Cwd::abs_path($self->base_path)
188 0 4 unless $abs =~ s[^$base/][]
208 0 4 if (exists $self->_data->{$windowspath})
216 1 3 if $self->exists_label($$argv{'label'}) and warn "Cannot add label:$$argv{'label'} path:$$argv{'path'} host: $$argv{'host'}, label is being used."
222 0 3 unless (-d "$b/$unixpath")
223 0 0 unless File::Path::mkpath("$b/$unixpath")
239 0 1 if $self->exists
247 0 4 unless defined $arg
250 1 3 if $$h{'label'} eq $arg
272 0 6 unless my $savefile = $self->_get_header
279 0 6 unless my $l = length $savefile
287 0 6 unless open SVF, '>', $temp
295 0 6 unless rename $temp, $abs
297 0 6 if ($Device::ScanShare::DEBUG)
298 0 0 unless -f $abs
333 2 4 -f $_[0]->userdirs_abs_path ? :
367 0 0 unless $line =~ s/^([^=]+)=//
406 3 96 unless (defined $$self{'data'})
408 2 1 unless ($self->exists)
418 1 0 unless scalar @lines
439 1 5 if ($line =~ /^Server\=([\d\.\w]+)$/i)
443 4 1 if ($line =~ /^\[\w+\]|^NextID=/i)
444 1 0 unless $line =~ m(^[^\[\]/\\=]+=)
451 0 1 unless $abs
453 0 1 unless open FILE, '<', $abs