Branch Coverage

blib/lib/MySQL/Workbench/DBIC.pm
Criterion Covered Total %
branch 160 162 98.7


line true false branch
48 2 216 unless defined $namespace
49 3 213 if ref $namespace
51 13 200 if $namespace eq '' and $allow_empty_string
59 74 13 unless (ref $namespaces)
63 2 11 if 'ARRAY' ne ref $namespaces
66 4 16 unless _check_namespace($namespace)
126 27 58 if ($self->uppercase)
131 82 3 if $self->output_path
142 59 26 unless -f $path
168 113 4 if $self->output_path
173 32 85 unless (-e $dir)
174 1 31 unless make_path($dir)
177 115 1 if (open my $fh, '>', $dir . '/' . $file . '.pm') { }
178 4 111 if ($self->utf8)
197 0 54 if (defined $self->remove_table_prefix)
203 18 36 if ($self->uppercase)
207 51 3 $self->namespace ? :
8 46 length $self->result_namespace ? :
219 1 53 unless $rels
245 0 54 if (defined $self->remove_table_prefix)
251 18 36 if ($self->uppercase)
255 51 3 $self->namespace ? :
8 46 length $self->result_namespace ? :
267 1 53 unless $rels
293 1 88 if (defined $self->remove_table_prefix)
298 27 62 if ($self->uppercase)
302 85 4 $self->namespace ? :
12 77 length $self->result_namespace ? :
321 7 82 if (not ref $data or 'HASH' ne ref $data) { }
3 79 elsif ($data->{'comment'}) { }
323 4 3 if $comment
329 7 82 if ($table_comment_perl)
333 2 87 $self->inherit_from_core ? :
334 85 4 unless $data->{'components'}
335 88 1 $components ? :
353 52 37 if (not $self->column_details) { }
369 2 87 $self->inherit_from_core ? :
370 3 86 $self->utf8 ? :
413 5 83 if ($column->datatype =~ /char/i and $column->length <= 0)
423 8 80 if $column->autoincrement
424 18 70 unless $column->not_null
425 41 47 if $size > 0
426 4 84 if length $default_value
428 47 41 if (&first(sub { $column->datatype eq $_; } , 'SMALLINT', 'INT', 'INTEGER', 'BIGINT', 'MEDIUMINT', 'NUMERIC', 'DECIMAL'))
432 47 41 if &first(sub { $name eq $_; } , @{$table->primary_key;})
433 19 69 if $foreign_keys->{$name}
436 2 86 if (%flags)
443 18 70 if ($data and $data->{'column_info'}{$name} or $col_comment)
454 11 7 unless (eval { do { $comment_data = 'JSON'->new->decode($col_comment); 1 } })
455 1 10 if ($col_comment =~ /\{/)
460 12 6 if (not $comment_data or 'HASH' ne ref $comment_data) { }
469 14 4 unless $data->{'column_info'}{$name}
473 5 13 if (%hash)
488 12 76 if (@column_comment_lines)
504 4 88 unless @indexes
505 3 85 if $self->skip_indexes
515 1 153 unless $type
518 82 72 if $type eq 'primary'
520 21 51 if ($type eq 'unique')
527 50 1 if $type eq 'index'
541 20 65 if $unique_indexes
543 58 27 unless $hooks
578 22 17 unless defined $schema_name
580 26 13 unless ($schema_name)
584 25 6 unless (grep {$_ eq $schema;} @class_names)
591 1 38 unless $schema_name
610 9 29 if ($version)
619 8 30 if ($self->resultset_namespace)
623 3 35 if ($self->load_resultset_namespace)
626 2 1 ref $self->load_resultset_namespace ? :
630 3 35 if ($self->load_result_namespace)
633 2 1 ref $self->load_result_namespace ? :
637 12 26 if ($self->result_namespace)
640 11 1 unless $found
644 8 30 unless $version_add
646 9 29 if ($version)
650 29 9 unless $version
658 18 5 @namespaces == 1 ? :
664 12 26 if @namespace_types
666 1 37 $self->utf8 ? :
667 37 1 $self->schema_base_class ? :