Branch Coverage

blib/lib/JSON/Schema/Generate.pm
Criterion Covered Total %
branch 50 58 86.2


line true false branch
65 0 3 if ($args->merge_examples)
76 0 4 ref $_[1] ? :
84 2 1 unless $self->{'none_required'}
85 0 3 $struct ? :
91 4 26 if ($schema->{'required'})
94 21 4 if ($schema->{'required'}{$key} == $total_runs)
100 4 26 if ($schema->{'properties'})
103 3 27 if $schema->{'items'}
111 8 51 if ($ref eq 'HASH') { }
5 46 elsif ($ref eq 'ARRAY') { }
2 44 elsif (not defined $data) { }
6 38 elsif ($ref eq 'SCALAR' or $ref =~ /Boolean$/) { }
9 29 elsif ($data =~ /^\d+$/) { }
0 29 elsif ($data =~ /^\d+\.\d+$/) { }
114 0 8 if ref $props->{'type'}
115 5 3 unless ($props->{'properties'})
116 4 1 unless $self->{'none_required'}
120 44 2 unless $self->{'none_required'}
122 27 19 unless ($props->{'properties'}{$key})
128 0 27 $self->{'no_id'} ? :
2 25 $self->{'spec'}{$key} ? :
136 3 2 unless ($props->{'items'})
138 3 0 unless $self->{'no_id'}
176 33 26 if (not $props->{'type'}) { }
6 20 elsif ($props->{'type'} ne $type) { }
179 2 4 unless ref $props->{'type'}
180 4 2 unless grep {$type eq $_;} @{$$props{'type'};}
188 0 60 if ((ref $example || 'SCALAR') ne 'SCALAR' and $props->{'examples'} and $self->{'merge_examples'}) { }
191 55 5 unless (grep {($_ // '') eq ($example // '');} @{$$props{'examples'};})