Branch Coverage

blib/lib/File/KDBX/Util.pm
Criterion Covered Total %
branch 151 268 56.3


line true false branch
48 0 27 $debug ? :
0 27 &looks_like_number($debug) ? :
52 0 27 $debug == 4 ? :
0 27 $debug == 3 ? :
0 27 $debug == 2 ? :
0 27 $debug == 1 ? :
105 11 27 if defined $XS_LOADED
107 1 26 if ($ENV{'PERL_ONLY'} or exists $ENV{'PERL_FILE_KDBX_XS'} and not $ENV{'PERL_FILE_KDBX_XS'})
116 37 0 unless $version
125 0 0 if &$code()
130 0 0 if (try_load_optional("B::Deparse"))
143 15 0 if $Config::Config{'d_fork'}
144 0 0 if $^O ne "MSWin32" and $^O ne "NetWare"
145 0 0 unless $Config::Config{'useithreads'}
146 0 0 unless $Config::Config{'ccflags'} =~ /-DPERL_IMPLICIT_SYS/
147 0 0 if $] < "5.008001"
148 0 0 if ($] == "5.01" and $Config::Config{'ccname'} eq "gcc" and $Config::Config{'gccversion'})
149 0 0 unless $Config::Config{'gccversion'} =~ /^(\d+)\.(\d+)/
151 0 0 if $parts[0] > 4 or $parts[0] == 4 and $parts[1] >= 8
153 0 0 if $INC{'Devel/Cover.pm'}
166 0 0 if (XXX) { }
0 0 elsif (XXX) { }
0 0 elsif (XXX) { }
204 0 0 unless defined wantarray
216 4 1393 if @_ == 0
228 26 1 if (load_xs()) { }
0 1 elsif (eval { do { require B::COW; 1 } }) { }
244 348 1705 if (not XXX) { }
1639 66 elsif (XXX) { }
65 1 elsif (XXX) { }
1 0 elsif (XXX) { }
245 113 235 if not defined $_ or &readonly($_)
247 0 235 if defined $cowrefcnt and 1 < $cowrefcnt
260 415 1224 if not defined $$_ or &readonly($$_)
262 262 962 if defined $cowrefcnt and 1 < $cowrefcnt
290 0 828 unless defined wantarray
293 0 46 unless not XXX or XXX or XXX or XXX
295 110 780 XXX ? :
313 955 108 @_ % 2 == 1 ? :
318 110 931 XXX ? :
22 1041 XXX ? :
323 432 631 if $name =~ /\./
327 565 468 $store ? :
30 1033 $last ? :
332 535 152 defined $default ? :
376 687 XXX ? :
338 966 97 if ($is eq "rw")
339 0 178 defined $coerce ? :
788 178 XXX ? :
361 0 346 unless length $_ == 16
367 2 189 @_ % 2 == 1 ? :
370 1 190 if XXX
375 2 189 $printable ? :
385 0 0 unless $status == Compress::Raw::Zlib::Z_OK()
388 0 0 unless $status == Compress::Raw::Zlib::Z_STREAM_END()
398 0 2 unless $status == Compress::Raw::Zlib::Z_OK()
401 0 2 unless $status == Compress::Raw::Zlib::Z_OK()
404 0 2 unless $status == Compress::Raw::Zlib::Z_OK()
412 0 30 if ($Config::Config{'ivsize'} < 8)
423 0 317 if ($Config::Config{'ivsize'} < 8)
424 0 0 if (&blessed($num) and $num->can('as_hex')) { }
426 0 0 if "Math::BigInt"->new("18446744073709551615") <= $num
427 0 0 if $num <= "Math::BigInt"->new("-9223372036854775808")
429 0 0 if ($num < 0)
436 0 0 if length $bytes < 8
437 0 0 if ($neg)
445 0 0 $num < 0 ? :
459 0 174 if ($Config::Config{'ivsize'} < 8)
470 0 8 if ($Config::Config{'ivsize'} < 8)
472 0 0 if (ord substr($bytes, -1, 1) & 128) { }
473 0 0 if $bytes eq "\0\0\0\0\0\0\0\200"
487 0 0 if defined $_[0] and not XXX
499 0 96 if (my $err = $@)
505 0 96 wantarray ? :
519 2 13 unless my $size = shift()
521 0 13 unless 0 <= $size and $size < 256
535 359 36 if (XXX or overload::Method($code, '&{}')) { }
2 34 elsif (XXX) { }
548 1306 0 @_ == 3 ? :
550 0 1306 unless defined $result
551 1 1305 if $result != $_[2]
561 1 41 if $max_depth < ++$depth
571 50 94 if &$query($item)
579 10 11 @_ && ($OPS{$_[0] or ''} || 0) == 2 ? :
593 4 24 $neg ? :
26 2 $is_re ? :
632 0 0 unless $path =~ m[^/]
634 0 0 $scheme eq 'https' ? :
0 0 $scheme eq 'http' ? :
647 0 32 if &looks_like_number($_[0])
648 1 31 if $_[0] eq "now"
649 1 30 unless &blessed($_[0])
655 0 7 if length $str < 16
656 0 7 if 16 < length $str
672 0 2 if (my $err = $@)
701 0 12 unless /^[A-Fa-f0-9]{32}$/
714 67 149 if @$arr % 2 == 1
716 7 154 if XXX
732 0 121 if defined $subject and not XXX and ($OPS{$subject} || 2) < 2
733 75 212 if _is_operand_plain($operand)
734 2 210 if $op eq "-not" or $op eq "-false"
735 13 197 if XXX
741 142 74 if (_looks_like_keypairs(\@atoms)) { }
743 67 75 if (my $op_type = $OPS{$atom}) { }
75 0 elsif (not XXX) { }
744 9 58 if ($op_type == 1 and _is_operand_plain($operand)) { }
757 35 39 if ($OPS{$atom}) { }
767 178 19 if (@queries == 1) { }
12 7 elsif ($op eq '-and') { }
7 0 elsif ($op eq '-or') { }
785 2 82 if $op eq "-true"
786 1 83 if $op eq "-false"
787 0 84 if $op eq "-not"
789 0 84 unless defined $subject
790 0 84 unless $OPS{$op} >= 0
791 11 73 if (empty($operand))
792 9 2 if ($OPS{$op} < 2) { }
1 1 elsif ($op eq 'eq' or $op eq '==') { }
1 0 elsif ($op eq 'ne' or $op eq '!=') { }
807 56 170 &blessed($_[0]) && $_[0]->can($subject) ? :
810 78 2 if defined $_
811 2 0 if defined $_
812 0 0 if defined $_
813 0 0 if defined $_
814 0 0 if defined $_
815 0 0 if defined $_
816 4 0 if defined $_
817 4 0 if defined $_
818 0 0 if defined $_
819 0 0 if defined $_
820 0 0 if defined $_
821 4 0 if defined $_
822 81 0 if defined $_
823 7 0 if defined $_