Branch Coverage

blib/lib/Class/DBI.pm
Criterion Covered Total %
branch 40 220 18.1


line true false branch
32 0 4 if ($@)
44 0 0 unless $self
46 0 0 unless @cols
196 0 0 unless $Per_DB_Attr_Defaults{lc $class->__driver}
218 5 1 if $table
219 0 6 if $alias
226 0 1 if $alias
234 15 19 if @_
235 10 9 if $group eq 'All'
236 4 5 if $group eq 'Primary'
237 4 1 if $group eq 'Essential'
246 1 31 ref $_ ? :
259 0 0 unless my $class = ref $self
266 0 0 if wantarray
267 0 0 if @pk_values > 1
276 12 2 if wantarray
277 0 2 if @primary_columns > 1
340 25 7 if ($acc eq $mut or $mut eq $default_accessor) { }
367 78 102 if defined &{"${class}::$name";}
368 0 102 if 'Class::DBI'->can($name) and not $name eq 'id' && join(' ', $class->primary_columns) eq 'id'
378 0 32 if ($class->can('accessor_name'))
387 0 25 if ($class->can('mutator_name'))
396 0 0 ref $proto ? :
402 0 0 if defined $set
403 0 0 defined $$self{'__AutoCommit'} ? :
410 0 0 if defined $set
423 0 0 ref $_[0] eq 'HASH' ? :
425 0 0 defined $exists ? :
430 0 0 unless ref $_[0] eq 'HASH'
461 0 0 @_ == 1 ? :
470 0 0 @_ == 1 ? :
508 0 0 if ($key and $Class::DBI::Weaken_Is_Available)
512 0 0 if ++$Init_Count % $class->purge_object_index_every == 0
524 0 0 unless @primary == grep(defined($$data{$_}), @primary)
549 0 0 if @primary_columns > 1
553 0 0 if $self->sequence
565 0 0 if $self->_undefined_primary
570 0 0 $class->has_real_column($col) ? :
576 0 0 if @primary_columns == 1
609 0 0 unless my $id = $dbh->last_insert_id(undef, undef, $self->table, undef) || $$dbh{'mysql_insertid'} || eval { do { $dbh->func('last_insert_rowid') } }
626 0 0 if @primary_columns == 1 and not defined $$data{$primary_columns[0]}
630 0 0 if ($@)
643 0 0 unless my $datatype = $class->__data_type
645 0 0 if (my $type = $$datatype{$$keys[$i]})
653 1 0 unless my(@primary_columns) = $class->primary_columns
657 0 0 if (@_ == 1 and @primary_columns == 1) { }
659 0 0 unless defined $id
660 0 0 if ref $id
664 0 0 if keys %key_value < @primary_columns
670 0 0 if @rows > 1
684 0 0 if (@_)
686 0 0 unless (ref $arg)
687 0 0 unless @primary_columns == 1
725 0 0 unless $class->isa(ref $old_obj) or $old_obj->isa($class)
733 0 0 unless ref $self
738 0 0 if ($@)
772 0 0 unless my $class = ref $self
776 0 0 unless my(@changed_cols) = $self->is_changed
782 0 0 if ($@)
816 0 0 if (my(@changed) = $self->is_changed)
825 0 0 if $self->autoupdate
839 0 0 unless ref $self
842 0 0 unless @cols
844 0 0 if (my(@fetch_cols) = grep((!$self->_attribute_exists($_)), @cols))
854 0 0 if (my(@want) = grep((!$self->_attribute_exists($_)), $self->__grouper->columns_in(@real)))
875 0 0 unless my $col = $self->find_column($column)
881 0 0 if ($@)
887 0 0 if $self->autoupdate
919 0 0 if $@
921 0 0 unless @errors
934 24 12 if $sql =~ /select/i
941 0 24 if defined &{"${class}::$method";}
960 0 0 unless my $col = $class->find_column(shift())
962 0 0 unless my $how = shift()
964 0 0 if (ref $how eq 'ARRAY') { }
0 0 elsif (ref $how eq 'Regexp') { }
0 0 elsif (ref $how eq 'CODE') { }
974 0 0 if (my $dispatch = $class->can($try_method)) { }
984 0 0 if ref $class
985 0 0 unless my $name = shift()
986 0 0 unless my $column = $class->find_column(shift())
988 0 0 unless my $code = shift()
990 0 0 unless ref $code eq 'CODE'
997 0 0 unless &$code($value, $self, $column, $column_values)
1014 0 14 if $name eq 'on_setting'
1016 0 14 if $name eq 'create' or $name eq 'delete'
1048 1 3 unless $type
1049 3 0 unless $subtype
1060 0 0 if ref $self
1061 0 0 unless ref $val
1062 0 0 unless my $meta = $self->meta_info('has_a', $col)
1064 0 0 if (my $deflate = $meths{'deflate'})
1065 0 0 ref $deflate eq 'CODE' ? :
1066 0 0 unless ref $val
1068 0 0 unless UNIVERSAL::isa($val, $a_class)
1070 0 0 if UNIVERSAL::isa($val, 'Class::DBI')
1090 0 4 unless $class->can('run_search')
1119 0 0 unless $method
1122 0 0 if *$meth{'CODE'}
1132 0 0 unless $sth
1133 0 0 unless (UNIVERSAL::isa($sth, 'DBI::st'))
1139 0 0 unless $$sth{'Active'}
1143 0 0 if $@
1158 0 0 unless defined wantarray
1159 0 0 if wantarray
1208 2 3 unless $class->$struct
1221 4 19 if exists ${"${load_class}::";}{'ISA'}
1223 19 0 if eval { do { require "$load_module.pm" } }
1226 0 0 if $@ =~ /^Can't locate \Q$load_module\E\.pm /
1240 0 0 if $load_class->isa('Class::DBI')