Branch Coverage

blib/lib/DBI/PurePerl.pm
Criterion Covered Total %
branch 250 292 85.6


line true false branch
200 0 0 if $is_valid_attribute{$attr}
201 0 0 if $attr =~ /^[a-z]/
208 0 96 if $DBI::dbi_debug & 15
219 96 8832 unless $initial_setup
225 96 8832 if $method_name eq 'can'
227 96 8736 if $method_name eq 'DESTROY'
244 94 8738 if $method_name eq 'FETCH' and not exists $ENV{'DBI_TRACE'}
246 0 8832 if 256 & $bitmask
249 96 8736 if 2 & $bitmask
253 384 8448 if 4160 & $bitmask
257 288 8544 if 64 & $bitmask
262 384 8448 if 4096 & $bitmask
267 288 8544 if 65536 & $bitmask
271 2616 6216 if (4 & $bitmask) { }
277 0 6216 8 & $bitmask ? :
294 126 6090 if exists $ENV{'DBI_TRACE'}
295 0 6120 $ke_init ? :
6120 96 unless $method_name eq 'set_err'
311 183 8649 if exists $ENV{'DBI_TRACE'}
315 8544 288 unless exists $DBI::last_method_except{$method_name}
330 183 8649 if exists $ENV{'DBI_TRACE'}
332 192 8640 if 128 & $bitmask
340 864 7968 if 32768 & $bitmask
409 1344 7488 2048 & $bitmask ? :
458 0 8832 if $@
459 0 8832 if $@
471 31 2995 if $DBI::dbi_debug >= 3
474 0 3026 unless $attr->{'ImplementorClass'} = $imp_class
485 656 2370 unless wantarray
492 3 3023 if (($DBI::dbi_debug & 15) >= 4)
499 2920 106 if ($parent) { }
506 23627 17253 if exists $parent->{$_} and not exists $h_inner->{$_}
508 2018 902 if (ref($parent) =~ /::db$/) { }
902 0 elsif (ref($parent) =~ /::dr$/) { }
524 2920 0 if ($HAS_WEAKEN)
529 10 2910 if (@$handles % 120 == 0)
543 106 0 if $HAS_WEAKEN
558 0 18 if defined $level and not looks_like_number($level)
561 6 12 if $level
562 16 2 if (defined $level)
564 6 10 if $DBI::dbi_debug & 15
568 12 6 unless $level
578 18 20 unless $DBI::tfh_needs_close
580 8 30 if (ref $file eq 'GLOB')
586 4 26 if ($file and ref \$file eq 'GLOB')
593 12 14 if (not $file or $file eq 'STDERR') { }
8 6 elsif ($file eq 'STDOUT') { }
594 0 12 unless open $DBI::tfh, '>&STDERR'
597 0 8 unless open $DBI::tfh, '>&STDOUT'
600 0 6 unless open $DBI::tfh, ">>$file"
619 14 0 if ($h_inner)
620 0 14 unless wantarray
627 0 0 unless wantarray
634 6 2 if (not $type) { }
2 0 elsif ($type == 1) { }
650 2 0 if ($version >= 1.56)
671 8 4890 if (not defined $thing or $thing eq '') { }
675 4642 248 $thing =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/ ? :
678 2 4884 @_ > 1 ? :
683 4382 1213 unless defined $v
685 1213 0 unless (utf8::is_utf8($v))
686 597 616 if ($v & ~$v) eq '0'
690 4 612 if ($maxlen and $maxlen < length($v) + 2)
701 2 26 unless defined $_[0]
705 12 14 unless my $evalret = eval { do { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x5d\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x05"} if ($sql_type == 4) { my $dummy = $_[0] + 0; return 1; } elsif ($sql_type == 8) { my $dummy = $_[0] + 0; return 1; } elsif ($sql_type == 2) { my $dummy = $_[0] + 0; return 1; } else { return -2; } } }
707 16 10 if ($sql_type == 4) { }
4 6 elsif ($sql_type == 8) { }
4 2 elsif ($sql_type == 2) { }
724 2 24 if defined $evalret and $evalret == -2
725 12 12 unless $evalret
729 12 12 if $cast_ok
730 6 6 if $flags & 1
744 15 213 unless defined $hash_ref
745 2 211 unless ref $hash_ref eq 'HASH'
749 5429 203 if length $string > 0
751 4412 1220 if ($use_neat) { }
755 865 355 defined $value ? :
764 50 161 unless (defined $num_sort)
767 40 4336 !looks_like_number($_) ? :
774 0 36257 unless $a <=> $b
54 157 $num_sort ? :
780 72297 879 unless defined $_[0]{'err'}
790 0 0 if $$key eq '*err'
791 0 0 if $$key eq '&errstr'
807 26 134 if defined $level and not DBI::looks_like_number($level)
810 20 140 if defined $file
811 116 44 if (defined $level)
813 78 38 if ($DBI::dbi_debug)
818 14 64 unless exists $ENV{'DBI_TRACE'}
829 641 3756 if defined $v
830 109 3647 if ($key =~ /^NAME_.c$/)
832 4 105 unless $cols
839 60 3587 if ($key =~ /^NAME.*_hash$/)
841 6 54 unless $h->FETCH('NAME')
849 3587 0 unless (defined $v or exists $h->{$key})
850 8 3579 if $key eq 'Taint'
851 1172 2407 if $is_flag_attribute{$key}
852 98 2309 if $key eq 'TraceLevel'
853 42 2267 if $key eq 'ChildHandles' and $HAS_WEAKEN
854 50 2217 if ($key eq 'Type')
855 0 50 if $h->isa('DBI::dr')
856 6 44 if $h->isa('DBI::db')
857 44 0 if $h->isa('DBI::st')
860 2 2215 if (not $is_valid_attribute{$key} and $key =~ /^[A-Z]/)
869 568 12948 if ($key eq 'AutoCommit') { }
24 12924 elsif ($key =~ /^Taint/) { }
94 12830 elsif ($key eq 'TraceLevel') { }
2110 10720 elsif ($key eq 'NUM_OF_FIELDS') { }
2 11843 elsif (not $is_valid_attribute{$key} and $key =~ /^[A-Z]/ and not exists $h->{$key}) { }
870 0 568 unless $value == -900 or $value == -901
875 0 24 if $value
884 1624 486 if ($value)
886 4 1620 if @$fbav != $value
894 7609 3703 $is_flag_attribute{$key} ? :
895 5 11307 if $key eq 'CachedKids'
900 2 2 unless $key =~ /^private_/
910 38 1111 if (my $hss = $h->{'HandleSetErr'})
911 2 36 if &$hss($h, $errnum, $msg, $state, $method)
914 800 347 unless (defined $errnum)
921 27 320 if ($h->{'errstr'}) { }
923 10 11 if $h->{'err'} and $errnum and $h->{'err'} ne $errnum
925 4 8 if $h->{'state'} and ($h->{'state'} ne 'S1000' and $state and $h->{'state'} ne $state)
926 25 2 if $h->{'errstr'} ne $msg
935 12 9 if ($errnum or not defined $h->{'err'} or defined $errnum and length $errnum > length $h->{'err'})
941 326 12 if $errnum
945 338 9 if ($err_changed)
946 326 12 if $DBI::err
947 2 326 $state eq '00000' ? :
328 10 if $state
951 201 146 if (my $p = $h->{'Database'})
962 2855 1578 unless defined $minlevel
963 4360 73 unless $minlevel <= ($DBI::dbi_debug & 15)
980 0 1 unless $dbh->{'Active'}
981 0 1 unless $dbh->{'ChildHandles'}
982 1 2 unless $sth
983 1 1 if $sth->{'Active'}
1021 0 0 unless my(@row) = $h->fetchrow_array
1031 0 4 unless my $row = $h->fetch
1038 2 24 unless my $row = $h->fetch
1065 1417 141 if ($fbav) { }
1072 182 1376 if (my $bc = $h->{'_bound_cols'}) { }
1075 432 42 $bound ? :
1087 6 156 if $col < 1 or $col > $num_of_fields
1089 2 154 unless defined $value_ref
1090 0 154 unless ref $value_ref eq 'SCALAR'
1104 0 3 unless defined $rows