Branch Coverage

blib/lib/JSON/Validator/Util.pm
Criterion Covered Total %
branch 87 92 94.5


line true false branch
29 14 4 $class ? :
30 4 14 unless (@classes)
33 10 12 unless $class =~ /$skip_re/
41 5 17 unless my $text = Mojo::Loader::data_section($class, $file)
43 17 0 if $params->{'encoding'}
48 0 1 unless $params->{'confess'}
50 3 0 @$_ == 1 ? :
57 317 1000 if $ref eq 'HASH'
58 127 873 if $ref and not $blessed
59 18 855 unless defined $_[0]
60 41 3 if $blessed and "$_[0]" eq '1' || !"$_[0]"
62 193 621 if (is_type($_[0], 'NUM'))
63 50 143 unless $_[1]
91 102 if grep {($_->{'type'} // '') eq 'integer';} @{[] unless $_[1];}
73 21499 90478 if ($type eq 'BOOL')
79 1976 88502 if ($type eq 'NUM')
87 10994 77508 &blessed($_[0]) ? :
92 3 0 length $p ? :
9 3 ref $p ? :
93 3 9 if @$p and defined $p->[0] and not length $p->[0]
121 141 1996 if $_[0]{'type'}
122 16 1980 if $_[0]{'additionalProperties'}
123 19 1961 if $_[0]{'patternProperties'}
124 103 1858 if $_[0]{'properties'}
125 1 1857 if $_[0]{'propertyNames'}
126 2 1855 if $_[0]{'required'}
129 8 1847 if defined $_[0]{'maxProperties'} or defined $_[0]{'minProperties'}
130 2 1845 if $_[0]{'additionalItems'}
131 16 1829 if $_[0]{'items'}
132 13 1816 if $_[0]{'uniqueItems'}
135 16 1800 if defined $_[0]{'maxItems'} or defined $_[0]{'minItems'}
136 40 1760 if $_[0]{'pattern'}
139 29 1731 if defined $_[0]{'maxLength'} or defined $_[0]{'minLength'}
140 12 1719 if $_[0]{'multipleOf'}
143 33 1686 if defined $_[0]{'maximum'} or defined $_[0]{'minimum'}
144 17 1669 if exists $_[0]{'const'}
150 37 273 unless defined $_[1]
151 254 19 if $_[0] eq data_type($_[1], [{'type', $_[0]}])
161 9 35 unless (defined $p)
167 2 0 ref $data eq 'HASH' ? :
7 2 ref $data eq 'ARRAY' ? :
174 4 31 if $cb
176 26 9 if (ref $data eq 'HASH' and exists $data->{$p}) { }
2 7 elsif (ref $data eq 'ARRAY' and $p =~ /^\d+$/ and @$data > $p) { }
186 3 25 if ref $data eq 'HASH' and $tied = tied %$data
189 2 15 if $cb