Branch Coverage

blib/lib/JSON/Schema/Modern/Utilities.pm
Criterion Covered Total %
branch 160 182 87.9


line true false branch
83 113 87488 if ($type eq "null")
86 11230 76258 if ($type eq "boolean")
89 19889 56369 if ($type eq "object")
92 14092 42277 if ($type eq "array")
96 11971 16 if ($type eq "string" or $type eq "number" or $type eq "integer")
97 20 42241 unless defined $value
105 30274 11967 if ($type eq "string")
114 8048 3919 if ($type eq "number")
119 3919 0 if ($type eq "integer")
120 17 3902 if ($$config{'legacy_ints'}) { }
137 11 5 if ($type =~ /^reference to (.+)\z/u)
149 71837 29807 if ref $value eq "HASH"
150 10537 19270 if is_bool($value)
151 562 18708 unless defined $value
152 2365 16343 if ref $value eq "ARRAY"
155 880 15463 if (length ref $value)
158 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' ? :
174 8767 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 }
176 316 6380 if ($$config{'legacy_ints'}) { }
179 313 3 $flags & 256 && !($flags & 512) ? :
316 0 if &created_as_number($value)
186 6323 42 int $value == $value ? :
6365 15 if &created_as_number($value)
198 65615 4 unless builtin::is_bool($value)
207 24582 34346 unless ref $value eq "HASH"
226 3 6451 if grep(($types[$_] eq "ambiguous type"), (0, 1))
229 88 6363 if ($$state{"scalarref_booleans"})
230 14 74 if $types[0] eq "reference to SCALAR"
231 18 70 if $types[1] eq "reference to SCALAR"
234 16 6435 if ($$state{"stringy_numbers"})
235 5 3 int 0 + $x == $x ? :
8 8 if $types[0] eq "string" and &looks_like_number($x)
238 4 1 int 0 + $y == $y ? :
5 11 if $types[1] eq "string" and &looks_like_number($y)
242 1355 5096 if $types[0] ne $types[1]
243 20 5076 if $types[0] eq "null"
244 2601 2475 if $types[0] eq "string"
246 1552 923 if grep(($types[0] eq $_), ("boolean", "number", "integer"))
250 315 608 if ($types[0] eq "object")
251 23 292 if keys %$x != keys %$y
254 9 283 unless (is_equal(my $arr_x = [sort(keys %$x)], my $arr_y = [sort(keys %$y)], scalar(my $s = {})))
262 127 206 unless is_equal($$x{$property}, $$y{$property}, $state)
268 608 0 if ($types[0] eq "array")
269 11 597 if @$x != @$y
272 196 457 unless is_equal($$x[$idx], $$y[$idx], $state)
290 280 1843 if (is_equal($$array[$idx0], $$array[$idx1], $state))
291 280 0 if exists $$state{"equal_indices"}
303 0 47930 if length $_[0] and substr($_[0], 0, 1) ne "/"
309 0 0 if length $_[0] and substr($_[0], 0, 1) ne "/"
316 2 35 unless (grep((ref $data eq $_), ("HASH", "ARRAY")))
317 1 1 if defined wantarray
322 6 29 unless (length $pointer)
323 4 2 if (ref $data eq "HASH" and ref $value ne "HASH" or ref $data eq "ARRAY" and ref $value ne "ARRAY")
325 2 2 if defined wantarray
329 1 1 if ref $data eq "HASH"
330 1 1 if ref $data eq "ARRAY"
334 29 0 length $pointer ? :
337 1 21 if @keys >= 2 and not $keys[1] =~ /^\d+\z/a and ref $data eq "ARRAY" and not defined wantarray
345 25 36 if not ref $$curp or ref $$curp eq "ARRAY" and not $key =~ /^\d+\z/a
353 42 19 ref $$curp eq 'HASH' || !($key =~ /^\d+\z/a) ? :
387 68 46 if (not $document and my $filename = get_schema_filename($uri))
389 0 68 unless -f $file
401 0 68 if $document->has_errors
411 11 103 unless $document
436 21431 12796 unless @extra_path or length $$state{"keyword_path"}
438 0 12796 @extra_path ? :
439 0 12796 unless length $fragment
460 0 13936 unless defined wantarray
464 1 13935 defined $sps && ref $sps eq 'ARRAY' ? :
484 266 13670 $$state{'traverse'} ? :
7113 6823 @args ? :
266 13670 $$state{'traverse'} ? :
506 3686 8322 $$state{'specification_version'} =~ /^draft[467]\z/u ? :
9370 2638 unless $$state{"collect_annotations"} & ($$state{"specification_version"} =~ /^draft[467]\z/u ? '18446744073709551359' : '18446744073709551615')
522 37 2601 $$state{'_unknown'} ? :
534 0 34 if $$state{"traverse"}
539 0 0 unless defined wantarray
540 0 0 unless exists $$schema{$$state{"keyword"}}
545 0 42311 unless defined wantarray
546 42294 17 if is_type($type, $$schema{$$state{"keyword"}})
547 3 14 $type =~ /^[aeiou]/u ? :
551 0 2875 unless defined wantarray
564 0 5886 unless defined wantarray
569 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
582 0 6199 unless defined wantarray
587 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
604 102 1036 ref $$schema{$$state{'keyword'}} ? :
609 121 1184 is_bignum($value) ? :