Condition Coverage

blib/lib/JSON/Schema/Tiny.pm
Criterion Covered Total %
condition 341 425 80.2


and 2 conditions

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

and 3 conditions

line !l l&&!r l&&r condition
64 152 15 12610 builtin::blessed($_[0]) and builtin::blessed($_[0])->isa(__PACKAGE__)
70 12627 1 3 not $SPECIFICATION_VERSION =~ /^draft/u and &any(sub { 'draft' . $SPECIFICATION_VERSION eq $_; } , values %version_uris)
168 332 7463 12707 $spec_version && $spec_version =~ qr/^draft(?:7|2019-09)$/u
204 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"
216 23406 4620 3656 not $valid and $$state{"short_circuit"}
250 1 5612 1 defined $SPECIFICATION_VERSION and $SPECIFICATION_VERSION ne $spec_version
255 5256 356 1 exists $$schema{"\$ref"} and $spec_version eq "draft7"
302 8 0 0 is_type("boolean", $$subschema{"\$recursiveAnchor"}) and $$subschema{"\$recursiveAnchor"}
358 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
429 205 15 9 $_ eq "boolean" and $SCALARREF_BOOLEANS
15 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
68 0 4 $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data)
68 4 0 $type eq "string" and $STRINGY_NUMBERS and &looks_like_number($data) and $_ eq 'number' || $_ eq 'integer' && $data == int $data
445 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"
472 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 }
495 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)
503 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)
511 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)
519 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)
702 286 47 44 @valid > 1 and $$state{"short_circuit"}
847 88 12 75 $$state{"short_circuit"} and not exists $$schema{$$state{"keyword"} eq "prefixItems" ? "items" : ($$state{"keyword"} eq "items" ? "additionalItems" : die())}
862 561 83 32 is_type("boolean", $$schema{$$state{"keyword"}}) and $$state{"keyword"} eq "additionalItems"
901 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)
906 293 211 0 not $$state{"_num_contains"} and ($$schema{'minContains'} // 1) > 0 || $$state{'spec_version'} && $$state{'spec_version'} eq 'draft7'
981 349 89 114 exists $$schema{"properties"} and exists $$schema{"properties"}{$property}
983 290 60 88 exists $$schema{"patternProperties"} and &any(sub { $property =~ /(?:$_)/u; } , keys %{$$schema{"patternProperties"}})
1067 698 3 16144 !Ref::Util::XS::is_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\x55\x55\x55"} 0 + $value eq $value })
1085 0 0 11 !builtin::blessed($value) && ref $value eq $1
1120 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\x55\x55\x55"} 0 + $value eq $value }
1137 14421 4642 0 not !builtin::blessed($value) and $value->isa('JSON::PP::Boolean') || $value->isa('Cpanel::JSON::XS::Boolean') || $value->isa('JSON::XS::Boolean')
1171 5 5 8 $types[0] eq "string" and &looks_like_number($x)
1174 8 5 5 $types[1] eq "string" and &looks_like_number($y)
1258 9425 417 1 defined $sps && Ref::Util::XS::is_plain_arrayref($sps)
1265 9765 1 77 $uri eq "" and $keyword_location eq ""
875 452 8439 ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1306 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
1321 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
166 20170 332 $$state{"spec_version"} // ""
220 17629 274 $removed_keywords{$spec_version} // {}
266 1311 388 $uri->fragment // ""
272 426 1175 $$state{"root_schema"}{"\$id"} // ""
274 1117 15 $uri->fragment // ""
290 52 0 $uri->fragment // ""
297 44 8 $$state{"root_schema"}{"\$id"} // ""
325 661 9 $$state{"spec_version"} // ""
358 6 0 $$schema{"\$anchor"} // ""
6 0 $$schema{"\$anchor"} // ""
423 0 6 $type // ""
1355 42 $type // ""
439 2 0 $$schema{"type"} // ""
16514 0 $$schema{"type"} // ""
808 699 1 $$state{"spec_version"} // ""
813 88 516 $$state{"_last_items_index"} //= -1
901 42 102 $$schema{"minContains"} // 1
1158 672 3499 $$state{"path"} //= ""
1247 1498 15103 $uri->fragment // ""
1265 9765 1 $uri->fragment // ""

or 3 conditions

line l !l&&r !l&&!r condition
58 32 0 12745 $SCALARREF_BOOLEANS // $MOJO_BOOLEANS
64 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
78 14 6303 6459 $BOOLEAN_RESULT || $SHORT_CIRCUIT
106 6270 6506 0 $valid or @{$$state{"errors"}}
148 338 0 413 $schema || E($state, 'subschema is false')
168 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'
304 0 0 0 $$state{"recursive_anchor_uri"} // $$state{"initial_schema_uri"}
358 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
365 28 13 51 not $$schema{"\$recursiveAnchor"} or exists $$state{"recursive_anchor_uri"}
429 62 0 230 $type eq $_ or $_ eq "number" and $type eq "integer"
1 0 3 $_ eq 'number' || $_ eq 'integer' && $data == int $data
0 0 230 $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
445 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"
472 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 }
475 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"
495 387 2 194 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
503 291 2 188 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
511 506 2 203 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
519 231 2 188 is_type("number", $data) or $STRINGY_NUMBERS and is_type("string", $data) and &looks_like_number($data)
717 55 0 57 !$$schema{'not'} || E($state, 'subschema is true')
726 230 52 44 exists $$schema{"then"} or exists $$schema{"else"}
734 20 0 12 $$schema{$keyword} || E({%$state, 'keyword', $keyword}, 'subschema is false')
750 132 34 97 not exists $$data{$property} or _eval_subschema($data, $$schema{"dependentSchemas"}{$property}, {%$state, "schema_path", jsonp($$state{"schema_path"}, "dependentSchemas", $property)})
789 58 9 47 not exists $$data{$property} or _eval_subschema($data, $$schema{"dependencies"}{$property}, {%$state, "schema_path", jsonp($$state{"schema_path"}, "dependencies", $property)})
867 0 26 0 exists $$schema{'prefixItems'} || $$state{'keyword'} eq 'additionalItems'
882 19 40 144 exists $$schema{'prefixItems'} || $$state{'keyword'} eq 'additionalItems'
901 126 18 42 !exists($$schema{'maxContains'}) || $$state{'_num_contains'} > $$schema{'maxContains'}
906 195 0 16 ($$schema{'minContains'} // 1) > 0 || $$state{'spec_version'} && $$state{'spec_version'} eq 'draft7'
1053 16859 6145 2907 $type eq "string" or $type eq "number"
23004 2891 16 $type eq "string" or $type eq "number" or $type eq "integer"
1072 363 4755 1025 is_bignum($value) || &created_as_number($value)
1078 100 2741 48 is_bignum($value) && $value->is_int || &created_as_number($value) && int $value == $value
1120 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\x55\x55\x55"} 0 + $value eq $value }
1137 4240 0 402 $value->isa('JSON::PP::Boolean') || $value->isa('Cpanel::JSON::XS::Boolean') || $value->isa('JSON::XS::Boolean')
1245 9843 6758 14011 @extra_path or length $$state{"schema_path"}
1258 417 9348 77 $sps // ()
1265 77 9114 652 $uri eq "" and $keyword_location eq "" or ($uri->fragment // "") eq $keyword_location and $uri->clone->fragment(undef) eq ""
1306 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
1318 4 5644 0 $override // $$schema{$$state{"keyword"}}
1321 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