Branch Coverage

blib/lib/Net/PhotoBackup/Server.pm
Criterion Covered Total %
branch 21 62 33.8


line true false branch
89 0 0 $config->{'MediaRoot'} ? :
92 0 0 unless $media_root eq ''
95 0 0 unless (-d $config->{'MediaRoot'})
98 0 0 unless mkdir $config->{'MediaRoot'}
117 0 0 $port =~ / \A \d+ \z /msx ? :
0 0 $port eq '' ? :
146 0 1 if ($config) { }
149 0 0 unless $config->{$key}
153 0 0 unless open my $FH, '>', $self->{'config_file'}
161 0 0 unless close $FH
165 1 0 if (-f "$self->{'config_file'}")
167 0 1 unless open my $FH, '<', $self->{'config_file'}
171 3 3 if ($in_section) { }
1 2 elsif ($line =~ / \A \s* \[ photobackup \] \s* \z /msx) { }
172 0 3 if ($line =~ / \A \s* \[ /msx)
176 1 2 if ($line =~ / \A \s* MediaRoot \s* = \s* ([^\0]+) \s* \z /msx) { }
1 1 elsif ($line =~ / \A \s* Password \s* = \s* ([0-9A-F]{128}) \s* \z /imsx) { }
1 0 elsif ($line =~ / \A \s* Port \s* = \s* (\d+) \s* \z /msx) { }
197 0 3 unless $config->{$key}
213 0 0 unless $self->config
241 0 0 unless -f $self->{'pid'}
246 0 0 if $pid
269 1 3 if ($path_info eq '' or $path_info eq '/') { }
3 0 elsif ($path_info eq '/test') { }
270 1 0 if ($method eq 'GET') { }
0 0 elsif ($method eq 'POST') { }
276 0 0 if (not length $post_vars->{'password'} or $post_vars->{'password'} ne $config->{'Password'})
280 0 0 unless ($upload and -f $upload->path)
284 0 0 unless ($filesize)
296 2 1 if (not length $post_vars->{'password'} or $post_vars->{'password'} ne $config->{'Password'})
299 0 1 unless (-d $config->{'MediaRoot'})