Branch Coverage

blib/lib/SQL/Translator/Schema/Table.pm
Criterion Covered Total %
branch 111 162 68.5


line true false branch
44 0 6027 unless $_[0]->name
88 3 500 if (UNIVERSAL::isa($_[0], $constraint_class)) { }
95 0 500 unless $constraint = $constraint_class->new(\%args)
105 48 455 if ($pk and $constraint->type eq 'PRIMARY KEY') { }
202 253 elsif ($constraint->type eq 'PRIMARY KEY') { }
107 0 48 if $constraint->name
109 2 46 if keys %extra
115 234 0 if (my $f = $self->get_field($fname))
142 455 48 if ($ok)
164 1 2 if (UNIVERSAL::isa($_[0], $constraint_class)) { }
171 1 2 unless ($self->_has_constraints and grep {$_->name eq $constraint_name;} @{$self->_constraints;})
211 3 126 if (UNIVERSAL::isa($_[0], $index_class)) { }
218 0 126 unless $index = $index_class->new(\%args)
222 0 69 if $ex_index->equals($index)
243 1 2 if (UNIVERSAL::isa($_[0], $index_class)) { }
250 1 2 unless ($self->_has_indices and grep {$_->name eq $index_name;} @{$self->_indices;})
295 7 1368 if (UNIVERSAL::isa($_[0], $field_class)) { }
302 1 1367 unless $field = $field_class->new(\%args)
309 185 1189 if ($field->order) { }
310 1 184 if ($$existing_order{$field->order})
321 1 1188 if ($last_field_no != scalar keys %$existing_order)
334 2 1370 if ($self->get_field($field_name)) { }
359 1 2 if (UNIVERSAL::isa($_[0], $field_class)) { }
368 1 2 unless ($self->_has_fields and exists $self->_fields->{$field_name})
374 2 0 if ($cascade)
439 1737 593 if ($self->_has_constraints) { }
441 1735 2 wantarray ? :
460 198 351 if ($self->_has_indices) { }
462 197 1 wantarray ? :
481 0 4640 unless my $field_name = shift()
483 328 4312 unless $self->_has_fields
485 1 4311 if ($case_insensitive)
488 1 0 if $field_name eq uc $field
493 1135 3176 unless exists $self->_fields->{$field_name}
511 1895 311 $self->_has_fields ? :
513 1895 311 if (@fields) { }
514 1840 55 wantarray ? :
532 0 57 unless $self->name
533 2 55 unless $self->get_fields
538 3 307 unless $object->is_valid
556 1 2 if $self->is_data
561 1 4 unless $field->is_foreign_key
566 1 2 if ($fk{$referenced} > 1)
588 2 2 unless ($field->is_primary_key or $field->is_foreign_key)
610 0 3 if defined $self->_can_link->{$table1->name}{$table2->name}
612 0 3 if ($self->is_data == 1)
621 6 1 if ($field->is_foreign_key)
627 1 2 unless (defined $fk{$table1->name} and defined $fk{$table2->name})
635 1 1 if (scalar(@{$fk{$table1->name};} == 1) and scalar(@{$fk{$table2->name};} == 1)) { }
0 1 elsif (scalar(@{$fk{$table1->name};} > 1) and scalar(@{$fk{$table2->name};} == 1)) { }
0 1 elsif (scalar(@{$fk{$table1->name};} == 1) and scalar(@{$fk{$table2->name};} > 1)) { }
1 0 elsif (scalar(@{$fk{$table1->name};} > 1) and scalar(@{$fk{$table2->name};} > 1)) { }
761 145 1214 if (@$fields)
763 3 151 unless $self->get_field($f)
769 57 10 if ($c->type eq "PRIMARY KEY")
776 85 57 unless ($has_pk)
777 0 85 unless $constraint = $self->add_constraint("type", "PRIMARY KEY", "fields", $fields)
784 142 1214 if ($constraint) { }
789 775 239 if $c->type eq "PRIMARY KEY"
843 1 0 if (@fields) { }
844 1 0 wantarray ? :
868 0 0 unless $self->SUPER::equals($other)
869 0 0 $case_insensitive ? :
0 0 unless $case_insensitive ? uc $self->name eq uc $other->name : $self->name eq $other->name
870 0 0 unless $self->_compare_objects(scalar $self->options, scalar $other->options)
871 0 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra)
878 0 0 unless $field->equals($otherField, $case_insensitive)
883 0 0 if $checkedFields{$otherField->name}
893 0 0 if ($constraint->equals($otherConstraint, $case_insensitive))
903 0 0 if $checkedFields{$otherConstraint}
905 0 0 if ($otherConstraint->equals($constraint, $case_insensitive))
918 0 0 if ($index->equals($otherIndex, $case_insensitive))
928 0 0 if $checkedIndices{$otherIndex}
930 0 0 if ($otherIndex->equals($index, $case_insensitive))
984 3 0 wantarray ? :
991 1 0 wantarray ? :
997 1 0 wantarray ? :
1004 3 0 wantarray ? :
1011 1 0 wantarray ? :
1017 2 0 wantarray ? :
1023 2 0 wantarray ? :