Branch Coverage

blib/lib/Concierge/Auth.pm
Criterion Covered Total %
branch 103 130 79.2


line true false branch
45 10 9 if ($args->{'no_file'})
50 1 8 unless ($args->{'file'})
56 1 7 if (-e $args->{'file'}) { }
58 0 1 unless open my $afh, "<", $args->{'file'}
62 1 6 unless open my $afh, ">", $args->{'file'}
66 0 7 unless chmod 0600, $args->{'file'}
87 75 11 wantarray ? :
91 46 4 wantarray ? :
97 32 10 wantarray ? :
104 7 46 unless defined $id and length $id > 0
108 3 43 unless length $id >= 2 and length $id <= 32
118 4 39 unless $id =~ /$ID_ALLOWED_CHARS/u
128 5 30 unless defined $password and length $password > 0
132 7 23 unless length $password >= 8 and length $password <= 72
147 9 4 $file && -e $file && -r $file ? :
158 1 10 unless $ok
161 1 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 3 unless $id[0]
190 1 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 7 unless $id[0]
232 1 6 unless $pwd[0]
237 1 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 5 unless $id[0]
272 2 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 5 unless $id[0]
306 2 3 unless $pwd[0]
313 1 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 2 5 unless $file =~ /\S/u
355 3 2 if (-e $file) { }
356 0 3 unless open my $afh, "<", $file
360 0 2 unless open my $afh, ">", $file
365 0 5 unless chmod 0600, $file
367 5 0 if ($self->validateFile($file))
380 2 2 unless ($pfile and -e $pfile)
384 0 2 unless (unlink $pfile)
397 1 1 unless $pfile
400 0 1 unless $ok
412 2 6 unless $vp[0]
421 11 2 defined $self->{'auth'}{'file'} ? :
433 1 0 defined $uuid ? :
442 2 0 defined $id ? :
461 3 0 defined $token ? :
470 1 0 defined $string ? :
479 2 0 defined $phrase ? :