Branch Coverage

blib/lib/GraphQL/Plugin/Convert/OpenAPI.pm
Criterion Covered Total %
branch 110 130 84.6


line true false branch
29 633 373 unless $modifier
30 0 373 if (ref $modifier eq 'ARRAY')
35 0 285 if $modifier eq 'non_null' and ref $typespec eq 'ARRAY' and $typespec->[0] eq 'non_null'
43 364 1651 if ref $typespec eq 'HASH'
44 1287 364 if ref $typespec ne 'ARRAY'
51 0 24 unless defined $type
52 13 11 if $TYPE2SCALAR{$type} or +($type2info->{$type} || {})->{'is_enum'}
53 3 8 if (ref $type eq 'ARRAY')
56 1 2 if $mod eq 'non_null'
57 0 2 if $mod ne 'list'
65 1 9 if ($field2is_hashpair->{$_}) { }
95 3 0 if (ref $root_value eq 'HASH' and $type2info->{$parent_type} and my $prop = $type2info->{$parent_type}{'field2prop'}{$field_name})
103 0 6 ref $root_value eq 'HASH' ? :
106 0 6 if ref $property eq 'CODE'
107 0 6 if ref $root_value eq 'HASH'
108 0 6 unless (UNIVERSAL::isa($root_value, 'OpenAPI::Client'))
109 0 0 unless $root_value->can($field_name)
125 0 6 if $res->is_error
130 1 5 if ($$type2info{$return_type->to_string}{'is_hashpair'})
133 0 1 unless $json
143 0 6 if $@
150 0 1153 unless defined $name
158 17 1050 unless $info and %$info
160 214 836 if ($info->{'$ref'} and ($info->{'type'} // '') ne 'array')
166 6 830 if ($info->{'additionalProperties'} or ($info->{'type'} // '') eq 'object' and not $info->{'properties'})
189 5 808 if ($info->{'properties'} or $info->{'allOf'} or $info->{'enum'})
197 73 735 if ($info->{'type'} eq 'array')
210 11 724 if ($info->{'type'} // '') eq 'string' and ($info->{'format'} // '') eq 'date-time'
220 103 49 unless $refinfo->{'required'}
238 30 639 if $info->{'description'}
247 1 23 if (exists $merged{$k}) { }
248 0 1 if ref $f2->{$k}{'type'}
265 4 155 if ($refinfo->{'allOf'}) { }
7 148 elsif (my $values = $refinfo->{'enum'}) { }
268 4 4 if ($schema->{'$ref'}) { }
272 2 2 if $othertypedef->{'kind'} eq 'interface'
286 2 19 unless length $trimmed
296 0 7 if $refinfo->{'title'}
298 3 4 if $refinfo->{'description'}
310 1 151 $refinfo->{'discriminator'} ? :
315 4 148 if $refinfo->{'title'}
317 7 145 if $refinfo->{'description'}
326 116 0 if @$types2 == 1
340 55 317 if ref $type eq 'HASH'
341 55 317 if (ref $type eq 'ARRAY')
355 6 39 if $TYPE2SCALAR{$type} or $name2type->{$type}{'kind'} eq 'enum' or $name2type->{$type}{'kind'} eq 'input'
374 1 34 $typedef->{'description'} ? :
391 203 112 unless $ref
404 43 73 $METHOD2MUTATION{$method} ? :
415 11 105 unless @responsetypes
428 22 187 $_->{'schema'} ? :
439 1 208 if $is_hashpair
444 199 10 $_->{'description'} ? :
449 110 6 $description ? :
106 10 %args ? :
464 85 890 if $name2typeused->{$name}
465 735 155 if $TYPE2SCALAR{$name}
468 7 148 if $KIND2SIMPLE{$type->{'kind'}}
469 0 148 if ($type->{'kind'} eq 'union')
474 1 147 if ($type->{'kind'} eq 'interface')
477 38 2 if $maybe_type->{'kind'} ne 'type' or not $maybe_type->{'interfaces'}
478 0 2 unless grep(($_ eq $name), @{$$maybe_type{'interfaces'};})
488 645 106 unless $field_def->{'args'}
645 106 unless %{{} unless $field_def->{'args'};}
499 2 5 if $app