Branch Coverage

blib/lib/JSON/Schema/Modern/Utilities.pm
Criterion Covered Total %
branch 162 186 87.1


line true false branch
87 113 87535 if ($type eq "null")
90 11231 76304 if ($type eq "boolean")
93 19901 56403 if ($type eq "object")
96 14093 42310 if ($type eq "array")
100 11971 16 if ($type eq "string" or $type eq "number" or $type eq "integer")
101 20 42274 unless defined $value
109 30307 11967 if ($type eq "string")
118 8048 3919 if ($type eq "number")
123 3919 0 if ($type eq "integer")
124 17 3902 if ($$config{'legacy_ints'}) { }
141 11 5 if ($type =~ /^reference to (.+)\z/u)
153 74596 47718 if ref $value eq "HASH"
154 11400 36318 if is_bool($value)
155 586 35732 unless defined $value
156 5865 29867 if ref $value eq "ARRAY"
159 880 28987 if (length(my $ref = ref $value))
161 327 320 !$$config{'legacy_ints'} && $value->is_int ? :
7 64 defined builtin::blessed($value) ? :
647 71 $ref eq 'Math::BigFloat' ? :
162 718 $ref eq 'Math::BigInt' ? :
177 22083 15 if $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\x51\x55\x55\x55\x55\x55"} 0 + $value eq $value }
179 316 6588 if ($$config{'legacy_ints'}) { }
182 313 3 $flags & 256 && !($flags & 512) ? :
316 0 if &created_as_number($value)
189 6531 42 int $value == $value ? :
6573 15 if &created_as_number($value)
201 83544 4 unless builtin::is_bool($value)
210 24599 34374 unless ref $value eq "HASH"
229 3 16755 if grep(($types[$_] eq "ambiguous type"), (0, 1))
232 88 16667 if ($$state{"scalarref_booleans"})
233 14 74 if $types[0] eq "reference to SCALAR"
234 18 70 if $types[1] eq "reference to SCALAR"
237 16 16739 if ($$state{"stringy_numbers"})
238 5 3 int 0 + $x == $x ? :
8 8 if $types[0] eq "string" and &looks_like_number($x)
241 4 1 int 0 + $y == $y ? :
5 11 if $types[1] eq "string" and &looks_like_number($y)
245 1355 15400 if $types[0] ne $types[1]
246 32 15368 if $types[0] eq "null"
247 9249 6119 if $types[0] eq "string"
249 2088 4031 if grep(($types[0] eq $_), ("boolean", "number", "integer"))
253 1673 2358 if ($types[0] eq "object")
254 23 1650 if keys %$x != keys %$y
257 9 1641 unless (is_equal(my $arr_x = [sort(keys %$x)], my $arr_y = [sort(keys %$y)], scalar(my $s = {})))
265 127 3811 unless is_equal($$x{$property}, $$y{$property}, $state)
271 2358 0 if ($types[0] eq "array")
272 11 2347 if @$x != @$y
275 196 5257 unless is_equal($$x[$idx], $$y[$idx], $state)
293 280 1843 if (is_equal($$array[$idx0], $$array[$idx1], $state))
294 280 0 if exists $$state{"equal_indices"}
306 0 51580 if length $_[0] and substr($_[0], 0, 1) ne "/"
312 0 0 if length $_[0] and substr($_[0], 0, 1) ne "/"
323 2 17410 unless grep((ref $data eq $_), ("HASH", "ARRAY")) or defined wantarray
327 17412 56 unless (length $pointer)
328 17410 2 if (not ref $data or ref $data ne ref $value)
329 17408 2 if defined wantarray
333 1 1 if (ref $value eq "HASH")
334 0 1 unless ref $data
337 1 1 if (ref $value eq "ARRAY")
338 0 1 unless ref $data
345 56 0 length $pointer ? :
348 1 46 if @keys >= 2 and not $keys[1] =~ /^(?:\d+|-)\z/a and ref $data eq "ARRAY" and not defined wantarray
356 45 68 if not ref $$curp or ref $$curp eq "ARRAY" and not $key =~ /^(?:\d+|-)\z/a
364 25 2 $key =~ /^\d+\z/a ? :
86 27 ref $$curp eq 'HASH' || !($key =~ /^(?:\d+|-)\z/a) ? :
411 68 46 if (not $document and my $filename = get_schema_filename($uri))
413 0 68 unless -f $file
425 0 68 if $document->has_errors
435 11 103 unless $document
460 21446 12799 unless @extra_path or length $$state{"keyword_path"}
462 0 12799 @extra_path ? :
463 0 12799 unless length $fragment
484 0 13954 unless defined wantarray
488 1 13953 defined $sps && ref $sps eq 'ARRAY' ? :
508 266 13688 $$state{'traverse'} ? :
7131 6823 @args ? :
266 13688 $$state{'traverse'} ? :
530 3686 8342 $$state{'specification_version'} =~ /^draft[467]\z/u ? :
9390 2638 unless $$state{"collect_annotations"} & ($$state{"specification_version"} =~ /^draft[467]\z/u ? '18446744073709551359' : '18446744073709551615')
546 37 2601 $$state{'_unknown'} ? :
558 0 34 if $$state{"traverse"}
563 0 0 unless defined wantarray
564 0 0 unless exists $$schema{$$state{"keyword"}}
569 0 42348 unless defined wantarray
570 42331 17 if is_type($type, $$schema{$$state{"keyword"}})
571 3 14 $type =~ /^[aeiou]/u ? :
575 0 2875 unless defined wantarray
588 0 5886 unless defined wantarray
593 26 2595 if fc "Mojo::URL"->new($string)->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or $string =~ /#/u and not $string =~ /#\z/u and not $string =~ /#[A-Za-z_][A-Za-z0-9_:.-]*\z/u and not $string =~ m[#/(?:[^~]|~[01])*\z]u
606 0 6199 unless defined wantarray
611 8 1 if fc $uri->to_unsafe_string ne fc $string or $string =~ /[^[:ascii:]]/u or not $uri->is_abs or $string =~ /#/u and not $string =~ /#\z/u and not $string =~ /#[A-Za-z][A-Za-z0-9_:.-]*\z/u and not $string =~ m[#/(?:[^~]|~[01])*\z]u
628 102 1036 ref $$schema{$$state{'keyword'}} ? :
633 121 1184 is_bignum($value) ? :