Branch Coverage

blib/lib/Palm/Keyring.pm
Criterion Covered Total %
branch 36 224 16.0


line true false branch
71 0 0 if (ref $_[0] eq 'HASH') { }
0 0 elsif ($_[0] =~ /^-[a-zA-Z0-9_]{1,20}$/) { }
108 0 0 if ($$self{'version'} == 5)
110 0 0 unless my $c = crypts($$self{'options'}{'cipher'})
117 0 0 if (defined $$options{'password'})
135 0 19 if (not defined $crypt && length $crypt) { }
0 19 elsif ($crypt =~ /\D/) { }
139 0 0 if ($$c{'alias'} eq $crypt)
157 0 12 unless exists $$rec{'data'}
159 0 12 if ($$self{'version'} == 4) { }
12 0 elsif ($$self{'version'} == 5) { }
161 0 0 unless exists $$self{'records'}
165 0 0 unless $encrypted
171 0 12 unless my $c = crypts($$self{'appinfo'}{'cipher'})
196 0 0 if ($$self{'version'} == 4) { }
0 0 elsif ($$self{'version'} == 5) { }
197 0 0 if ($$rec{'encrypted'})
198 0 0 unless (defined $$rec{'name'})
208 0 0 if ($$rec{'name'}) { }
251 0 4 if ($$self{'version'} == 4) { }
4 0 elsif ($$self{'version'} == 5) { }
255 0 4 unless _parse_appinfo_v5($appinfo)
269 0 4 unless (exists $$appinfo{'other'})
299 0 0 if ($$self{'version'} == 4) { }
0 0 elsif ($$self{'version'} == 5) { }
345 0 0 unless ($pass or $$self{'appinfo'}{'key'})
349 0 0 unless ($rec)
353 0 0 unless ($data)
357 0 0 if ($pass and not $self->Password($pass))
362 0 0 if ($$rec{'encrypted'})
367 0 0 if ($$self{'version'} == 4) { }
0 0 elsif ($$self{'version'} == 5) { }
374 0 0 if ($$self{'options'}{'v4compatible'})
396 0 0 if (defined $ivec)
404 0 0 if ($encrypted) { }
405 0 0 if ($encrypted eq '1')
431 0 0 if ($old and %{$old;}) { }
433 0 0 if $key eq 'lastchange'
434 0 0 if ($$new{$key} ne $$old{$key})
439 0 0 if (exists $$new{'lastchange'} and exists $$old{'lastchange'} and $$new{'lastchange'}{'day'} != $$old{'lastchange'}{'day'} || $$new{'lastchange'}{'month'} != $$old{'lastchange'}{'month'} || $$new{'lastchange'}{'year'} != $$old{'lastchange'}{'year'}) { }
455 0 0 unless $changed
459 0 0 if ($$new{'lastchange'} and not $need_newdate) { }
465 0 0 if ($year >= 1900)
472 0 0 if ($need_newdate)
495 0 0 unless my $c = crypts($cipher)
497 0 0 unless (defined $ivec)
505 0 0 if ($$new[$i]{'label_id'} and $$new[$i]{'label_id'} == 3 or $$new[$i]{'label'} and $$new[$i]{'label'} eq 'lastchange') { }
0 0 elsif ($old and $#{$new;} == $#{$old;}) { }
0 0 elsif ($#{$new;} != $#{$old;}) { }
510 0 0 if ($old and $#{$new;} == $#{$old;} and $$new[$i]{'data'}{'day'} != $$old[$i]{'data'}{'day'} || $$new[$i]{'data'}{'month'} != $$old[$i]{'data'}{'month'} || $$new[$i]{'data'}{'year'} != $$old[$i]{'data'}{'year'})
522 0 0 if ($n ne $o)
529 0 0 if ($old and not @{$old;} and $date_index)
533 0 0 if $changed == 0
535 0 0 if ($need_newdate or not defined $date_index) { }
542 0 0 if (defined $date_index) { }
553 0 0 if ($$new[$date_index]{'data'}{'year'} >= 1900)
563 0 0 if ($$c{'name'} eq 'None') { }
0 0 elsif ($$c{'name'} eq 'DES_EDE3' or $$c{'name'} eq 'Rijndael') { }
580 0 0 unless ($c)
601 0 3 unless ($pass or $$self{'appinfo'}{'key'})
605 0 3 unless ($rec)
609 0 3 if ($pass and not $self->Password($pass))
613 0 3 unless ($$rec{'encrypted'})
617 0 3 if ($$self{'version'} == 4) { }
3 0 elsif ($$self{'version'} == 5) { }
628 0 3 if ($$self{'options'}{'v4compatible'}) { }
655 0 0 if ($packed_date)
675 0 3 unless my $c = crypts($cipher)
679 3 0 if ($$c{'name'} eq 'None') { }
0 0 elsif ($$c{'name'} eq 'DES_EDE3' or $$c{'name'} eq 'Rijndael') { }
696 0 0 unless ($c)
712 3 8 unless ($field)
729 0 1 unless ($pass)
735 0 1 if ($$self{'version'} == 4 and not exists $$self{'records'} or $$self{'version'} == 5 and not exists $$self{'appinfo'}{'masterhash'})
739 0 0 if ($$self{'version'} == 4)
747 0 1 if ($new_pass)
753 0 0 if ($$self{'version'} == 4 and $i == 0)
758 0 0 unless ($acct)
764 0 0 unless ($self->_password_update($new_pass))
770 0 0 if ($$self{'version'} == 4 and $i == 0)
780 0 1 if (defined $$self{'password'} and $pass eq $$self{'password'})
785 0 1 if ($$self{'version'} == 4) { }
1 0 elsif ($$self{'version'} == 5) { }
791 0 0 if ($valid)
793 0 0 if ($$self{'digest'})
815 0 0 unless ($pass)
818 0 0 unless (defined $data)
829 0 0 if ($data ne $salt . $digest)
843 0 1 unless my $c = crypts($$appinfo{'cipher'})
857 1 0 if ($$appinfo{'masterhash'} eq $hash) { }
876 0 0 if ($$self{'version'} == 4) { }
0 0 elsif ($$self{'version'} == 5) { }
879 0 0 unless ($data)
901 0 0 unless ($hash)
921 0 0 unless (defined $pass)
951 0 0 unless my $c = crypts($cipher)
972 0 0 unless (defined $pass)
1003 0 1 if ($dop)
1033 0 0 unless (length $pt)
1034 0 0 if (length $pt < 8)
1035 0 0 if ($flag == $DECRYPT)
1039 0 0 if ($flag == $ENCRYPT) { }
1073 3 20 if ($len + 4 > length $field)
1078 2 18 if ($len % 2)
1087 3 17 if ($label and $label == 3)
1112 0 0 if (defined $field) { }
1114 0 0 if (defined $$field{'label'} and not $label)
1118 0 0 defined $$field{'data'} ? :
1120 0 0 if ($label and $label == 3)
1128 0 0 if ($len % 2)
1183 0 0 if defined $maxlines and $offset >= $maxlines * 16
1208 0 0 if defined $maxlines and $offset >= $maxlines * 8