Branch Coverage

blib/lib/JSON/Schema/Modern.pm
Criterion Covered Total %
branch 131 156 83.9


line true false branch
128 0 13701 if @_ < 2
132 0 28 $_[0]->$JSON::Schema::Modern::_isa('Mojo::URL') ? :
13673 28 !XXX ? :
135 1 13700 if defined $uri->fragment
137 2 13698 unless (@_)
139 1 1 unless $schema_info and defined wantarray
144 13684 0 $uri ? :
14 13684 $_[0]->$JSON::Schema::Modern::_isa('JSON::Schema::Modern::Document') ? :
151 117 13581 if ($document->has_errors)
161 13576 5 unless (grep((&refaddr($_->{'document'}) == &refaddr($document)), $self->_canonical_resources))
165 9504 4072 if (my $existing_doc = &first(sub {
179 382 13193 if ("$uri")
195 0 3 unless defined wantarray
292 0 13326 unless defined wantarray
381 0 13209 if $valid xor not @{$state->{'errors'}}
390 19 7356 $config_override->{'collect_annotations'} // $self->collect_annotations ? :
7375 5834 $valid ? :
395 0 3 unless defined wantarray
398 2 1 XXX && $schema->{'$schema'} ? :
405 2 8 unless $schema_info
406 6 2 XXX ? :
407 5 3 wantarray ? :
453 0 32620 if $state->{'depth'}++ > $self->max_traversal_depth
456 6822 25798 if $schema_type eq "boolean"
458 10 25788 if $schema_type ne "object"
460 488 25300 unless keys %$schema
476 1324304 45540 unless exists $schema->{$keyword}
479 26 42955 if $keyword ne "\$ref" and exists $schema->{'$ref'} and $state->{'spec_version'} eq "draft7"
484 179 45335 unless (&$sub($vocabulary, $schema, $state))
485 0 179 unless @{$state->{'errors'}}
490 4 45331 if (my $callback = $state->{'callbacks'}{$keyword})
491 0 4 unless (&$callback($schema, $state))
492 0 0 unless @{$state->{'errors'}}
502 1 25299 if ($self->strict and keys %unknown_keywords)
503 1 0 keys %unknown_keywords > 1 ? :
509 94571 238 unless exists $schema->{$keyword}
512 238 0 if (my $alternates = $removed_keywords{$state->{'spec_version'}}{$keyword})
514 0 238 if @list > 2
515 164 74 if @list > 1
525 0 27853 unless defined wantarray
533 3 27850 if $state->{'depth'}++ > $self->max_traversal_depth
536 768 27082 if $schema_type eq "boolean"
539 0 27082 if $schema_type ne "object"
541 261 26821 unless keys %$schema
549 1 26820 if grep((substr($schema_location, 0, length $_) eq $_), keys %{$state->{'seen'}{$state->{'data_path'}}{$canonical_uri}})
578 1277470 55150 unless exists $schema->{$keyword}
581 11 51592 if $keyword ne "\$ref" and exists $schema->{'$ref'} and $state->{'spec_version'} eq "draft7"
586 43117 12022 if ($sub)
589 10578 32472 unless (&$sub($vocabulary, $data, $schema, $state))
591 0 10578 if $error_count == @{$state->{'errors'}}
594 4122 6456 if $state->{'short_circuit'}
599 19 44475 if (my $callback = $state->{'callbacks'}{$keyword})
602 2 17 unless (&$callback($data, $schema, $state))
604 0 2 if $error_count == @{$state->{'errors'}}
607 1 1 if $state->{'short_circuit'}
616 2 26751 if ($state->{'strict'} and keys %unknown_keywords)
617 2 0 keys %unknown_keywords > 1 ? :
621 824 15517 if ($valid and $state->{'collect_annotations'} and not $state->{'spec_version'} =~ qr/^draft(7|2019-09)$/u)
627 16341 10410 if $valid
712 0 8 if grep(($_->[1] eq $classname), values %{$$self{"_vocabulary_classes"}})
755 13793 5 if $metaschema_info
768 3 6 $e->keyword eq '$schema' ? :
8 1 length $absolute_location ? :
778 3 2 if @{$state->{'errors'}}
817 3683 78 if $resource
819 72 6 if (my $local_filename = $self->CACHED_METASCHEMAS->{$uri})
825 0 72 if $document->has_errors
857 92 4490 unless XXX
860 3760 822 if (not length $fragment or $fragment =~ m[^/]u) { }
862 3754 6 if (my $resource = $self->_get_or_load_resource($base))
864 6 3748 unless defined $subschema
867 890 3064 unless not length $_->[1]{'path'}
875 2323 1425 unless length $canonical_uri->fragment
886 720 102 if (my $resource = $self->_get_resource($uri))
888 0 720 unless defined $subschema
948 27 8 if $mt
950 12 32 if m[([^/]+)/\*$]u
952 0 0 if m[([^/]+)/\*$]u