Condition Coverage

blib/lib/JSON/Schema/Tiny.pm
Criterion Covered Total %
condition 256 314 81.5


and 3 conditions

line !l l&&!r l&&r condition
57 134 15 12084 &blessed($_[0]) and &blessed($_[0])->isa("JSON::Schema::Tiny")
63 12101 1 3 not $SPECIFICATION_VERSION =~ /^draft/u and &any(sub {
158 296 7098 12275 $spec_version && $spec_version =~ qr/^draft(7|2019-09)$/u
193 1625 134 30889 $keyword ne "\$ref" and $keyword ne "definitions"
1759 30358 531 $keyword ne "\$ref" and $keyword ne "definitions" and exists $schema->{'$ref'}
30358 516 15 $keyword ne "\$ref" and $keyword ne "definitions" and exists $schema->{'$ref'} and $spec_version eq "draft7"
205 22209 4421 3487 not $valid and $state->{'short_circuit'}
239 1 5180 1 defined $SPECIFICATION_VERSION and $SPECIFICATION_VERSION ne $spec_version
244 4898 282 1 exists $schema->{'$ref'} and $spec_version eq "draft7"
291 8 0 0 is_type("boolean", $subschema->{'$recursiveAnchor'}) and $subschema->{'$recursiveAnchor'}
347 6 0 6 !$state->{'spec_version'} || $state->{'spec_version'} eq 'draft2019-09' and ($schema->{'$anchor'} // "") =~ /^[A-Za-z][A-Za-z0-9_:.-]*$/u
0 0 6 !$state->{'spec_version'} || $state->{'spec_version'} eq 'draft2020-12' and ($schema->{'$anchor'} // "") =~ /^[A-Za-z_][A-Za-z0-9._-]*$/u
416 198 15 9 $_ eq "boolean" and $SCALARREF_BOOLEANS
15 7 2 $_ eq "boolean" and $SCALARREF_BOOLEANS and $type eq "reference to SCALAR"
221 1 0 $_ eq "number" and $type eq "integer"
428 819 126 188 $schema->{'type'} eq "number" and $type eq "integer"
830 106 9 $schema->{'type'} eq "boolean" and $SCALARREF_BOOLEANS
106 7 2 $schema->{'type'} eq "boolean" and $SCALARREF_BOOLEANS and $type eq "reference to SCALAR"
681 286 47 44 @valid > 1 and $state->{'short_circuit'}
848 88 12 75 $state->{'short_circuit'} and not exists $$schema{$state->{'keyword'} eq "prefixItems" ? "items" : ($state->{'keyword'} eq "items" ? "additionalItems" : die())}
863 561 80 26 is_type("boolean", $$schema{$state->{'keyword'}}) and $state->{'keyword'} eq "additionalItems"
902 201 42 142 $state->{'short_circuit'} and !exists $schema->{'maxContains'} || $state->{'_num_contains'} > $schema->{'maxContains'}
42 18 124 $state->{'short_circuit'} and !exists $schema->{'maxContains'} || $state->{'_num_contains'} > $schema->{'maxContains'} and $state->{'_num_contains'} >= ($schema->{'minContains'} // 1)
907 289 207 0 not $state->{'_num_contains'} and ($schema->{'minContains'} // 1) > 0 || $state->{'spec_version'} && $state->{'spec_version'} eq 'draft7'
982 326 67 110 exists $schema->{'properties'} and exists $schema->{'properties'}{$property}
984 245 60 88 exists $schema->{'patternProperties'} and &any(sub {
1054 689 0 15292 !XXX && $flags & 1024 && !($flags & 768)
1069 0 0 14 !&blessed($value) && ref $value eq $1
1086 4186 1 4288 $flags & 1024 and not $flags & 768
1087 1 0 4186 not $flags & 1024 and $flags & 768
1156 20982 9415 1 @extra_path and XXX
1171 9338 1 77 $uri eq "" and $keyword_location eq ""
855 392 8092 ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1217 999 151 1129 $ref =~ /#/u and not $ref =~ /#$/u
1150 96 1033 $ref =~ /#/u and not $ref =~ /#$/u and not $ref =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u
247 1033 0 $ref =~ /#/u and not $ref =~ /#$/u and not $ref =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $ref =~ m[#/(?:[^~]|~[01])*$]u
1231 5215 1 0 $string =~ /#/u and not $string =~ /#$/u
5216 0 0 $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u
1 0 0 $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $string =~ m[#/(?:[^~]|~[01])*$]u

or 2 conditions

line l !l condition
156 19373 296 $state->{'spec_version'} // ""
255 1211 422 $uri->fragment // ""
261 350 1189 $state->{'root_schema'}{'$id'} // ""
263 1045 15 $uri->fragment // ""
279 52 0 $uri->fragment // ""
286 44 8 $state->{'root_schema'}{'$id'} // ""
314 585 9 $state->{'spec_version'} // ""
347 6 0 $schema->{'$anchor'} // ""
6 0 $schema->{'$anchor'} // ""
410 0 6 $type // "<null>"
1317 42 $type // ""
424 2 0 $schema->{'type'} // "<null>"
15821 0 $schema->{'type'} // ""
809 683 1 $state->{'spec_version'} // ""
814 84 516 $state->{'_last_items_index'} //= -1
902 40 102 $schema->{'minContains'} // 1
1098 570 3299 $state->{'path'} //= ""
1158 2507 27891 $uri->fragment // ""
1171 9338 1 $uri->fragment // ""

or 3 conditions

line l !l&&r !l&&!r condition
52 32 0 12201 $SCALARREF_BOOLEANS // $MOJO_BOOLEANS
57 0 0 12084 $_[0]{'boolean_result'} // $BOOLEAN_RESULT
6037 0 6047 $_[0]{'short_circuit'} // $SHORT_CIRCUIT
3 12081 0 $_[0]{'max_traversal_depth'} // $MAX_TRAVERSAL_DEPTH
0 0 12084 $_[0]{'scalarref_booleans'} // $SCALARREF_BOOLEANS
0 0 12084 ($_[0]{'scalarref_booleans'} // $SCALARREF_BOOLEANS) // $_[0]{'mojo_booleans'}
12081 0 3 $_[0]{'specification_version'} // $SPECIFICATION_VERSION
71 14 6040 6178 $BOOLEAN_RESULT || $SHORT_CIRCUIT
99 6040 6192 0 $valid or @{$state->{'errors'}}
150 373 0 415 $schema || E($state, 'subschema is false')
158 296 14472 4901 !$spec_version || $spec_version ne 'draft7'
296 7374 11999 !$spec_version || $spec_version eq 'draft2019-09'
296 7098 12275 !$spec_version || $spec_version eq 'draft2020-12'
296 7374 11999 !$spec_version || $spec_version eq 'draft2019-09'
296 7098 12275 !$spec_version || $spec_version eq 'draft2020-12'
296 14472 4901 !$spec_version || $spec_version ne 'draft7'
296 4901 14472 !$spec_version || $spec_version eq 'draft7'
296 14472 4901 !$spec_version || $spec_version ne 'draft7'
296 14472 4901 !$spec_version || $spec_version ne 'draft7'
296 4901 14472 !$spec_version || $spec_version eq 'draft7'
296 12275 7098 !$spec_version || $spec_version =~ qr/^draft(?:7|2019-09)$/u
296 14472 4901 !$spec_version || $spec_version ne 'draft7'
296 14472 4901 !$spec_version || $spec_version ne 'draft7'
296 14472 4901 !$spec_version || $spec_version ne 'draft7'
293 0 0 0 $state->{'recursive_anchor_uri'} // $state->{'initial_schema_uri'}
347 0 6 6 !$state->{'spec_version'} || $state->{'spec_version'} eq 'draft2019-09'
0 6 0 !$state->{'spec_version'} || $state->{'spec_version'} eq 'draft2020-12'
6 6 0 !$state->{'spec_version'} || $state->{'spec_version'} eq 'draft2019-09' and ($schema->{'$anchor'} // "") =~ /^[A-Za-z][A-Za-z0-9_:.-]*$/u or !$state->{'spec_version'} || $state->{'spec_version'} eq 'draft2020-12' and ($schema->{'$anchor'} // "") =~ /^[A-Za-z_][A-Za-z0-9._-]*$/u
354 28 13 39 not $schema->{'$recursiveAnchor'} or exists $state->{'recursive_anchor_uri'}
416 62 0 222 $type eq $_ or $_ eq "number" and $type eq "integer"
428 2279 188 945 $type eq $schema->{'type'} or $schema->{'type'} eq "number" and $type eq "integer"
188 20 925 $type eq $schema->{'type'} or $schema->{'type'} eq "number" and $type eq "integer" or $schema->{'type'} eq "boolean" and $SCALARREF_BOOLEANS and $type eq "reference to SCALAR"
457 30 18 586 ref($data) =~ /^Math::Big(?:Int|Float)$/u or ref($schema->{'multipleOf'}) =~ /^Math::Big(?:Int|Float)$/u
48 0 586 ref($data) =~ /^Math::Big(?:Int|Float)$/u or ref($schema->{'multipleOf'}) =~ /^Math::Big(?:Int|Float)$/u or get_type($data) eq "number"
18 1 585 ref($data) =~ /^Math::Big(?:Int|Float)$/u or ref($schema->{'multipleOf'}) =~ /^Math::Big(?:Int|Float)$/u or get_type($data) eq "number" or get_type($schema->{'multipleOf'}) eq "number"
703 230 40 28 exists $schema->{'then'} or exists $schema->{'else'}
723 92 18 89 not exists $data->{$property} or _eval_subschema($data, $schema->{'dependentSchemas'}{$property}, {%$state, "schema_path", jsonp($state->{'schema_path'}, "dependentSchemas", $property)})
762 54 9 43 not exists $data->{$property} or _eval_subschema($data, $schema->{'dependencies'}{$property}, {%$state, "schema_path", jsonp($state->{'schema_path'}, "dependencies", $property)})
868 0 20 0 exists $schema->{'prefixItems'} || $state->{'keyword'} eq 'additionalItems'
883 17 36 144 exists $schema->{'prefixItems'} || $state->{'keyword'} eq 'additionalItems'
902 124 18 42 !exists $schema->{'maxContains'} || $state->{'_num_contains'} > $schema->{'maxContains'}
907 195 0 12 ($schema->{'minContains'} // 1) > 0 || $state->{'spec_version'} && $state->{'spec_version'} eq 'draft7'
1049 15995 6069 2887 $type eq "string" or $type eq "number"
22064 2869 18 $type eq "string" or $type eq "number" or $type eq "integer"
1058 357 4713 997 ref($value) =~ /^Math::Big(?:Int|Float)$/u || !($flags & 1024) && $flags & 768
1063 95 2727 45 ref($value) =~ /^Math::Big(?:Int|Float)$/u && $value->is_int || !($flags & 1024) && $flags & 768 && int $value == $value
1171 77 8747 592 $uri eq "" and $keyword_location eq "" or ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1217 0 0 2279 fc "Mojo::URL"->new($ref)->to_unsafe_string ne fc $ref or $ref =~ /[^[:ascii:]]/u
0 0 2279 fc "Mojo::URL"->new($ref)->to_unsafe_string ne fc $ref or $ref =~ /[^[:ascii:]]/u or $ref =~ /#/u and not $ref =~ /#$/u and not $ref =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $ref =~ m[#/(?:[^~]|~[01])*$]u
1228 4 5212 0 $override // $$schema{$state->{'keyword'}}
1231 0 0 5216 fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u
0 0 5216 fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or not $uri->is_abs
0 0 5216 fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or not $uri->is_abs or $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $string =~ m[#/(?:[^~]|~[01])*$]u