Branch Coverage

blib/lib/PHP/Functions/Password.pm
Criterion Covered Total %
branch 84 158 53.1


line true false branch
169 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
187 34 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
189 18 16 if ($crypted =~ /$RE_BCRYPT_STRING/) { }
10 6 elsif ($crypted =~ /$RE_ARGON2_STRING/) { }
243 9 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
245 0 9 @_ && ref $_[0] ? :
247 0 9 unless ($algo =~ /^\d$/)
250 3 6 if ($algo == 1) { }
6 0 elsif ($algo == 3 or $algo == 2) { }
252 0 3 if (defined $options{'salt'} and length $options{'salt'}) { }
255 0 0 if utf8::is_utf8($salt)
256 0 0 if (length $salt == 16) { }
0 0 elsif ($salt =~ /^$RE_BCRYPT_SALT$/) { }
272 0 3 if ($options{'cost'})
275 0 0 unless ($options{'cost'} =~ /^\d{1,2}$/ and $options{'cost'} >= $min_cost and $options{'cost'} <= $max_cost)
282 2 1 if utf8::is_utf8($password)
286 1 2 if (&bytes::length($password) > $PASSWORD_BCRYPT_MAX_PASSWORD_LEN)
293 0 6 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
294 0 0 $algo == 3 ? :
304 4 2 if utf8::is_utf8($password)
307 3 3 if ($algo == 3) { }
324 24 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
327 24 0 @_ && ref $_[0] ? :
329 4 20 unless ($info)
330 0 4 if $options{'debug'}
333 0 20 unless ($info->{'algo'} == $algo)
334 0 0 if $options{'debug'}
337 12 8 if ($algo == 1) { }
8 0 elsif ($algo == 3 or $algo == 2) { }
339 4 8 unless ($info->{'algoSig'} eq $SIG_BCRYPT)
340 0 4 if $options{'debug'}
344 4 4 unless (defined $info->{'options'}{'cost'} and $info->{'options'}{'cost'} == $cost)
345 0 4 if $options{'debug'}
351 2 6 if ($info->{'options'}{'memory_cost'} != $memory_cost)
352 0 2 if $options{'debug'}
356 2 4 if ($info->{'options'}{'time_cost'} != $time_cost)
357 0 2 if $options{'debug'}
361 2 2 if ($info->{'options'}{'threads'} != $threads)
362 0 2 if $options{'debug'}
365 0 2 defined $options{'salt'} && length $options{'salt'} ? :
368 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
369 2 0 if ('Crypt::Argon2'->can('argon2_needs_rehash')) { }
373 0 0 if ($info->{'version'} < 19)
374 0 0 if $options{'debug'}
379 0 0 unless (defined $salt)
380 0 0 if $options{'debug'}
384 0 0 if ($wanted_salt_length != $actual_salt_length)
385 0 0 if $options{'debug'}
391 0 0 if ($wanted_tag_length != $actual_tag_length)
392 0 0 if $options{'debug'}
399 0 0 if $options{'debug'}
410 50 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
413 0 50 unless defined $password and length $password
414 0 50 unless defined $crypted and length $crypted
416 32 18 if ($crypted =~ /$RE_BCRYPT_STRING/) { }
16 2 elsif ($crypted =~ /$RE_ARGON2_STRING/) { }
419 22 10 if utf8::is_utf8($password)
423 10 22 if (&bytes::length($password) > $PASSWORD_BCRYPT_MAX_PASSWORD_LEN)
427 24 8 Crypt::Bcrypt::bcrypt_check($password, $crypted) ? :
431 0 16 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
438 10 6 if utf8::is_utf8($password)
441 8 8 if ($algo == 3) { }
442 8 0 Crypt::Argon2::argon2id_verify(@args) ? :
445 8 0 Crypt::Argon2::argon2i_verify(@args) ? :
470 0 1 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
491 0 5 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
495 1 4 unless (defined $info)
503 0 5 wantarray ? :
523 0 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
526 0 0 @_ && ref $_[0] ? :
542 0 12 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
557 0 25 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
578 1 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
593 5 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
595 0 5 wantarray ? :
609 9 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
611 0 9 @_ && ref $_[0] ? :
625 12 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :
639 25 0 @_ && UNIVERSAL::isa($_[0], __PACKAGE__) ? :