Condition Coverage

blib/lib/JSON/Schema/Tiny.pm
Criterion Covered Total %
condition 344 425 80.9


and 2 conditions

line l !l condition
1178 855 678 $x eq $y && (return 1)
1180 497 658 $x == $y && (return 1)

and 3 conditions

line !l l&&!r l&&r condition
63 152 15 12610 builtin::blessed($_[0]) and builtin::blessed($_[0])->isa(__PACKAGE__)
69 12627 1 3 not $SPECIFICATION_VERSION =~ /^draft/u and CORE::any {'draft' . $SPECIFICATION_VERSION eq $_;} values %version_uris
167 332 7463 12707 $spec_version && $spec_version =~ qr/^draft(?:7|2019-09)$/u
203 1687 150 32459 $keyword ne "\$ref" and $keyword ne "definitions"
1837 31734 725 $keyword ne "\$ref" and $keyword ne "definitions" and exists $$schema{"\$ref"}
31884 710 15 $keyword ne "\$ref" and $keyword ne "definitions" and exists $$schema{"\$ref"} and $spec_version eq "draft7"
215 23406 4620 3656 not $valid and $$state{"short_circuit"}
249 1 5612 1 defined $SPECIFICATION_VERSION and $SPECIFICATION_VERSION ne $spec_version
254 5256 356 1 exists $$schema{"\$ref"} and $spec_version eq "draft7"
301 8 0 0 is_type("boolean", $$subschema{"\$recursiveAnchor"}) and $$subschema{"\$recursiveAnchor"}
357 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
428 205 15 9 $_ eq "boolean" and $SCALARREF_BOOLEANS
220 7 2 $_ eq "boolean" and $SCALARREF_BOOLEANS and $type eq "reference to SCALAR"
227 3 0 $_ eq "number" and $type eq "integer"
158 68 4 $type eq "string" and $STRINGY_NUMBERS
226 0 4 $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data)
226 3 1 $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data) and $_ eq 'number' || $_ eq 'integer' && $data == int $data
444 838 150 214 $$schema{"type"} eq "number" and $type eq "integer"
636 350 2 $type eq "string" and $STRINGY_NUMBERS
350 0 2 $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data)
350 2 0 $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data) and $$schema{'type'} eq 'number' || $$schema{'type'} eq 'integer' && $data == int $data
872 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"
471 190 0 2 $STRINGY_NUMBERS and is_type("string", $data)
190 0 2 $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
0 0 2 $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data) and do { $data = 0 + $data; 1 }
494 195 0 1 $STRINGY_NUMBERS and is_type("string", $data)
195 0 1 $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
502 189 0 1 $STRINGY_NUMBERS and is_type("string", $data)
189 0 1 $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
510 204 0 1 $STRINGY_NUMBERS and is_type("string", $data)
204 0 1 $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
518 189 0 1 $STRINGY_NUMBERS and is_type("string", $data)
189 0 1 $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
701 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 561 83 32 is_type("boolean", $$schema{$$state{"keyword"}}) and $$state{"keyword"} eq "additionalItems"
900 204 42 144 $$state{"short_circuit"} and !exists($$schema{'maxContains'}) || $$state{'_num_contains'} > $$schema{'maxContains'}
42 18 126 $$state{"short_circuit"} and !exists($$schema{'maxContains'}) || $$state{'_num_contains'} > $$schema{'maxContains'} and $$state{"_num_contains"} >= ($$schema{"minContains"} // 1)
905 293 211 0 not $$state{"_num_contains"} and ($$schema{'minContains'} // 1) > 0 || $$state{'spec_version'} && $$state{'spec_version'} eq 'draft7'
980 349 89 114 exists $$schema{"properties"} and exists $$schema{"properties"}{$property}
982 290 60 88 exists $$schema{"patternProperties"} and CORE::any {$property =~ /(?:$_)/u;} keys %{$$schema{"patternProperties"}}
1066 698 3 16144 !length(ref $value) && $flags & 1024 && (!($flags & 768) || do { BEGIN {${^WARNING_BITS} = "\xdd\x7f\xf7\xc3\xd7\xff\xf5\xff\xff\xff\xff\xff\xf5\xd7\xf4\xd7\x15\x50\x55\x15\x55\x55\x55"} 0 + $value eq $value })
1084 0 0 11 !builtin::blessed($value) && ref $value eq $1
1118 4372 4519 135 $flags & 1024 and !($flags & 768) || do { BEGIN {${^WARNING_BITS} = "\xdd\x7f\xf7\xc3\xd7\xff\xf5\xff\xff\xff\xff\xff\xf5\xd7\xf4\xd7\x15\x50\x55\x15\x55\x55\x55"} 0 + $value eq $value }
1135 14421 4642 0 not !builtin::blessed($value) and $value->isa('JSON::PP::Boolean') || $value->isa('Cpanel::JSON::XS::Boolean') || $value->isa('JSON::XS::Boolean')
1169 5 5 8 $types[0] eq "string" and &looks_like_number($x)
1172 8 5 5 $types[1] eq "string" and &looks_like_number($y)
1256 9425 417 1 defined $sps && ref $sps eq 'ARRAY'
1263 9765 1 77 $uri eq "" and $keyword_location eq ""
875 452 8439 ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1304 1041 151 1229 $string =~ /#/u and not $string =~ /#$/u
1192 100 1129 $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u
251 1129 0 $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $string =~ m[#/(?:[^~]|~[01])*$]u
1319 5647 1 0 $string =~ /#/u and not $string =~ /#$/u
5648 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
165 20170 332 $$state{"spec_version"} // ""
219 17629 274 $removed_keywords{$spec_version} // {}
265 1311 388 $uri->fragment // ""
271 426 1175 $$state{"root_schema"}{"\$id"} // ""
273 1117 15 $uri->fragment // ""
289 52 0 $uri->fragment // ""
296 44 8 $$state{"root_schema"}{"\$id"} // ""
324 661 9 $$state{"spec_version"} // ""
357 6 0 $$schema{"\$anchor"} // ""
6 0 $$schema{"\$anchor"} // ""
422 0 6 $type // ""
1355 42 $type // ""
438 2 0 $$schema{"type"} // ""
16514 0 $$schema{"type"} // ""
807 699 1 $$state{"spec_version"} // ""
812 88 516 $$state{"_last_items_index"} //= -1
900 42 102 $$schema{"minContains"} // 1
1156 672 3499 $$state{"path"} //= ""
1245 1498 15103 $uri->fragment // ""
1263 9765 1 $uri->fragment // ""

or 3 conditions

line l !l&&r !l&&!r condition
57 32 0 12745 $SCALARREF_BOOLEANS // $MOJO_BOOLEANS
63 0 0 12610 $_[0]{"boolean_result"} // $BOOLEAN_RESULT
6300 0 6310 $_[0]{"short_circuit"} // $SHORT_CIRCUIT
3 12607 0 $_[0]{"max_traversal_depth"} // $MAX_TRAVERSAL_DEPTH
0 0 12610 $_[0]{"scalarref_booleans"} // $SCALARREF_BOOLEANS
0 0 12610 ($_[0]{"scalarref_booleans"} // $SCALARREF_BOOLEANS) // $_[0]{"mojo_booleans"}
0 0 12610 $_[0]{"stringy_numbers"} // $STRINGY_NUMBERS
12607 0 3 $_[0]{"specification_version"} // $SPECIFICATION_VERSION
77 14 6303 6459 $BOOLEAN_RESULT || $SHORT_CIRCUIT
105 6270 6506 0 $valid or @{$$state{"errors"}}
147 338 0 413 $schema || E($state, 'subschema is false')
167 332 15081 5089 !$spec_version || $spec_version ne 'draft7'
332 7618 12552 !$spec_version || $spec_version eq 'draft2019-09'
332 7463 12707 !$spec_version || $spec_version eq 'draft2020-12'
332 7618 12552 !$spec_version || $spec_version eq 'draft2019-09'
332 7463 12707 !$spec_version || $spec_version eq 'draft2020-12'
332 15081 5089 !$spec_version || $spec_version ne 'draft7'
332 5089 15081 !$spec_version || $spec_version eq 'draft7'
332 15081 5089 !$spec_version || $spec_version ne 'draft7'
332 15081 5089 !$spec_version || $spec_version ne 'draft7'
332 5089 15081 !$spec_version || $spec_version eq 'draft7'
332 12707 7463 !$spec_version || $spec_version =~ qr/^draft(?:7|2019-09)$/u
332 15081 5089 !$spec_version || $spec_version ne 'draft7'
332 15081 5089 !$spec_version || $spec_version ne 'draft7'
332 15081 5089 !$spec_version || $spec_version ne 'draft7'
303 0 0 0 $$state{"recursive_anchor_uri"} // $$state{"initial_schema_uri"}
357 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
364 28 13 51 not $$schema{"\$recursiveAnchor"} or exists $$state{"recursive_anchor_uri"}
428 62 0 230 $type eq $_ or $_ eq "number" and $type eq "integer"
1 0 3 $_ eq 'number' || $_ eq 'integer' && $data == int $data
62 1 229 $type eq $_ or $_ eq "number" and $type eq "integer" or $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data) and $_ eq 'number' || $_ eq 'integer' && $data == int $data
444 2333 214 988 $type eq $$schema{"type"} or $$schema{"type"} eq "number" and $type eq "integer"
1 0 1 $$schema{'type'} eq 'number' || $$schema{'type'} eq 'integer' && $data == int $data
214 0 988 $type eq $$schema{"type"} or $$schema{"type"} eq "number" and $type eq "integer" or $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data) and $$schema{'type'} eq 'number' || $$schema{'type'} eq 'integer' && $data == int $data
0 20 967 $type eq $$schema{"type"} or $$schema{"type"} eq "number" and $type eq "integer" or $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data) and $$schema{'type'} eq 'number' || $$schema{'type'} eq 'integer' && $data == int $data or $$schema{"type"} eq "boolean" and $SCALARREF_BOOLEANS and $type eq "reference to SCALAR"
471 638 4 188 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data) and do { $data = 0 + $data; 1 }
474 30 18 592 is_bignum($data) or is_bignum($$schema{"multipleOf"})
48 0 592 is_bignum($data) or is_bignum($$schema{"multipleOf"}) or get_type($data) eq "number"
18 4 588 is_bignum($data) or is_bignum($$schema{"multipleOf"}) or get_type($data) eq "number" or get_type($$schema{"multipleOf"}) eq "number"
494 387 2 194 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
502 291 2 188 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
510 506 2 203 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
518 231 2 188 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
716 55 0 57 !$$schema{'not'} || E($state, 'subschema is true')
725 230 52 44 exists $$schema{"then"} or exists $$schema{"else"}
733 20 0 12 $$schema{$keyword} || E({%$state, 'keyword', $keyword}, 'subschema is false')
749 132 34 97 not exists $$data{$property} or _eval_subschema($data, $$schema{"dependentSchemas"}{$property}, {%$state, "schema_path", jsonp($$state{"schema_path"}, "dependentSchemas", $property)})
788 58 9 47 not exists $$data{$property} or _eval_subschema($data, $$schema{"dependencies"}{$property}, {%$state, "schema_path", jsonp($$state{"schema_path"}, "dependencies", $property)})
866 0 26 0 exists $$schema{'prefixItems'} || $$state{'keyword'} eq 'additionalItems'
881 19 40 144 exists $$schema{'prefixItems'} || $$state{'keyword'} eq 'additionalItems'
900 126 18 42 !exists($$schema{'maxContains'}) || $$state{'_num_contains'} > $$schema{'maxContains'}
905 195 0 16 ($$schema{'minContains'} // 1) > 0 || $$state{'spec_version'} && $$state{'spec_version'} eq 'draft7'
1052 16859 6145 2907 $type eq "string" or $type eq "number"
23004 2891 16 $type eq "string" or $type eq "number" or $type eq "integer"
1071 363 4755 1025 is_bignum($value) || &created_as_number($value)
1077 100 2741 48 is_bignum($value) && $value->is_int || &created_as_number($value) && int $value == $value
1118 4631 8 15 !($flags & 768) || do { BEGIN {${^WARNING_BITS} = "\xdd\x7f\xf7\xc3\xd7\xff\xf5\xff\xff\xff\xff\xff\xf5\xd7\xf4\xd7\x15\x50\x55\x15\x55\x55\x55"} 0 + $value eq $value }
1135 4240 0 402 $value->isa('JSON::PP::Boolean') || $value->isa('Cpanel::JSON::XS::Boolean') || $value->isa('JSON::XS::Boolean')
1243 9843 6758 14011 @extra_path or length $$state{"schema_path"}
1256 417 9348 77 $sps // ()
1263 77 9114 652 $uri eq "" and $keyword_location eq "" or ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1304 0 0 2421 fc "Mojo::URL"->new($string)->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u
0 0 2421 fc "Mojo::URL"->new($string)->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or $string =~ /#/u and not $string =~ /#$/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*$/u and not $string =~ m[#/(?:[^~]|~[01])*$]u
1316 4 5644 0 $override // $$schema{$$state{"keyword"}}
1319 0 0 5648 fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u
0 0 5648 fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or not $uri->is_abs
0 0 5648 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