Branch Coverage

blib/lib/Jifty/DBI/Record.pm
Criterion Covered Total %
branch 193 270 71.4


line true false branch
63 0 367 unless $self->COLUMNS
66 0 367 if (scalar @_ == 1) { }
81 353 14 if ($args{'handle'})
90 42 5 if ($class->isa('Jifty::DBI::Record') and defined $flag and $flag eq '-base')
92 8 34 unless ($descendant->isa($class))
100 42 0 if $callback
152 2 2 unless $col and $col->can($attribute)
172 0 133 unless ref $pkeys eq 'ARRAY' and $$pkeys[0]
173 0 133 unless scalar @$pkeys == 1
186 1 41 if defined $self->COLUMNS
212 0 42 unless $self->COLUMNS
253 12 183 $column->aliased_as ? :
259 102 93 unless $column->record_class
262 0 1 if (grep {$_ eq 'Jifty::DBI::Filter::Storable';} $column->input_filters, $column->output_filters and not grep({$_ eq 'Jifty::DBI::Filter::base64';} $column->input_filters, $column->output_filters) and not $column->type =~ /^(blob|bytea)$/i)
274 101 94 unless ($self->can($column_name))
278 2 99 if ($column->computed) { }
99 0 elsif ($column->active) { }
285 99 0 if ($column->readable) { }
286 6 93 if (UNIVERSAL::isa($column->refers_to, 'Jifty::DBI::Record')) { }
2 91 elsif (UNIVERSAL::isa($column->refers_to, 'Jifty::DBI::Collection')) { }
292 0 25 if (@_ > 1)
314 0 231 if (@_ > 1)
337 142 53 if (not $self->can('set_' . $column_name))
341 142 0 if ($column->active) { }
342 101 41 if ($column->writable) { }
343 6 95 if (UNIVERSAL::isa($column->refers_to, 'Jifty::DBI::Record')) { }
2 93 elsif (UNIVERSAL::isa($column->refers_to, 'Jifty::DBI::Collection')) { }
352 2 2 if (UNIVERSAL::isa($val, 'Jifty::DBI::Record'))
354 2 0 defined $col->by ? :
454 3 22 if not defined $value and $self->null_reference
455 0 22 unless $classname
456 0 22 unless UNIVERSAL::isa($classname, 'Jifty::DBI::Record')
458 1 21 if (my $prefetched = $self->prefetched($column_name))
463 19 2 if defined $value
479 0 7 unless $classname
480 0 7 unless UNIVERSAL::isa($classname, 'Jifty::DBI::Collection')
482 4 3 if (my $prefetched = $self->prefetched($column_name))
487 3 0 if $column->by and $self->id
507 10 29 if (@_) { }
509 0 10 if ($column and not $column->refers_to) { }
0 10 elsif ($column and not UNIVERSAL::isa($_[0], $column->refers_to)) { }
534 47 0 unless exists $self->COLUMNS->{$name}
559 9 679 unless $col and exists $$col{$name}
576 44 453 unless $self->_COLUMNS_CACHE
593 0 240 unless (($b->type || '') eq 'serial') <=> (($a->type || '') eq 'serial') or ($a->sort_order || 0) <=> ($b->sort_order || 0)
622 3 3 unless $is_primary{$b->name} <=> $is_primary{$a->name}
626 1 1 unless $self->_READABLE_COLS_CACHE
673 1 0 unless $self->_WRITABLE_COLS_CACHE
797 6 4 if $$self{'fetched'}{$column_name}
800 3 1 if (not $$self{'fetched'}{$column_name} and my $id = $self->id)
827 0 0 unless $column_name
842 2 374 unless $column
846 0 374 if ($column->computed)
852 159 215 if $$self{'fetched'}{$column_name} and $$self{'decoded'}{$column_name}
856 4 211 unless ($$self{'fetched'}{$column_name})
862 215 0 unless ($$self{'decoded'}{$column_name})
863 215 0 if exists $$self{'values'}{$column_name}
909 0 61 unless defined $ok
916 0 61 unless defined $ok
922 3 58 unless $ok
955 1 60 unless ($column)
966 60 0 unless ($args{'is_sql_function'})
976 60 0 if ($$self{'fetched'}{$column->name} or not $$self{'decoded'}{$column->name})
979 2 32 if (not defined $args{'value'} || defined $$self{'values'}{$column->name} or defined $args{'value'} and defined $$self{'values'}{$column->name} and $args{'value'} . '' eq '' . $$self{'values'}{$column->name})
998 4 54 if (my $sub = $column->validator)
1000 1 3 unless ($ok)
1012 1 56 if ($column->distinct)
1014 1 0 unless $ret
1021 5 51 if ($column->type =~ /^(text|longtext|clob|blob|lob|bytea)$/i)
1035 0 56 unless ($val)
1050 0 56 if ($args{'is_sql_function'}) { }
1074 1 67 unless @_ and defined $_[0]
1075 0 67 if @_ > 1
1106 120 2 if (ref $class) { }
1114 120 4 if (defined $hash{$key} and $hash{$key} ne '') { }
2 2 elsif (not defined $hash{$key}) { }
1119 0 120 unless defined $column_obj
1123 3 117 if (ref $hash{$key} eq 'HASH') { }
1127 1 2 if exists $hash{$key}{'case_sensitive'}
1134 1 119 if (blessed $value and $value->isa('Jifty::DBI::Record'))
1135 1 0 defined $column_obj->by ? :
1140 12 108 if $column_obj->encode_on_select
1146 112 8 if ($self->_handle->case_sensitive and $value)
1147 21 91 if ($column_obj->is_string and not $case_sensitive)
1154 0 120 if ($column_obj and $column_obj->no_placeholder and $function eq '?') { }
1167 1 1 if ($column->is_numeric) { }
1181 2 120 if ($class) { }
1198 1 2 ref $_[0] eq 'HASH' ? :
1202 1 2 unless defined $$data{$_}
1219 158 0 if ($args{'fast'})
1229 0 0 unless (ref $self)
1262 1 125 unless $sth
1272 48 473 unless exists $$hashref{lc $col}
1277 0 125 if (not $$self{'values'} and $sth->err)
1281 6 119 unless ($$self{'values'})
1288 1 118 if (grep {not defined $_;} $self->primary_keys)
1368 105 1 if (ref $class) { }
1377 0 106 unless defined $ok
1385 0 106 unless defined $ok
1387 1 105 if ($class) { }
1400 0 172 unless ($column)
1404 0 0 if $column_name =~ /^__/
1408 4 10 if ($column->readable and $column->refers_to and UNIVERSAL::isa($column->refers_to, 'Jifty::DBI::Record') and UNIVERSAL::isa($attribs{$column_name}, 'Jifty::DBI::Record'))
1414 4 0 defined $column->by ? :
1424 4 168 if ($column->distinct)
1427 1 3 unless ($ret)
1435 8 163 if ($column->type =~ /^(text|longtext|clob|blob|lob|bytea)$/i)
1444 75 152 if (not defined $attribs{$column->name} and defined $column->default and not ref $column->default)
1449 0 75 if UNIVERSAL::isa($default, 'Jifty::DBI::Record')
1460 1 151 if (not defined $attribs{$column->name} and $column->mandatory and $column->type ne 'serial')
1467 0 1 unless ($column->active)
1510 0 3 unless defined $before_ret
1515 0 3 unless defined $after_ret
1530 0 3 if (UNIVERSAL::isa('Class::ReturnValue', $return)) { }
1553 38 645 unless $self->TABLE_NAME
1587 36 2 ref $self ? :
1588 0 38 unless $class =~ /(?:\:\:)?(\w+)$/
1606 365 1875 if (@_)
1622 337 215 if ($args{'direction'} eq 'input') { }
1650 215 337 $args{'direction'} eq 'output' ? :
1652 45 772 if (not exists $cache{$filter_class}) { }
0 772 elsif (not $cache{$filter_class}) { }
1655 0 45 if ($UNIVERSAL::require::ERROR)
1698 2 3 if ($record->id) { }
1732 0 0 unless defined $ret
1734 0 0 exists $$value_ref[-1][0] ? :
1750 0 0 if ($self->can($method)) { }
0 0 elsif (my(@sighs) = Class::Trigger::__fetch_all_triggers($self, $method)) { }
1784 0 0 if (defined $ret) { }
1802 0 0 if ($self->can($method)) { }
0 0 elsif (my(@sighs) = Class::Trigger::__fetch_all_triggers($self, $method)) { }
1825 0 795 if (my $func = $self->can($method))
1827 0 0 wantarray ? :
0 0 if $args{'short_circuit'} and not $results[0]
1833 0 795 wantarray ? :