Branch Coverage

blib/lib/Concierge/Auth/Pwd.pm
Criterion Covered Total %
branch 93 122 76.2


line true false branch
45 11 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'}
93 4 25 unless defined $password and length $password > 0
95 6 19 unless length $password >= 8 and length $password <= 72
106 1 7 unless defined $user_id and length $user_id > 0
108 0 7 unless defined $credential and length $credential > 0
114 1 6 unless open my $pfh, "<", $pfile
116 0 6 unless (flock $pfh, 1)
121 4 1 if (/^\Q$user_id\E$sep([^$sep]+)$sep\|/u)
124 2 2 $self->{'auth'}->verify_password($credential, $phash) ? :
138 0 9 unless defined $user_id and length $user_id > 0
142 2 7 unless $pfile and -e $pfile
144 0 7 unless open my $pfh, "<", $pfile
146 0 7 unless (flock $pfh, 1)
152 3 1 if (/^\Q$user_id\E$sep/u)
165 2 18 unless defined $user_id and length $user_id > 0
167 2 16 unless length $user_id >= 2 and length $user_id <= 32
172 4 12 unless $user_id =~ /$ID_ALLOWED_CHARS/u
176 2 10 unless $vp->{'success'}
181 10 0 if ($pfile and -e $pfile)
182 0 10 unless open my $chfh, "<", $pfile
184 0 10 unless (flock $chfh, 1)
189 1 21 if (/^\Q$user_id\E$sep/u)
199 0 9 unless open my $pfh, ">>", $pfile
201 0 9 unless (flock $pfh, 2)
205 0 9 unless (print $pfh join($sep, $user_id, $phash, "|\n"))
209 0 9 unless close $pfh
217 1 6 unless defined $user_id and length $user_id > 0
221 2 4 unless $vp->{'success'}
226 0 2 unless $pfile and -e $pfile and -r $pfile
231 0 2 unless open my $fh, "+<", $pfile
233 0 2 unless (flock $fh, 2)
242 1 1 if ($line =~ /^\Q$user_id\E$sep/u)
249 0 2 unless (seek $fh, 0, 0 and truncate $fh, 0 and print $fh @output and close $fh)
259 1 1 $success ? :
268 1 3 unless defined $user_id and length $user_id > 0
274 1 2 unless $pfile and -e $pfile
277 0 2 unless open my $fh, "+<", $pfile
279 0 2 unless (flock $fh, 2)
288 1 0 if ($line =~ /^\Q$user_id\E$sep/u)
294 0 2 unless (seek $fh, 0, 0 and truncate $fh, 0 and print $fh @output and close $fh)
304 1 1 $success ? :
332 5 2 wantarray ? :
336 7 1 wantarray ? :
342 8 0 wantarray ? :
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 (-e $file and -r $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 1 unless $vp->{'success'}
421 2 1 defined $self->{'auth'}{'file'} ? :