Branch Coverage

blib/lib/Rose/DB/Object/ConventionManager.pm
Criterion Covered Total %
branch 68 180 37.7


line true false branch
69 0 67 if $self->force_lowercase
70 55 12 unless $plural
82 0 7 if $self->force_lowercase
84 0 7 $self->tables_are_singular ? :
123 0 0 if ($self->tables_are_singular)
137 0 0 if ($self->tables_are_singular)
149 1 88 if ($self->tables_are_singular) { }
166 65 12 if $meta->column('id')
170 1 11 if $meta->column($column)
175 11 1 if $column->type =~ /^(?:big)?serial$/
179 0 0 if (my $column = $meta->first_column)
190 0 184 if $self->force_lowercase
201 0 110 if (my $code = $self->singular_to_plural_function)
206 9 101 if ($word =~ /(?:x|[se]s)$/i) { }
215 6 95 $word =~ /s$/i ? :
222 0 62 if (my $code = $self->plural_to_singular_function)
229 1 61 if $word =~ s/ses$/s/i
230 1 60 if $word =~ /[aeiouy]ss$/i
241 0 0 if 'Rose::DB::Object'->can($name)
253 0 0 if $name eq $method
265 0 0 if $name eq $method
277 0 0 if $name eq $method
288 0 0 if $db and $db->likes_uppercase_sequence_names
289 0 0 if $db and $db->likes_lowercase_sequence_names
299 0 0 if ($self->force_lowercase)
305 0 0 unless my $f_meta = $f_class->meta
308 0 0 if (keys %$key_columns == 1)
314 0 0 if ($local_column =~ s/_$foreign_column$//i) { }
325 0 0 if ($self->method_name_conflicts($name) or $used_names->{$name})
330 0 0 unless ($self->method_name_conflicts($name . $s) or $$used_names{$name . $s})
352 0 0 if $self->force_lowercase
353 0 0 $self->tables_are_singular ? :
365 0 0 $self->force_lowercase ? :
376 0 0 if ($self->method_name_conflicts($name))
381 0 0 unless ($self->method_name_conflicts($name . $s))
404 0 0 if ($self->method_name_conflicts($name))
409 0 0 unless ($self->method_name_conflicts($name . $s))
430 0 0 if $self->force_lowercase
435 0 0 if ($self->method_name_conflicts($name))
440 0 0 unless ($self->method_name_conflicts($name . $s))
461 0 0 unless UNIVERSAL::isa($class, 'Rose::DB::Object')
466 0 0 if $is_map_table and !defined($is_map_class) || $is_map_class
474 0 0 unless (UNIVERSAL::isa($class, 'Rose::DB::Object'))
482 0 0 if @fks == 2
483 0 0 if $meta->is_initialized || $meta->initialized_foreign_keys and not $meta->has_deferred_foreign_keys
492 0 0 if ($table =~ /^(?:
512 27 5 unless ($spec->{'class'})
522 0 27 unless (UNIVERSAL::isa($fk_class, 'Rose::DB::Object'))
526 0 0 if $@ or not UNIVERSAL::isa($fk_class, 'Rose::DB::Object')
535 27 5 unless (defined $spec->{'key_columns'})
538 27 0 UNIVERSAL::isa($spec->{'class'}, 'Rose::DB::Object') ? :
541 0 27 unless (@fpk_columns == 1)
544 0 0 if @fpk_columns
548 0 0 if (UNIVERSAL::isa($spec->{'class'}, 'Rose::DB::Object') and $spec->{'class'}->meta->is_initialized)
564 0 0 unless my $new_fk = $self->auto_foreign_key($name, \%spec)
566 0 0 unless my $key_cols = $new_fk->key_columns
573 0 0 unless my $fk = $meta->foreign_key($name)
577 0 0 if (UNIVERSAL::isa($fk->class, 'Rose::DB::Object') and $fk->class->meta->is_initialized)
584 0 0 unless my $cols = $fk->key_columns
587 0 0 ref $cols && keys %$cols > 0 ? :
596 0 27 if ($meta->column($name) and $aliases->{$name} and $aliases->{$name} ne $name) { }
27 0 elsif ($meta->column("${name}_$fpk_columns[0]")) { }
619 30 3 unless ($spec->{'class'})
621 3 27 if ($rel_type eq 'one to many') { }
6 21 elsif ($rel_type =~ /^(?:one|many) to one$/) { }
633 0 3 unless (UNIVERSAL::isa($f_class, 'Rose::DB::Object'))
637 0 0 if $@ or not UNIVERSAL::isa($f_class, 'Rose::DB::Object')
656 0 6 unless (UNIVERSAL::isa($f_class, 'Rose::DB::Object'))
660 0 0 if $@ or not UNIVERSAL::isa($f_class, 'Rose::DB::Object')
671 21 12 unless (UNIVERSAL::isa($spec->{'class'}, 'Rose::DB::Object'))
675 0 21 unless $rel_type eq 'many to many'
678 4 29 if ($rel_type eq 'one to one') { }
4 25 elsif ($rel_type eq 'many to one') { }
4 21 elsif ($rel_type eq 'one to many') { }
21 0 elsif ($rel_type eq 'many to many') { }
706 6 2 unless (defined $spec->{'column_map'})
709 0 6 unless @fpk_columns == 1
713 0 6 if ($meta->column($name) and $aliases->{$name} and $aliases->{$name} ne $name) { }
6 0 elsif ($meta->column("${name}_$fpk_columns[0]")) { }
0 0 elsif ($meta->column("${name}_id")) { }
742 3 1 unless (defined $spec->{'column_map'})
745 0 3 unless @pk_columns == 1
748 0 3 unless @fpk_columns == 1
754 0 3 if ($f_meta->column($l_col_name)) { }
3 0 elsif ($f_meta->column("${l_col_name}_$pk_columns[0]")) { }
776 12 9 unless ($spec->{'map_class'})
837 12 66 if (UNIVERSAL::isa($class, 'Rose::DB::Object')) { }
847 0 66 unless ($@)
850 0 0 if UNIVERSAL::isa($class, 'Rose::DB::Object')
856 0 12 unless $map_class and UNIVERSAL::isa($map_class, 'Rose::DB::Object')