Branch Coverage

blib/lib/File/KDBX/Entry.pm
Criterion Covered Total %
branch 165 252 65.4


line true false branch
33 99 356 if (@_ or not defined $self->{'uuid'})
34 13 86 @_ % 2 == 1 ? :
40 13 86 if defined $old_uuid and $self->is_current
43 0 183 unless &Scalar::Util::blessed($_[0])
44 86 97 if $#_
0 99 unless &Scalar::Util::blessed($_[0])
45 5 94 if $#_
0 85 unless &Scalar::Util::blessed($_[0])
46 0 85 if $#_
0 85 unless &Scalar::Util::blessed($_[0])
47 0 85 if $#_
0 85 unless &Scalar::Util::blessed($_[0])
48 0 85 if $#_
0 88 unless &Scalar::Util::blessed($_[0])
49 0 88 if $#_
0 517 unless &Scalar::Util::blessed($_[0])
50 0 517 if $#_
0 114 unless &Scalar::Util::blessed($_[0])
51 2 112 if $#_
0 139 unless &Scalar::Util::blessed($_[0])
52 2 137 if $#_
0 138 unless &Scalar::Util::blessed($_[0])
53 0 138 if $#_
0 136 unless &Scalar::Util::blessed($_[0])
54 0 136 if $#_
0 728 unless &Scalar::Util::blessed($_[0])
55 0 728 if $#_
58 0 101 unless &Scalar::Util::blessed($_[0])
59 10 91 if $#_
0 88 unless &Scalar::Util::blessed($_[0])
60 1 87 if $#_
0 93 unless &Scalar::Util::blessed($_[0])
61 8 85 if $#_
0 85 unless &Scalar::Util::blessed($_[0])
62 0 85 if $#_
0 85 unless &Scalar::Util::blessed($_[0])
63 0 85 if $#_
0 85 unless &Scalar::Util::blessed($_[0])
64 0 85 if $#_
0 86 unless &Scalar::Util::blessed($_[0])
65 1 85 if $#_
67 0 85 unless &Scalar::Util::blessed($_[0])
68 0 85 if $#_
69 0 85 unless &Scalar::Util::blessed($_[0])
70 0 85 if $#_
71 0 88 unless &Scalar::Util::blessed($_[0])
72 0 88 if $#_
100 158 2 if (my $method = $self->can($key)) { }
116 1128 1 @_ % 2 == 1 ? :
150 1129 @_ == 2 ? :
119 1 0 unless (defined $args{'key'} or defined $args{'value'})
122 1 0 if (@other_keys == 1)
128 0 1279 unless my $key = delete $args{'key'}
130 0 1279 if XXX
133 426 312 if (not exists $self->{'strings'}{$key} and $STANDARD_STRINGS{$key})
135 85 341 if $self->_protect($key)
149 0 426 unless $STANDARD_STRINGS{$key}
150 111 315 if (my $kdbx = eval { do { $self->kdbx } })
152 111 0 if defined $protect
173 12 31 if (defined $arg)
174 0 12 $File::KDBX::PLACEHOLDERS{"${placeholder}:$arg"} ? :
177 1 42 unless defined $File::KDBX::PLACEHOLDERS{$placeholder_key}
181 0 23 unless my $handler = $File::KDBX::PLACEHOLDERS{$placeholder_key}
228 321 4 defined $string->{'value'} ? :
246 0 0 if ($association)
248 0 0 defined $association ? :
0 0 XXX && exists $association->{'keystroke_sequence'} ? :
251 0 0 unless $keys
263 6 1 @_ % 2 == 1 ? :
1 7 @_ == 2 ? :
266 1 0 unless (defined $args{'key'} or defined $args{'value'})
269 1 0 if (@other_keys == 1)
275 0 8 unless my $key = delete $args{'key'}
277 0 8 if XXX
301 0 27 unless defined $params{'type'} and defined $params{'secret'}
303 15 12 unless $params{'base32'}
307 0 27 if (my $err = $@)
322 0 10 unless defined $params{'type'} and defined $params{'secret'}
324 0 10 unless $params{'base32'}
328 0 10 if (my $err = $@)
343 0 20 if 4 != grep({defined $_;} @params{"type", "secret", "issuer", "account"})
344 0 20 unless $params{'type'} =~ /^[ht]otp$/i
356 5 15 unless $params{'base32'}
358 9 11 if defined $params{'algorithm'} and $params{'algorithm'} eq "sha1"
359 9 11 if defined $params{'period'} and $params{'period'} == 30
360 16 4 if defined $params{'digits'} and $params{'digits'} == 6
361 5 15 if defined $params{'counter'} and $params{'counter'} == 0
365 1 19 if (defined $params{'encoder'})
369 2 17 if defined $params{'algorithm'}
370 3 16 if defined $params{'digits'}
371 2 17 if defined $params{'counter'}
372 2 17 if defined $params{'period'}
388 24 12 if $params{'secret'}
391 0 12 if not $otp_params{'secret'} or $otp_params{'type'} ne "hotp"
415 11 10 if $params{'secret'}
418 0 10 if not $otp_params{'secret'} or $otp_params{'type'} ne "totp"
430 22 0 if $uri =~ m[^otpauth://]
431 0 22 unless $params{'secret'} and $params{'type'}
433 2 20 if (($params{'encoder'} // "") eq "steam")
443 2 20 if $params{'algorithm'}
444 12 10 if $params{'type'} eq "hotp"
459 22 35 if $count == 0
460 1 34 if 1 < $count
462 15 20 if defined $secret_b32
463 4 16 if defined $secret_b64
464 4 12 if defined $secret_hex
472 0 27 unless &looks_like_number($counter)
491 0 15 unless defined $string->{'value'}
497 0 0 unless defined $item->{'value'}
503 0 0 unless defined $binary->{'value'}
505 0 0 utf8::is_utf8($binary->{'value'}) ? :
510 0 3 unless $self->auto_type->{'associations'}
523 4 280 if (@$entries and not &blessed($entries->[0]))
550 0 2 if (0 <= $max_items and $max_items < @$history)
554 2 0 if (0 <= $max_size)
562 2 0 if (0 <= $max_age)
566 2 1 if $cutoff <= $entry->last_modification_time
591 3 0 if &Hash::Util::FieldHash::id($entry) != &Hash::Util::FieldHash::id($item)
602 9 42 if ($parent)
605 9 0 if $entry
625 0 34 if $current->remove_historical_entry($self)
635 0 0 if $parent
641 0 85 if @_
643 0 85 unless $self->auto_type->{'enabled'}
644 59 26 unless $self->is_connected
646 0 26 if $parent