Branch Coverage

blib/lib/DBIx/SearchBuilder/Record.pm
Criterion Covered Total %
branch 121 164 73.7


line true false branch
421 22 20 if ($self->_Accessible($Attrib, 'read')) { }
1 19 elsif ($self->_Accessible($Attrib, 'record-read')) { }
1 18 elsif ($self->_Accessible($Attrib, 'foreign-collection')) { }
9 9 elsif ($DBIx::SearchBuilder::Record::AUTOLOAD =~ /.*::[sS]et_?(\w+)/o) { }
2 7 elsif ($DBIx::SearchBuilder::Record::AUTOLOAD =~ /.*::(\w+?)_?[oO]bj$/o) { }
6 1 elsif ($DBIx::SearchBuilder::Record::AUTOLOAD =~ /.*::[vV]alidate_?(\w+)/o) { }
436 6 3 if ($self->_Accessible($Attrib, 'write')) { }
1 2 elsif ($self->_Accessible($Attrib, 'record-write')) { }
1 1 elsif ($self->_Accessible($Attrib, 'read')) { }
446 1 1 if UNIVERSAL::isa($val, "DBIx::SearchBuilder::Record")
461 1 1 if ($self->_Accessible($Attrib, 'object')) { }
515 1866 338 unless defined $attribute
536 0 1634 unless ref $pkeys eq "ARRAY" and $pkeys->[0]
537 0 1634 unless scalar @$pkeys == 1
565 53 0 if $self->can("Schema")
589 53 51 if ($schema->{$field}{'TYPE'}) { }
51 0 elsif (my $refclass = $schema->{$field}{'REFERENCES'}) { }
592 40 11 if (UNIVERSAL::isa($refclass, 'DBIx::SearchBuilder::Record')) { }
11 0 elsif (UNIVERSAL::isa($refclass, 'DBIx::SearchBuilder')) { }
593 0 40 if ($field =~ /(.*)_id$/) { }
616 0 3 unless defined $value
621 0 3 unless $description
623 0 3 unless $description
625 0 3 unless $description->{'REFERENCES'}
629 0 3 unless UNIVERSAL::isa($classname, "DBIx::SearchBuilder::Record")
641 0 2 unless defined $method_name
645 0 2 unless $description
649 0 2 unless UNIVERSAL::isa($classname, "DBIx::SearchBuilder")
669 0 5 unless $ca->{$_}{'read'}
684 1 4 unless $ca->{$_}{'write'}
712 1804 3 if $self->{'fetched'}{$field}
716 0 3 if grep((!defined($_)), values %pk)
720 1 2 unless my $sth = $self->_Handle->SimpleQuery($query, sorted_values(%pk))
771 1 25 unless ($args{'Column'})
783 0 8 if (not defined $args{'Value'} and $self->{'no_undefs_in_set'})
793 17 8 if (defined $args{'Value'}) { }
794 3 1 if ($args{'Value'} eq "" and $self->_Accessible($args{'Column'}, 'is_numeric') || ($self->_Accessible($args{'Column'}, 'type') || '') =~ /INT/i)
802 4 4 if ($self->_Accessible($args{"Column"}, "no_nulls"))
805 2 2 if (defined $default) { }
825 3 17 if (not defined $args{'Value'} || defined $current_value or defined $args{'Value'} and defined $current_value and $args{'Value'} eq $current_value)
842 1 19 unless ($self->$method($args{"Value"}))
859 0 19 unless ($self->_Handle->KnowsBLOBs)
863 0 0 if (($ca->{$key}{'type'} // "") =~ /^(text|longtext|clob|longblob|blob|lob)$/i)
865 0 0 if (ref $bhash eq "HASH" and defined $args{'Value'} && length $args{'Value'} || $self->_Handle->HasSupportForEmptyString)
876 0 19 unless ($val)
880 0 0 defined $args{'Value'} ? :
892 0 19 if ($args{'IsSQLFunction'}) { }
991 18 261 unless defined $value
994 1 260 unless $metadata
997 4 256 if ($metadata->{'length'} and not $metadata->{'is_numeric'}) { }
137 130 elsif ($metadata->{'type'} and $metadata->{'type'} =~ /char\((\d+)\)/) { }
1003 119 141 unless $truncate_to
1006 136 5 if $truncate_to >= do { use bytes; length $value }
1008 0 5 if (&Encode::is_utf8($value)) { }
1055 0 1 unless ($vglob and *$vglob{"SCALAR"})
1057 0 0 if $@
1058 0 0 unless ($vglob and *$vglob{"SCALAR"})
1125 59 2 if (defined $hash{$key} and $hash{$key} ne '') { }
1129 1 58 if (ref $hash{$key} eq 'HASH') { }
1146 1 1 if ($meta->{'is_numeric'} or $meta->{'type'} =~ /INT|NUMERIC|DECIMAL|REAL|DOUBLE|FLOAT/i) { }
1171 54 1 defined $id ? :
1187 1 2 ref $_[0] eq 'HASH' ? :
1191 1 2 unless defined $data->{$_}
1241 1 62 unless $sth
1245 0 62 if (not $self->{'values'} and $sth->err)
1249 3 59 unless ($self->{'values'})
1256 1 58 if (grep {not defined $_;} $self->PrimaryKeys)
1287 3 252 if ($self->_Accessible($key, "record-write"))
1289 1 2 if UNIVERSAL::isa($attribs{$key}, "DBIx::SearchBuilder::Record")
1293 240 15 if (defined $attribs{$key}) { }
1294 1 1 if ($attribs{$key} eq "" and $self->_Accessible($key, 'is_numeric') || ($self->_Accessible($key, 'type') || '') =~ /INT/i)
1302 1 14 if $self->_Accessible($key, "no_nulls")
1310 0 155 unless ($self->_Handle->KnowsBLOBs)
1316 0 0 unless $type and $type =~ /^(text|longtext|clob|blob|lob|longblob)$/i
1319 0 0 if (ref $bhash eq "HASH" and defined $attribs{$key} && length $attribs{$key} || $self->_Handle->HasSupportForEmptyString)
1362 0 2 if (UNIVERSAL::isa($return, 'Class::ReturnValue')) { }
1383 1453 218 if (@_)
1398 64 0 unless ($name)
1399 5 59 if defined $self->{'_quoted_table'}
1400 0 59 $self->_Handle->QuoteTableNames ? :
1404 0 0 $self->_Handle->QuoteTableNames ? :
1416 1487 481 if (@_)