Branch Coverage

blib/lib/Alzabo/MethodMaker.pm
Criterion Covered Total %
branch 0 192 0.0


line true false branch
44 0 0 unless exists $p{'schema'}
45 0 0 if exists $p{$_}
0 0 unless grep {$p{$_} if exists $p{$_};} 'all', @options
57 0 0 if (delete $p{'all'})
61 0 0 unless exists $p{$_} and not $p{$_}
68 0 0 if ($p{'class_root'}) { }
78 0 0 unless $class_root
84 0 0 unless ref $p{'name_maker'}
126 0 0 if ($$self{'opts'}{'tables'})
134 0 0 if ($$self{'opts'}{'table_columns'})
139 0 0 if ($$self{'opts'}{'row_columns'})
143 0 0 if (grep {$$self{'opts'}{$_};} 'foreign_keys', 'linking_tables', 'lookup_columns')
150 0 0 if ($$self{'opts'}{"${_}_hooks"})
168 0 0 if $@
184 0 0 if $@
201 0 0 if $@
214 0 0 unless my $name = $self->_make_method('type', 'table', 'class', $$self{'schema_class'}, 'returns', 'table object', 'code', sub { return $t; } , 'table', $t)
232 0 0 if $@ and not $@ =~ /^Can\'t locate .* in \@INC/
253 0 0 unless my $name = $self->_make_method('type', 'table_column', 'class', $$self{'table_class'}, 'returns', 'column_object', 'code', sub { return $_[0]->column($col_name); } , 'column', $c)
279 0 0 if (@_)
284 0 0 unless my $name = $self->_make_method('type', 'row_column', 'class', $$self{'row_class'}, 'returns', 'scalar value/takes new value', 'code', sub { my $self = shift(); if (@_) { $self->update($col_name, $_[0]); } ; return $self->select($col_name); } , 'column', $c)
305 0 0 unless my(@fk) = $t->foreign_keys_by_table($other_t)
308 0 0 if (@fk == 2 and $fk[0]->table_from eq $fk[0]->table_to and $fk[1]->table_from eq $fk[1]->table_to)
311 0 0 unless ($fk[0]->is_one_to_one)
313 0 0 if $$self{'opts'}{'self_relations'}
342 0 0 unless my $name = $$self{'opts'}{'name_maker'}(%p)
348 0 0 if ($p{'class'}->can($name))
355 0 0 if (defined &$code_name)
386 0 0 if $$self{'opts'}{'linking_tables'}
389 0 0 if $$self{'opts'}{'lookup_columns'}
392 0 0 unless $$self{'opts'}{'foreign_keys'}
394 0 0 if ($fk->is_one_to_many) { }
402 0 0 unless my $name = $self->_make_method('type', 'foreign_key', 'class', $$self{'row_class'}, 'returns', 'row cursor', 'code', sub { my $self = shift(); return $self->rows_by_foreign_key('foreign_key', $fk, @_); } , 'foreign_key', $fk, 'plural', 1)
424 0 0 unless my $name = $self->_make_method('type', 'foreign_key', 'class', $$self{'row_class'}, 'returns', 'single row', 'code', sub { my $self = shift(); return $self->rows_by_foreign_key('foreign_key', $fk, @_); } , 'foreign_key', $fk, 'plural', 0)
445 0 0 if ($fk->is_one_to_many) { }
465 0 0 unless my $name = $self->_make_method('type', 'self_relation', 'class', $$self{'row_class'}, 'returns', 'single row', 'code', sub { my $self = shift(); my(@where) = map({[$$_[0], '=', $self->select($$_[1])];} @pairs); return $table->one_row('where', \@where, @_); } , 'foreign_key', $fk, 'parent', 1)
469 0 0 if ($name)
489 0 0 if ($p{'where'})
494 0 0 Alzabo::Utils::is_arrayref($p{'where'}[0]) ? :
500 0 0 unless $name = $self->_make_method('type', 'self_relation', 'class', $$self{'row_class'}, 'returns', 'row cursor', 'code', sub { my $self = shift(); my(%p) = @_; my(@where) = map({[$$_[0], '=', $self->select($$_[1])];} @reverse_pairs); if ($p{'where'}) { @where = ('(', @where, ')'); push @where, Alzabo::Utils::is_arrayref($p{'where'}[0]) ? @{$p{'where'};} : $p{'where'}; delete $p{'where'}; } ; return $table->rows_where('where', \@where, %p); } , 'foreign_key', $fk, 'parent', 0)
519 0 0 unless $fk->table_to->primary_key_size == 2
525 0 0 unless @fk == 2
528 0 0 $fk[0]->is_same_relationship_as($fk) ? :
531 0 0 unless $fk_2
535 0 0 unless $fk->table_to->primary_key_size == $fk->table_to->columns
539 0 0 unless $fk->table_to->primary_key_size == $fk->table_from->primary_key_size + $fk_2->table_to->primary_key_size
553 0 0 if ($p{'where'})
555 0 0 unless Alzabo::Utils::is_arrayref($p{'where'}[0])
565 0 0 unless my $name = $self->_make_method('type', 'linking_table', 'class', $$self{'row_class'}, 'returns', 'row cursor', 'code', sub { my $self = shift(); my(%p) = @_; if ($p{'where'}) { $p{'where'} = [$p{'where'}] unless Alzabo::Utils::is_arrayref($p{'where'}[0]); } ; foreach my $pair ($fk->column_pairs) { push @{$p{'where'};}, [$$pair[1], '=', $self->select($$pair[0]->name)]; } ; return $s->join('tables', [[@t, $fk_2]], 'select', $select, %p); } , 'foreign_key', $fk, 'foreign_key_2', $fk_2)
585 0 0 if $fk->is_one_to_many
589 0 0 unless scalar grep({$_->is_primary_key;} @to) == @to and $fk->table_to->primary_key_size == @to
594 0 0 if $_->is_primary_key
605 0 0 unless $row
607 0 0 unless my $name = $self->_make_method('type', 'lookup_columns', 'class', $$self{'row_class'}, 'returns', 'scalar value of column', 'code', sub { my $self = shift(); my $row = $self->rows_by_foreign_key('foreign_key', $fk, @_); return unless $row; return $row->select($col_name); } , 'foreign_key', $fk, 'column', $_)
628 0 0 $type eq 'insert' ? :
633 0 0 unless $class->can($pre) or $class->can($post)
639 0 0 if *{$method;}{'CODE'}
656 0 0 if $$self{'table_class'}->can('pre_insert')
658 0 0 if $$self{'table_class'}->can('post_insert')
676 0 0 if $@
694 0 0 if $class->can($hook1)
696 0 0 if $class->can($hook2)
699 0 0 @hooks > 1 ? :
701 0 0 @hooks > 1 ? :
712 0 0 if $$self{'row_class'}->can('pre_update')
714 0 0 if $$self{'row_class'}->can('post_update')
732 0 0 if $@
749 0 0 if $$self{'row_class'}->can('pre_update')
752 0 0 if $$self{'row_class'}->can('post_update')
803 0 0 if $@
821 0 0 if $$self{'row_class'}->can('pre_delete')
823 0 0 if $$self{'row_class'}->can('post_delete')
839 0 0 if $@
856 0 0 if $p{'type'} eq 'table'
858 0 0 if $p{'type'} eq 'table_column'
860 0 0 if $p{'type'} eq 'row_column'
862 0 0 if ($p{'type'} eq 'foreign_key')
867 0 0 if ($p{'type'} eq 'linking_table')
877 0 0 if $p{'type'} eq 'lookup_columns'
880 0 0 if $p{'type'} eq 'lookup_columns'
882 0 0 $p{'parent'} ? :
0 0 if $p{'type'} eq 'self_relation'
981 0 0 if exists $$store{'methods'}{'by_group'}{$group}
1002 0 0 if exists $$store{'class'}{'by_name'}{$group}
1024 0 0 if exists $$store{'contained_classes'}{'by_name'}
1038 0 0 if exists $$store{'methods'}{'by_name'}
1052 0 0 unless $contained
1073 0 0 unless $contained
1116 0 0 if $mask & $_
1118 0 0 @types ? :
1153 0 0 if (defined $spec)
1155 0 0 if (Alzabo::Utils::is_arrayref($spec)) { }
0 0 elsif (Alzabo::Utils::is_hashref($spec)) { }
1162 0 0 if (exists $$p{'type'})
1181 0 0 if (exists $$p{'type'})
1205 0 0 if $params