Branch Coverage

blib/lib/PHP/Functions/Password.pm
Criterion Covered Total %
branch 80 132 60.6


line true false branch
167 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
191 5 29 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
193 18 16 if ($crypted =~ /$RE_BCRYPT_STRING/) { }
10 6 elsif ($crypted =~ /$RE_ARGON2_STRING/) { }
208 12 6 wantarray ? :
233 8 2 wantarray ? :
242 4 2 wantarray ? :
260 9 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
263 0 9 @_ && ref $_[0] ? :
264 0 9 unless ($algo =~ /^\d$/)
267 3 6 if ($algo == 1) { }
6 0 elsif ($algo == 3 or $algo == 2) { }
269 0 3 if (defined $options{'salt'} and length $options{'salt'}) { }
272 0 0 if utf8::is_utf8($salt)
273 0 0 if (length $salt == 16) { }
0 0 elsif ($salt =~ /^$RE_BCRYPT_SALT$/) { }
289 0 3 if ($options{'cost'})
292 0 0 unless ($options{'cost'} =~ /^\d{1,2}$/ and $options{'cost'} >= $min_cost and $options{'cost'} <= $max_cost)
299 2 1 if utf8::is_utf8($password)
303 1 2 if (&bytes::length($password) > $PASSWORD_BCRYPT_MAX_PASSWORD_LEN)
310 0 6 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
311 0 0 $algo == 3 ? :
321 4 2 if utf8::is_utf8($password)
324 3 3 if ($algo == 3) { }
346 12 12 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
349 24 0 @_ && ref $_[0] ? :
351 2 22 unless ($info{'algo'} == $algo)
352 0 2 if $options{'debug'}
355 12 10 if ($algo == 1) { }
8 2 elsif ($algo == 3 or $algo == 2) { }
357 4 8 unless ($info{'algoSig'} eq $SIG_BCRYPT)
358 0 4 if $options{'debug'}
362 4 4 unless (defined $info{'options'}{'cost'} and $info{'options'}{'cost'} == $cost)
363 0 4 if $options{'debug'}
369 2 6 if ($info{'options'}{'memory_cost'} != $memory_cost)
370 0 2 if $options{'debug'}
374 2 4 if ($info{'options'}{'time_cost'} != $time_cost)
375 0 2 if $options{'debug'}
379 2 2 if ($info{'options'}{'threads'} != $threads)
380 0 2 if $options{'debug'}
383 0 2 defined $options{'salt'} && length $options{'salt'} ? :
386 2 0 if ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
387 2 0 if ('Crypt::Argon2'->can('argon2_needs_rehash')) { }
391 0 0 if ($info{'version'} < 19)
392 0 0 if $options{'debug'}
397 0 0 unless (defined $salt)
398 0 0 if $options{'debug'}
402 0 0 if ($wanted_salt_length != $actual_salt_length)
403 0 0 if $options{'debug'}
409 0 0 if ($wanted_tag_length != $actual_tag_length)
410 0 0 if $options{'debug'}
417 0 2 if $options{'debug'}
432 25 25 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
434 32 18 if ($crypted =~ /$RE_BCRYPT_STRING/) { }
16 2 elsif ($crypted =~ /$RE_ARGON2_STRING/) { }
437 22 10 if utf8::is_utf8($password)
441 10 22 if (&bytes::length($password) > $PASSWORD_BCRYPT_MAX_PASSWORD_LEN)
448 0 16 unless ($INC{'Crypt/Argon2.pm'} or eval { do { require Crypt::Argon2 } })
455 10 6 if utf8::is_utf8($password)
458 8 8 if ($algo == 3) { }
485 1 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
500 5 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
516 9 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
518 0 9 @_ && ref $_[0] ? :
534 12 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :
548 25 0 @_ && UNIVERSAL::isa($_[0], 'PHP::Functions::Password') ? :