Branch Coverage

blib/lib/Concierge/Auth.pm
Criterion Covered Total %
branch 93 130 71.5


line true false branch
45 4 8 if ($args->{'no_file'})
50 1 7 unless ($args->{'file'})
56 0 7 if (-e $args->{'file'}) { }
58 0 0 unless open my $afh, "<", $args->{'file'}
62 1 6 unless open my $afh, ">", $args->{'file'}
66 0 6 unless chmod 0600, $args->{'file'}
87 63 8 wantarray ? :
91 33 3 wantarray ? :
97 21 9 wantarray ? :
104 7 40 unless defined $id and length $id > 0
108 3 37 unless length $id >= 2 and length $id <= 32
118 4 33 unless $id =~ /$ID_ALLOWED_CHARS/u
128 3 24 unless defined $password and length $password > 0
132 5 19 unless length $password >= 8 and length $password <= 72
147 7 3 $file && -e $file && -r $file ? :
158 1 9 unless $ok
161 0 9 unless -e $pfile
163 0 9 unless open my $pfh, "<", $pfile
165 0 9 unless (flock $pfh, 1)
171 4 1 if (/^$id$sep/u)
186 1 2 unless $id[0]
190 0 2 unless ($pfile and -e $pfile)
193 0 2 unless open my $fh, "+<", $pfile
194 0 2 unless (flock $fh, 2)
203 1 0 if ($line =~ /^$id$sep/u)
209 0 2 unless (seek $fh, 0, 0 and truncate $fh, 0 and print $fh @output and close $fh)
219 1 1 $success ? :
230 1 6 unless $id[0]
232 1 5 unless $pwd[0]
237 0 5 unless open my $pfh, "<", $pfile
239 0 5 unless (flock $pfh, 1)
244 4 1 if (/^$id$sep([^$sep]+)$sep\|/u)
248 2 2 if ($self->{'auth'}->verify_password($passwd, $phash)) { }
270 1 4 unless $id[0]
272 1 3 unless $pwd[0]
274 1 2 if $chk[0]
280 0 2 unless open my $pfh, ">>", $pfile
282 0 2 unless (flock $pfh, 2)
286 0 2 unless (print $pfh join($sep, $id, $phash, "|\n"))
290 0 2 unless close $pfh
304 1 3 unless $id[0]
306 1 2 unless $pwd[0]
313 0 2 unless $f[0]
315 0 2 unless open my $fh, "+<", $pfile
316 0 2 unless (flock $fh, 2)
325 1 1 if ($line =~ /^$id$sep/u)
332 0 2 unless (seek $fh, 0, 0 and truncate $fh, 0 and print $fh @output and close $fh)
342 1 1 $success ? :
353 0 3 unless $file =~ /\S/u
355 1 2 if (-e $file) { }
356 0 1 unless open my $afh, "<", $file
360 0 2 unless open my $afh, ">", $file
365 0 3 unless chmod 0600, $file
367 3 0 if ($self->validateFile($file))
380 0 2 unless ($pfile and -e $pfile)
384 0 2 unless (unlink $pfile)
397 0 1 unless $pfile
400 0 1 unless $ok
412 0 4 unless $vp[0]
421 11 1 defined $self->{'auth'}{'file'} ? :
433 1 0 defined $uuid ? :
442 2 0 defined $id ? :
459 1 0 defined $token ? :
468 1 0 defined $string ? :
477 1 0 defined $phrase ? :