Branch Coverage

lib/JSV/Compiler.pm
Criterion Covered Total %
branch 133 186 71.5


line true false branch
26 26 0 if ('HASH' eq ref $file) { }
29 0 0 unless -r $file
30 0 0 if ($file =~ /\.yaml$/i or $file =~ /\.yml$/i) { }
0 0 elsif ($file =~ /\.json/i) { }
50 37 100 if ($ctype eq 'ARRAY') { }
100 0 elsif ($ctype eq 'HASH') { }
54 21 24 if ($dtype and $dtype eq 'HASH' || $dtype eq 'ARRAY')
63 90 2 if ($dtype and $dtype eq 'HASH' || $dtype eq 'ARRAY')
79 1 25 if ($base_uri)
81 1 0 unless $base_uri->fragment
88 4 6 $base_uri ? :
89 2 8 if $self->{'schemas'}{$uri}
92 4 4 if ($self->{'schemas'}{$su})
94 4 0 if $rs
96 1 3 unless $unresolved{$su}++
102 4 249 if ($ctype eq 'ARRAY' and 'HASH' eq ref $_ and keys %$_ == 1 and $_->{'$ref'} and not ref $_->{'$ref'}) { }
96 153 elsif ('HASH' eq ref $_) { }
112 2 151 if ('HASH' eq ref $v and keys %$v == 1 and $v->{'$ref'} and not ref $v->{'$ref'}) { }
4 147 elsif ($k eq '$ref' and not ref $_->{$k}) { }
1 292 elsif ($k eq 'id' || $k eq '$id' and not ref $v) { }
116 2 2 if ($r and 'HASH' eq ref $r)
120 1 0 $base_uri ? :
121 0 1 unless $self->{'schemas'}{$id}
128 2 24 wantarray ? :
146 28 1 wantarray ? :
155 26 197 if 'HASH' ne ref $shmpt
163 26 42 if (my $class = &blessed($shmpt))
164 26 0 if ($class =~ /bool/i) { }
170 0 42 if ('HASH' ne ref $shmpt)
171 0 0 if &looks_like_number($shmpt)
174 0 42 if $shmpt->{'type'}
180 0 36 if defined $shmpt->{'additionalProperties'} or $shmpt->{'patternProperties'} or $shmpt->{'properties'} or defined $shmpt->{'minProperties'} or defined $shmpt->{'maxProperties'}
186 0 36 if defined $shmpt->{'additionalItems'} or defined $shmpt->{'uniqueItems'} or $shmpt->{'items'} or defined $shmpt->{'minItems'} or defined $shmpt->{'maxItems'}
192 0 32 if defined $shmpt->{'minimum'} or defined $shmpt->{'maximum'} or exists $shmpt->{'exclusiveMinimum'} or exists $shmpt->{'exclusiveMaximum'} or defined $shmpt->{'multipleOf'}
201 84 0 if substr($qs, -1, 1) eq "\n"
223 1 0 $sh ? :
231 0 30 if (not $is_required && $self->{'strict'} and exists $schmpt->{'default'})
237 26 4 if (defined $schmpt->{'const'})
239 13 13 $schmpt->{'const'} ? :
243 0 30 if ($self->{'to_json'}) { }
1 29 elsif ($self->{'coercion'}) { }
249 26 4 if ($is_required)
261 1 62 if (not $is_required && $self->{'strict'} and defined $schmpt->{'default'})
267 2 61 if (defined $schmpt->{'maxLength'})
271 2 61 if (defined $schmpt->{'minLength'})
275 0 63 if (defined $schmpt->{'const'})
279 6 57 if (defined $schmpt->{'pattern'})
287 10 0 if ($schmpt->{'enum'} and 'ARRAY' eq ref $schmpt->{'enum'} and @{$schmpt->{'enum'};})
292 6 57 if ($schmpt->{'format'} and $formats{$schmpt->{'format'}})
296 1 62 if ($self->{'to_json'} or $self->{'coercion'})
300 34 29 if ($is_required)
313 0 15 if (not $is_required && $self->{'strict'} and defined $schmpt->{'default'})
323 0 15 if (defined $minimum and $exclusiveMinimum)
327 0 15 if (defined $maximum and $exclusiveMaximum)
331 5 10 if (defined $minimum)
335 1 14 if (defined $exclusiveMinimum)
339 3 12 if (defined $maximum)
343 0 15 if (defined $exclusiveMaximum)
347 0 15 if (defined $schmpt->{'const'})
350 0 15 if ($schmpt->{'multipleOf'})
355 0 0 if ($schmpt->{'enum'} and 'ARRAY' eq ref $schmpt->{'enum'} and @{$schmpt->{'enum'};})
360 0 15 if ($schmpt->{'format'} and $formats{$schmpt->{'format'}})
364 1 14 if ($self->{'to_json'} or $self->{'coercion'})
368 15 0 if ($is_required)
389 5 21 if 'ARRAY' ne ref $schemas
450 29 108 !$path ? :
452 5 132 if defined $schmpt->{'anyOf'}
453 6 131 if defined $schmpt->{'allOf'}
454 10 127 if defined $schmpt->{'oneOf'}
455 5 132 if defined $schmpt->{'not'}
462 9 17 !$path ? :
463 17 9 $path ? :
465 0 25 if (not $is_required && $self->{'strict'} and $schmpt->{'default'})
471 24 2 if ($schmpt->{'properties'} and 'HASH' eq ref $schmpt->{'properties'})
473 22 2 if ($schmpt->{'required'} and 'ARRAY' eq ref $schmpt->{'required'})
478 47 0 if ('HASH' eq ref $schmpt->{'properties'}{$k})
486 0 26 if (defined $schmpt->{'minProperties'})
491 0 26 if (defined $schmpt->{'maxProperties'})
497 2 24 if (defined $schmpt->{'patternProperties'})
511 2 0 if ($schmpt->{'properties'} and 'HASH' eq ref $schmpt->{'properties'})
523 10 16 if (defined $schmpt->{'additionalProperties'})
524 10 0 unless (ref $schmpt->{'additionalProperties'} or $schmpt->{'additionalProperties'})
527 10 0 if ($schmpt->{'properties'} and 'HASH' eq ref $schmpt->{'properties'}) { }
531 2 8 if (@pt)
546 26 0 if ($is_required)
557 0 3 !$path ? :
559 0 3 if (not $is_required && $self->{'strict'} and $schmpt->{'default'})
565 3 0 if (defined $schmpt->{'minItems'})
569 0 3 if (defined $schmpt->{'maxItems'})
573 3 0 if (defined $schmpt->{'uniqueItems'})
581 3 0 if ($schmpt->{'items'})
590 0 3 if ($is_required)
591 0 0 if $path eq ''