Branch Coverage

blib/lib/SQL/Translator/Parser/OpenAPI.pm
Criterion Covered Total %
branch 104 114 91.2


line true false branch
48 33 45 @props == 1 ? :
49 7 71 if $real and $real->{'type'} eq 'array'
50 33 45 if $real
51 24 54 if $real
52 7 26 $is_array ? :
33 45 @props == 1 ? :
68 2 6 if grep $reffed->{$_}, @{$sig2names{$sig};}
113 17 61 if $reffed->{$defname}
117 1091 102 unless ($thismask & $supermask) == $thismask
132 169 5 unless $prop->{'enum'}
5 169 if (@{[] unless $prop->{'enum'};})
142 42 81 ref $field_in eq 'ARRAY' ? :
152 4 38 ref $field_in eq 'ARRAY' ? :
154 38 4 if @fields == 1 and $fields[0]->data_type =~ /int/
166 11 62 unless $args->{'snake_case'}
172 0 140 unless $ref =~ s[^#/definitions/][]
187 4 26 unless $schema->get_table($name)
199 0 30 unless $field
201 27 3 if $required
210 2 42 if (my $view_of = $def->{'x-view-of'})
219 29 9 unless ($m2m or $props->{$relational_id_field})
223 17 25 unless $def->{'required'}
229 14 187 if (my $ref = $thisprop->{'$ref'}) { }
13 174 elsif (($thisprop->{'type'} // '') eq 'array') { }
240 13 0 if (my $ref = $thisprop->{'items'}{'$ref'})
243 11 2 if ($args->{'snake_case'}) { }
263 38 136 if ($propname eq ($relational_id_field // '')) { }
4 132 elsif ($propname eq ($def->{'x-id-field'} // '')) { }
274 54 120 if ($field and $prop2required{$propname} and $propname ne $relational_id_field)
278 4 38 if ($m2m)
306 2 2 exists $_->{'$ref'} ? :
320 25 171 if (my $ref = $theseprops->{$propname}{'$ref'} || $theseprops->{$propname}{'items'} && $theseprops->{$propname}{'items'}{'$ref'})
340 21 3 if $thisprop->{'$ref'} or $thisprop->{'items'} and $thisprop->{'items'}{'$ref'}
342 5 131 if (($thisprop->{'type'} // '') eq 'object') { }
0 131 elsif ($thisprop->{'items'} and ($thisprop->{'items'}{'type'} // '') eq 'object') { }
352 5 0 if ($args->{'snake_case'}) { }
373 19 142 if $thisprop->{'$ref'}
375 139 3 unless $thisprop->{'items'} and ($thisprop->{'items'}{'type'} // '') ne 'object'
378 2 1 if ($args->{'snake_case'}) { }
409 135 10 unless $thisprop->{'$ref'} or $thisprop->{'items'} and $thisprop->{'items'}{'$ref'}
412 19 10 if ($thisprop->{'$ref'}) { }
10 0 elsif ($thisprop->{'items'} and $thisprop->{'items'}{'$ref'}) { }
421 26 3 unless $def2aP{_ref2def($refname)}
450 141 13 unless $thisprop->{'$ref'} or $thisprop->{'items'} and $thisprop->{'items'}{'$ref'}
453 16 13 if ($thisprop->{'$ref'}) { }
13 0 elsif ($thisprop->{'items'} and $thisprop->{'items'}{'$ref'}) { }
463 27 2 unless $def2nonobj{$refdef}
479 10 2 if ($args->{'snake_case'}) { }
515 2 2 if ($f1_fromkey eq $f2_fromkey and $f1->{'from'} eq $f2->{'from'})
520 3 1 if ($args->{'snake_case'}) { }
562 0 35 unless $SQL::Translator::Parser::OpenAPI::a->{'from'} cmp $SQL::Translator::Parser::OpenAPI::b->{'from'}
578 14 428 if $thisprop->{$name}
591 38 2 if ($theseprops->{'id'} and $theseprops->{'id'}{'type'} =~ /int/ or not $theseprops->{'id'}) { }
0 2 elsif ($thisdef->{'x-id-field'} and $$theseprops{$thisdef->{'x-id-field'}}{'type'} =~ /int/) { }
617 190 1246 ref $_[0] ? :
625 5 40 unless _maybe_deref($real)
626 0 30 ref $mapped{$_} ? :