Condition Coverage

blib/lib/JSON/Schema/Tiny.pm
Criterion Covered Total %
condition 251 308 81.4


and 3 conditions

line !l l&&!r l&&r condition
56 132 15 11974 &blessed($_[0]) and &blessed($_[0])->isa("JSON::Schema::Tiny")
62 11991 1 3 not $SPECIFICATION_VERSION =~ /^draft/u and &any(sub {
157 294 7036 12157 $spec_version && $spec_version =~ qr/^draft(7|2019-09)$/u
192 1565 130 30655 $keyword ne "\$ref" and $keyword ne "definitions"
1695 30148 507 $keyword ne "\$ref" and $keyword ne "definitions" and exists $schema->{'$ref'}
30148 492 15 $keyword ne "\$ref" and $keyword ne "definitions" and exists $schema->{'$ref'} and $spec_version eq "draft7"
204 22048 4409 3481 not $valid and $state->{'short_circuit'}
238 1 5132 1 defined $SPECIFICATION_VERSION and $SPECIFICATION_VERSION ne $spec_version
243 4862 270 1 exists $schema->{'$ref'} and $spec_version eq "draft7"
290 8 0 0 is_type("boolean", $subschema->{'$recursiveAnchor'}) and $subschema->{'$recursiveAnchor'}
346 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
415 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"
427 813 122 180 $schema->{'type'} eq "number" and $type eq "integer"
820 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"
679 286 47 44 @valid > 1 and $state->{'short_circuit'}
846 88 12 75 $state->{'short_circuit'} and not exists $$schema{$state->{'keyword'} eq "prefixItems" ? "items" : ($state->{'keyword'} eq "items" ? "additionalItems" : die())}
861 527 80 26 is_type("boolean", $$schema{$state->{'keyword'}}) and $state->{'keyword'} eq "additionalItems"
900 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)
905 289 207 0 not $state->{'_num_contains'} and ($schema->{'minContains'} // 1) > 0 || $state->{'spec_version'} && $state->{'spec_version'} eq 'draft7'
980 325 67 110 exists $schema->{'properties'} and exists $schema->{'properties'}{$property}
982 245 60 87 exists $schema->{'patternProperties'} and &any(sub {
1052 689 0 15102 !XXX && $flags & 1024 && !($flags & 768)
1067 0 0 14 !&blessed($value) && ref $value eq $1
1084 7036 1 4454 $flags & 1024 and not $flags & 768
1085 1 0 7036 not $flags & 1024 and $flags & 768
1154 20792 9304 1 @extra_path and XXX
1169 9227 1 77 $uri eq "" and $keyword_location eq ""
855 376 7997 ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1215 931 151 1121 $ref =~ /#/u and not $ref =~ /#$/u
1082 88 1033 $ref =~ /#/u and not $ref =~ /#$/u and not $ref =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u
239 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
1229 5159 1 0 $string =~ /#/u and not $string =~ /#$/u
5160 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
155 19193 294 $state->{'spec_version'} // ""
254 1203 370 $uri->fragment // ""
260 334 1153 $state->{'root_schema'}{'$id'} // ""
262 1045 15 $uri->fragment // ""
278 52 0 $uri->fragment // ""
285 44 8 $state->{'root_schema'}{'$id'} // ""
313 569 9 $state->{'spec_version'} // ""
346 6 0 $schema->{'$anchor'} // ""
6 0 $schema->{'$anchor'} // ""
409 0 6 $type // "<null>"
1317 42 $type // ""
423 2 0 $schema->{'type'} // "<null>"
15553 0 $schema->{'type'} // ""
807 683 1 $state->{'spec_version'} // ""
812 84 504 $state->{'_last_items_index'} //= -1
900 40 102 $schema->{'minContains'} // 1
1096 579 5872 $state->{'path'} //= ""
1156 2507 27590 $uri->fragment // ""
1169 9227 1 $uri->fragment // ""

or 3 conditions

line l !l&&r !l&&!r condition
51 32 0 12089 $SCALARREF_BOOLEANS // $MOJO_BOOLEANS
56 0 0 11974 $_[0]{'boolean_result'} // $BOOLEAN_RESULT
5982 0 5992 $_[0]{'short_circuit'} // $SHORT_CIRCUIT
3 11971 0 $_[0]{'max_traversal_depth'} // $MAX_TRAVERSAL_DEPTH
0 0 11974 $_[0]{'scalarref_booleans'} // $SCALARREF_BOOLEANS
0 0 11974 ($_[0]{'scalarref_booleans'} // $SCALARREF_BOOLEANS) // $_[0]{'mojo_booleans'}
11971 0 3 $_[0]{'specification_version'} // $SPECIFICATION_VERSION
70 14 5985 6121 $BOOLEAN_RESULT || $SHORT_CIRCUIT
98 6028 6092 0 $valid or @{$state->{'errors'}}
149 365 0 415 $schema || E($state, 'subschema is false')
157 294 14341 4852 !$spec_version || $spec_version ne 'draft7'
294 7305 11888 !$spec_version || $spec_version eq 'draft2019-09'
294 7036 12157 !$spec_version || $spec_version eq 'draft2020-12'
294 7305 11888 !$spec_version || $spec_version eq 'draft2019-09'
294 7036 12157 !$spec_version || $spec_version eq 'draft2020-12'
294 14341 4852 !$spec_version || $spec_version ne 'draft7'
294 4852 14341 !$spec_version || $spec_version eq 'draft7'
294 14341 4852 !$spec_version || $spec_version ne 'draft7'
294 14341 4852 !$spec_version || $spec_version ne 'draft7'
294 4852 14341 !$spec_version || $spec_version eq 'draft7'
294 12157 7036 !$spec_version || $spec_version =~ qr/^draft(?:7|2019-09)$/u
294 14341 4852 !$spec_version || $spec_version ne 'draft7'
294 14341 4852 !$spec_version || $spec_version ne 'draft7'
294 14341 4852 !$spec_version || $spec_version ne 'draft7'
292 0 0 0 $state->{'recursive_anchor_uri'} // $state->{'initial_schema_uri'}
346 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
353 28 13 39 not $schema->{'$recursiveAnchor'} or exists $state->{'recursive_anchor_uri'}
415 62 0 222 $type eq $_ or $_ eq "number" and $type eq "integer"
427 2257 180 935 $type eq $schema->{'type'} or $schema->{'type'} eq "number" and $type eq "integer"
180 20 915 $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 12 586 ref($data) =~ /^Math::Big(?:Int|Float)$/u or ref($schema->{'multipleOf'}) =~ /^Math::Big(?:Int|Float)$/u
701 230 40 28 exists $schema->{'then'} or exists $schema->{'else'}
721 92 18 89 not exists $data->{$property} or _eval_subschema($data, $schema->{'dependentSchemas'}{$property}, {%$state, "schema_path", jsonp($state->{'schema_path'}, "dependentSchemas", $property)})
760 54 9 43 not exists $data->{$property} or _eval_subschema($data, $schema->{'dependencies'}{$property}, {%$state, "schema_path", jsonp($state->{'schema_path'}, "dependencies", $property)})
866 0 20 0 exists $schema->{'prefixItems'} || $state->{'keyword'} eq 'additionalItems'
881 17 36 138 exists $schema->{'prefixItems'} || $state->{'keyword'} eq 'additionalItems'
900 124 18 42 !exists $schema->{'maxContains'} || $state->{'_num_contains'} > $schema->{'maxContains'}
905 195 0 12 ($schema->{'minContains'} // 1) > 0 || $state->{'spec_version'} && $state->{'spec_version'} eq 'draft7'
1047 15805 6057 2879 $type eq "string" or $type eq "number"
21862 2861 18 $type eq "string" or $type eq "number" or $type eq "integer"
1056 351 4707 997 ref($value) =~ /^Math::Big(?:Int|Float)$/u || !($flags & 1024) && $flags & 768
1061 95 2719 45 ref($value) =~ /^Math::Big(?:Int|Float)$/u && $value->is_int || !($flags & 1024) && $flags & 768 && int $value == $value
1169 77 8652 576 $uri eq "" and $keyword_location eq "" or ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1215 0 0 2203 fc "Mojo::URL"->new($ref)->to_unsafe_string ne fc $ref or $ref =~ /[^[:ascii:]]/u
0 0 2203 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
1226 4 5156 0 $override // $$schema{$state->{'keyword'}}
1229 0 0 5160 fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u
0 0 5160 fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or not $uri->is_abs
0 0 5160 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