Branch Coverage

blib/lib/Class/DBI/Sweet.pm
Criterion Covered Total %
branch 64 164 39.0


line true false branch
14 57 0 unless ($@)
66 1 2 $o_by =~ /(.*)\.(.*)/ ? :
72 0 3 $is_desc ? :
77 3 0 wantarray ? :
92 0 1 $o_by =~ /(.*)\.(.*)/ ? :
98 0 1 $is_desc ? :
100 0 1 $is_desc ? :
104 1 0 wantarray ? :
112 0 6 unless (@_)
150 2 1 unless ($$attributes{'disable_sql_paging'})
169 0 0 unless (@_ or keys %{$class->default_search_attributes;})
173 0 0 @_ > 1 ? :
199 15 0 unless $$attributes{'prefetch'}
200 0 0 unless ($class->meta_info('has_a', $pre) or $class->meta_info('might_have', $pre))
212 0 15 if ($class->cache and $$attributes{'use_resultset_cache'})
225 0 0 if ($cache_key)
227 0 0 if ($cache_entry = $class->_live_resultset_cache->{$cache_key})
229 0 0 if ($$cache_entry{'created'} <= ($latest_stale || 0)) { }
253 0 0 if (not defined $cache_entry and $cache_entry = $class->cache->get($cache_key))
257 0 0 if ($$cache_entry{'created'} <= ($latest_stale || 0)) { }
270 0 0 if ($cache_entry)
273 0 0 if $$attributes{'profile_cache'}
279 0 0 if wantarray
283 0 0 if $$attributes{'profile_cache'}
292 0 15 if ($$attributes{'prefetch'})
320 15 30 if ($part eq 'sql')
325 30 0 if (exists $$sql_parts{$part})
338 0 15 if ($class->cache and $$attributes{'use_resultset_cache'})
351 12 3 if wantarray
359 1 14 if (exists $$attributes{'_pager'} and not $$attributes{'_pager'})
369 1 14 if ($$attributes{'rows'} and $iterator->count > $$attributes{'rows'})
406 3 19 unless ($sql =~ /^\s*WHERE/i)
420 7 15 if $$attributes{'order_by'}
423 6 16 if ($$attributes{'rows'} and not $$attributes{'disable_sql_paging'})
429 0 6 if ($driver =~ /^(maxdb|mysql|mysqlpp)$/) { }
6 0 elsif ($driver =~ /^(pg|pgpp|sqlite|sqlite2)$/) { }
0 0 elsif ($driver =~ /^(interbase)$/) { }
456 13 11 if (@_ == 2 and ref($_[0]) =~ /^(ARRAY|HASH)$/ and ref $_[1] eq 'HASH') { }
8 3 elsif (@_ == 1 and ref($_[0]) =~ /^(ARRAY|HASH)$/) { }
468 0 3 @_ % 2 ? :
493 0 0 if (@_) { }
494 0 0 if (@_ == 1 and ref $_[0] eq 'HASH') { }
0 0 elsif (@_ == 1) { }
508 0 0 unless (@primary_columns == grep(defined($_), @{$data;}{@primary_columns}))
518 0 0 if ref $class
520 0 0 unless $prefetch
524 0 0 unless $values
530 0 0 if ref $class
540 40 0 unless ($class->cache or $$data{'sweet__joins'})
548 0 0 if ($class->cache and $key and $object = $class->cache->get($key))
549 0 0 if $class->default_search_attributes->{'profile_cache'}
553 0 0 if ((caller 1)[3] eq 'Class::DBI::_simple_bless')
560 0 0 if $class->default_search_attributes->{'profile_cache'}
565 0 0 if (my $joins = $$data{'sweet__joins'})
571 0 0 if ($rel = $$meta{'has_a'}{$join}) { }
0 0 elsif ($rel = $$meta{'might_have'}{$join}) { }
593 0 0 if ($class->cache and $key)
604 0 5 if ($class->cache)
606 0 0 if (my $key = $class->cache_key(@_))
608 0 0 if (my $object = $class->cache->get($key))
611 0 0 if $class->default_search_attributes->{'profile_cache'}
618 0 0 if $class->default_search_attributes->{'profile_cache'}
632 0 6 if ($self->cache)
642 0 1 if ($self->cache)
653 0 0 unless ref $self
655 0 0 if ($self->cache)
670 1 0 if (lc $self->sequence eq 'uuid')
672 0 1 unless $UUID_Is_Available
674 0 1 if ($^O eq 'MSWin32') { }
702 22 0 unless $must_join
710 22 0 if (@ret)
712 19 3 if $wh
737 22 0 wantarray ? :
743 24 24 if $to_convert eq '?'
758 12 11 unless $$self{'cdbi_table_aliases'}{$f_alias}
763 0 49 if (my $meta = $$self{'cdbi_class'}->meta_info('has_many', $field))
766 0 0 unless $$self{'cdbi_table_aliases'}{$f_alias}
781 2 10 if ($rel = $$meta{'has_a'}{$f_alias}) { }
6 4 elsif ($rel = $$meta{'has_many'}{$f_alias}) { }
4 0 elsif ($rel = $$meta{'might_have'}{$f_alias}) { }
820 22 2 unless ($column)
829 2 22 if (ref $val eq $f_class)