Branch Coverage

lib/JSV/Compiler.pm
Criterion Covered Total %
branch 132 186 70.9


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 ? :
145 26 1 wantarray ? :
154 26 191 if 'HASH' ne ref $shmpt
162 26 42 if (my $class = &blessed($shmpt))
163 26 0 if ($class =~ /bool/i) { }
169 0 42 if ('HASH' ne ref $shmpt)
170 0 0 if &looks_like_number($shmpt)
173 0 42 if $shmpt->{'type'}
179 0 36 if defined $shmpt->{'additionalProperties'} or $shmpt->{'patternProperties'} or $shmpt->{'properties'} or defined $shmpt->{'minProperties'} or defined $shmpt->{'maxProperties'}
185 0 36 if defined $shmpt->{'additionalItems'} or defined $shmpt->{'uniqueItems'} or $shmpt->{'items'} or defined $shmpt->{'minItems'} or defined $shmpt->{'maxItems'}
191 0 32 if defined $shmpt->{'minimum'} or defined $shmpt->{'maximum'} or exists $shmpt->{'exclusiveMinimum'} or exists $shmpt->{'exclusiveMaximum'} or defined $shmpt->{'multipleOf'}
200 81 0 if substr($qs, -1, 1) eq "\n"
222 1 0 $sh ? :
230 0 30 if (exists $schmpt->{'default'})
236 26 4 if (defined $schmpt->{'const'})
238 13 13 $schmpt->{'const'} ? :
242 0 30 if ($self->{'to_json'}) { }
1 29 elsif ($self->{'coercion'}) { }
248 26 4 if ($is_required)
260 0 61 if (defined $schmpt->{'default'})
266 2 59 if (defined $schmpt->{'maxLength'})
270 2 59 if (defined $schmpt->{'minLength'})
274 0 61 if (defined $schmpt->{'const'})
278 6 55 if (defined $schmpt->{'pattern'})
286 10 0 if ($schmpt->{'enum'} and 'ARRAY' eq ref $schmpt->{'enum'} and @{$schmpt->{'enum'};})
291 6 55 if ($schmpt->{'format'} and $formats{$schmpt->{'format'}})
295 1 60 if ($self->{'to_json'} or $self->{'coercion'})
299 32 29 if ($is_required)
312 0 15 if (defined $schmpt->{'default'})
322 0 15 if (defined $minimum and $exclusiveMinimum)
326 0 15 if (defined $maximum and $exclusiveMaximum)
330 5 10 if (defined $minimum)
334 1 14 if (defined $exclusiveMinimum)
338 3 12 if (defined $maximum)
342 0 15 if (defined $exclusiveMaximum)
346 0 15 if (defined $schmpt->{'const'})
349 0 15 if ($schmpt->{'multipleOf'})
354 0 0 if ($schmpt->{'enum'} and 'ARRAY' eq ref $schmpt->{'enum'} and @{$schmpt->{'enum'};})
359 0 15 if ($schmpt->{'format'} and $formats{$schmpt->{'format'}})
363 1 14 if ($self->{'to_json'} or $self->{'coercion'})
367 15 0 if ($is_required)
388 5 21 if 'ARRAY' ne ref $schemas
449 27 106 !$path ? :
451 5 128 if defined $schmpt->{'anyOf'}
452 6 127 if defined $schmpt->{'allOf'}
453 10 123 if defined $schmpt->{'oneOf'}
454 5 128 if defined $schmpt->{'not'}
461 7 17 !$path ? :
462 17 7 $path ? :
464 0 24 if ($schmpt->{'default'})
470 22 2 if ($schmpt->{'properties'} and 'HASH' eq ref $schmpt->{'properties'})
472 20 2 if ($schmpt->{'required'} and 'ARRAY' eq ref $schmpt->{'required'})
477 45 0 if ('HASH' eq ref $schmpt->{'properties'}{$k})
485 0 24 if (defined $schmpt->{'minProperties'})
490 0 24 if (defined $schmpt->{'maxProperties'})
496 2 22 if (defined $schmpt->{'patternProperties'})
510 2 0 if ($schmpt->{'properties'} and 'HASH' eq ref $schmpt->{'properties'})
522 10 14 if (defined $schmpt->{'additionalProperties'})
523 10 0 unless (ref $schmpt->{'additionalProperties'} or $schmpt->{'additionalProperties'})
526 10 0 if ($schmpt->{'properties'} and 'HASH' eq ref $schmpt->{'properties'}) { }
530 2 8 if (@pt)
545 24 0 if ($is_required)
556 0 3 !$path ? :
558 0 3 if ($schmpt->{'default'})
564 3 0 if (defined $schmpt->{'minItems'})
568 0 3 if (defined $schmpt->{'maxItems'})
572 3 0 if (defined $schmpt->{'uniqueItems'})
580 3 0 if ($schmpt->{'items'})
589 0 3 if ($is_required)
590 0 0 if $path eq ''