Branch Coverage

lib/UR/Object/Type/ModuleWriter.pm
Criterion Covered Total %
branch 152 248 61.2


line true false branch
25 0 8 unless (@isa)
28 0 0 unless @i == @parent_class_objects
32 0 8 unless (@isa)
36 0 0 unless (@i and @i == @parent_class_objects)
52 8 0 unless (@isa == 1 and $isa[0] =~ /^UR::Object|UR::Entity$/)
53 8 0 @isa == 1 ? :
55 1 0 $self->table_name ? :
1 7 if $self->data_source_id
56 0 8 if $self->is_abstract
57 0 8 if $self->er_role and $self->er_role ne $class_meta_meta->property_meta_for_name('er_role')->default_value
59 1 7 if ($self->{'type_has'})
68 1 0 if ($section_src)
76 8 0 if ($self->{'attributes_have'})
88 0 2 unless $this_meta_struct->{'is_specified_in_module_header'} eq $expected_name
98 1 7 if ($section_src)
103 0 8 if (exists $self->{'first_sub_classification_method_name'})
116 320 106 if $property_obj->is_calculated or $property_obj->is_delegated
124 2 24 if (defined $property_value and $property_value + 0 eq $property_value && $default_value + 0 eq $default_value && $property_value != $default_value || $property_value ne $default_value)
134 1 1 if (ref $value eq 'ARRAY') { }
148 4 21 unless $mentioned_section
151 3 18 if ($mentioned_section and $mentioned_section eq 'id_implied' or $id_property_names{$property_meta->property_name}) { }
18 0 elsif ($mentioned_section) { }
166 1 7 $data_source_id ? :
168 28 8 unless $properties_by_section{$section}
169 4 4 if $sections_seen{$section}
174 36 0 defined $UR::Object::Type::a->{'position_in_module_header'} ? :
177 36 0 defined $UR::Object::Type::b->{'position_in_module_header'} ? :
200 0 8 if ($unique_groups and keys %$unique_groups)
213 1 7 if $self->schema_name
214 1 7 if $self->data_source_id
217 8 0 if (my $id_generator = $self->id_generator)
218 0 8 if ($self->data_source_id and $id_generator eq '-urinternal') { }
7 1 elsif (not $self->data_source_id and $id_generator eq '-urinternal') { }
225 1 7 if $print_id_generator
228 0 8 if ($self->roles and @{$self->roles;})
232 8 0 if (my $valid_signals = $self->valid_signals)
233 0 8 if (ref $valid_signals ne 'ARRAY') { }
1 7 elsif (@$valid_signals) { }
241 1 7 if (defined $doc)
246 1 7 if defined $doc
267 0 21 unless ($property->is_specified_in_module_header)
277 18 3 if ($type)
278 18 0 if $type
281 0 21 if (defined $property->data_length and length $property->data_length)
285 0 21 if ($property->is_legacy_eav) { }
8 13 elsif ($property->is_delegated) { }
3 10 elsif ($property->is_calculated) { }
10 0 elsif ($params{'has_table'} and not $property->is_transient) { }
293 2 1 if (my $calc_from = $property->calculate_from)
294 0 2 if ($calc_from and @$calc_from == 1) { }
2 0 elsif ($calc_from) { }
303 3 9 if ($property->$calc_type)
309 0 3 unless $calc_source
312 0 10 unless ($property->column_name)
322 0 10 $should_uc ? :
323 2 8 if ($cname ne $expected_cname)
328 0 21 if (defined $property->default_value)
330 0 0 unless (&looks_like_number($value))
336 3 18 if (my(@id_by) = eval { do { $property->get_property_name_pairs_for_join } })
337 3 0 unless (defined $property->reverse_as)
340 2 1 @id_by > 1 ? :
2 1 @id_by > 1 ? :
344 1 2 if (defined $property->id_class_by)
349 3 18 if ($property->via)
351 2 1 if ($property->to and $property->to ne $property->property_name)
355 1 2 if ($property->is_mutable)
361 1 2 if ($via_property_name eq '__self__')
365 0 3 if (not $via) { }
1 2 elsif ($property->is_many ne $via->is_many) { }
373 2 19 if ($property->reverse_as)
376 1 1 if ($property->is_mutable)
382 0 21 if ($property->constraint_name)
386 3 18 if ($property->where)
394 1 3 if (index($prop_name, ' ') >= 0)
397 1 3 if (not ref $comparison) { }
2 1 elsif (ref $comparison eq 'HASH') { }
1 0 elsif (ref $comparison eq 'ARRAY') { }
406 4 4 if ($comparison->{$key})
407 0 4 if (ref $comparison->{$key})
426 2 19 if (my $valid_values_arrayref = $property->valid_values)
430 0 21 if (my $example_values_arrayref = $property->example_values)
442 8 139 if grep {$std_field_name eq $_;} @sections
444 4 135 if $property->$property_name
450 2 40 if (defined $value)
451 1 1 &looks_like_number($value) ? :
457 3 18 if ($desc and length $desc)
460 1 2 if ($desc =~ /'/) { }
482 596 83 if $path
486 55 28 if ($first_slash >= 0) { }
496 51 449 if (-e $dir . '/' . $namespace)
506 2 1584 unless ($path =~ m(^[/\\]))
518 28 43 unless defined $path and length $path
519 0 43 unless ($path =~ s/$base_name$//)
537 0 0 unless ($in)
556 0 0 unless ($self->namespace)
560 0 0 if $namespace eq $self->class_name
566 0 0 if ($state eq 'before') { }
0 0 elsif ($state eq 'during') { }
567 0 0 if ($line and $line =~ /^use $namespace;/)
570 0 0 if ($line and $line =~ /^define UR::Object::Type$/ || $line =~ /^(App|UR)::Object::(Type|Class)->(define|create)\($/ || $line =~ /^class\s*$class_name\b/) { }
586 0 0 if ($line =~ /^(\)|\}|);\s*$/)
604 0 0 unless $end
621 0 0 unless ($new_meta_src)
628 0 0 if $namespace eq $self->class_name
630 0 0 unless ($namespace)
633 0 0 unless $use
640 0 0 if ($module_file_path =~ m[/gsc/scripts/lib])
647 0 0 if (-e $module_file_path) { }
654 0 0 unless ($namespace eq 'UR')
655 0 0 $_ =~ /^use UR;/ ? :
658 0 0 unless (grep {$_ =~ /^use warnings;/;} @module_src)
662 0 0 unless (grep {$_ =~ /^use strict;/;} @module_src)
670 0 0 if (defined $begin or defined $end) { }
675 0 0 if $module_src[$begin++] =~ /package\s+$package;/
693 0 0 if ($meta_classes{$package})
714 0 0 unless (-d $temp_dir)
719 0 0 unless ($out)
727 0 0 if ($rv) { }
731 0 0 unless (rename $temp, $module_file_path)
769 12 12 if (length $section_src > $max_width)
795 5 4 unless (&looks_like_number($value))
796 1 4 if ($value =~ /'/) { }
812 9 7 if ($e_idx == -1)
821 3 4 if ($a_idx == $b_idx) { }