Branch Coverage

blib/lib/DBIx/Class/Schema/Loader/RelBuilder.pm
Criterion Covered Total %
branch 119 146 81.5


line true false branch
152 5 139 if (defined $self->relationship_attrs)
153 2 3 unless ref $self->relationship_attrs eq "HASH" or ref $self->relationship_attrs eq "CODE"
165 0 902 if not defined $relname or $relname eq ""
170 404 498 if (ref $self->inflect_plural eq 'HASH') { }
0 498 elsif (ref $self->inflect_plural eq 'CODE') { }
171 6 398 if (exists $self->inflect_plural->{$relname})
178 0 0 if ($inflected)
184 6 896 if $mapped
193 0 740 if not defined $relname or $relname eq ""
198 297 443 if (ref $self->inflect_singular eq 'HASH') { }
0 443 elsif (ref $self->inflect_singular eq 'CODE') { }
199 6 291 if (exists $self->inflect_singular->{$relname})
206 0 0 if ($inflected)
212 6 734 if $mapped
265 136 1174 unless $self->_default_relationship_attrs->{$reltype}
266 0 1310 unless $db_attrs
269 544 2 unless $r->{'all'}
270 497 49 unless $r->{$reltype}
546 764 ref $r eq 'HASH' ? :
277 2 1308 if (ref $r eq "CODE")
280 0 2 unless &$r(%$params)
282 2 0 if %ret
285 1229 81 %composite ? :
305 366 228 if $nullable and not defined $attrs->{'join_type'}
336 546 49 if (scalar keys %{$cond;} == 1) { }
351 14 1370 if $relname eq "id"
355 14 1356 if ($self->loader->_is_result_class_method($relname, $table))
356 12 2 if (my $map = $self->rel_collision_map)
358 6 6 if (my(@matches) = $relname =~ /$re/)
388 146 841 unless shift @tables
393 0 653 unless $rel->{'remote_source'}
399 0 653 unless my $remote_moniker = $rel->{'remote_source'}
407 0 653 if ($local_cols->$#* != $remote_cols->$#*)
503 16 721 if $dups
518 619 118 unless @rels == 2
522 111 118 $this ? :
537 301 195 if $_->{'method'} eq "has_many" and $_->{'args'}[1] eq $link_class
540 7 222 unless $class{'link_table_rel'}
564 79 32 unless &array_eq([sort(&uniq(@{$class[0]{"from_link_cols"};}, @{$class[1]{"from_link_cols"};}))], [sort(@link_table_primary_cols)]) and $self->allow_extra_m2m_cols || @link_table_cols == @link_table_primary_cols
569 32 32 $this ? :
589 32 32 $this ? :
632 735 18 unless %dups
640 2 12 unless $self->__tagger
665 0 0 $self->loader->naming->{'force_ascii'} ? :
683 0 16 if ($tables[0]->can('database') and &uniq(map(($_->database || ''), @tables)) > 1) { }
0 16 elsif (&uniq(map(($_->schema || ''), @tables)) > 1) { }
696 0 0 $use_schema ? :
713 18 14 if $rel->{'method'} =~ /^(?:belongs_to|many_to_many)\z/
725 7 7 if (not @adjectives and grep({$_->{'args'}[1] eq $to_class if $_->{'method'} eq "might_have";} @{$$all_code{$in_class};}) == 1)
727 7 14 if $_->{'method'} eq "might_have"
732 14 0 if (@adjectives)
735 14 0 $rel->{'method'} eq 'might_have' ? :
758 2 14 if ($dups = $self->_duplicates($all_code->{$in_class}))
773 2 0 $rel->{'method'} =~ /^(?:many_to_many|has_many)\z/ ? :
790 2 0 if ($rel->{'method'} eq 'many_to_many') { }
817 0 2 unless $mapped
851 70 518 if (&array_eq([$local_source->primary_columns], $local_cols) or &first(sub { &array_eq($_->[1], $local_cols); } , @$uniqs))
859 188 400 if ($counters->{$remote_moniker} > 1)
862 115 73 if (-f (my $existing_remote_file = $self->loader->get_dump_filename($remote_class)))
865 50 65 unless ("Class::Inspector"->loaded($class))
873 0 50 if $@
878 5 110 if ($class->has_relationship($remote_relname))
882 5 0 if &array_eq([sort(@$local_cols)], $rel_cols)
886 183 5 unless ($relationship_exists)
888 28 155 if keys %$cond > 1
896 2 181 if ($remote_method eq "might_have")
910 1321 64 unless $extra
930 18 1369 if ('HASH' eq ref $map) { }
15 1354 elsif ('CODE' eq ref $map) { }
933 3 15 if ($map->{$moniker} and 'HASH' eq ref $map->{$moniker} and $map->{$moniker}{$name}) { }
3 24 elsif ($map->{$name} and not 'HASH' eq ref $map->{$name}) { }
947 1 2 unless "HASH" eq ref $cb_map
953 6 8 if ($name)