Branch Coverage

blib/lib/JSON/Validator/Util.pm
Criterion Covered Total %
branch 89 94 94.6


line true false branch
28 14 4 $class ? :
29 4 14 unless (@classes)
32 10 12 unless $class =~ /$skip_re/
40 5 17 unless my $text = Mojo::Loader::data_section($class, $file)
42 17 0 if $params->{'encoding'}
47 0 1 unless $params->{'confess'}
49 3 0 @$_ == 1 ? :
56 321 956 if $ref eq 'HASH'
57 121 835 if $ref and not $blessed
58 18 817 unless defined $_[0]
59 41 3 if $blessed and "$_[0]" eq '1' || !"$_[0]"
61 193 583 if (is_type($_[0], 'NUM'))
62 50 143 unless $_[1]
91 102 if grep {($_->{'type'} // '') eq 'integer';} @{[] unless $_[1];}
72 21438 90080 if ($type eq 'BOOL')
78 1935 88145 if ($type eq 'NUM')
86 10994 77151 &blessed($_[0]) ? :
91 3 0 length $p ? :
9 3 ref $p ? :
92 3 9 if @$p and defined $p->[0] and not length $p->[0]
120 140 1951 if $_[0]{'type'}
121 16 1935 if $_[0]{'additionalProperties'}
122 19 1916 if $_[0]{'patternProperties'}
123 106 1810 if $_[0]{'properties'}
124 1 1809 if $_[0]{'propertyNames'}
125 2 1807 if $_[0]{'required'}
126 1 1806 if $_[0]{'if'}
129 8 1798 if defined $_[0]{'maxProperties'} or defined $_[0]{'minProperties'}
130 2 1796 if $_[0]{'additionalItems'}
131 13 1783 if $_[0]{'items'}
132 13 1770 if $_[0]{'uniqueItems'}
135 13 1757 if defined $_[0]{'maxItems'} or defined $_[0]{'minItems'}
136 4 1753 if $_[0]{'pattern'}
139 29 1724 if defined $_[0]{'maxLength'} or defined $_[0]{'minLength'}
140 12 1712 if $_[0]{'multipleOf'}
143 33 1679 if defined $_[0]{'maximum'} or defined $_[0]{'minimum'}
144 17 1662 if exists $_[0]{'const'}
155 27 245 unless defined $_[1]
156 226 19 if $_[0] eq data_type($_[1], [{'type', $_[0]}])
166 9 35 unless (defined $p)
172 2 0 ref $data eq 'HASH' ? :
7 2 ref $data eq 'ARRAY' ? :
179 4 31 if $cb
181 26 9 if (ref $data eq 'HASH' and exists $data->{$p}) { }
2 7 elsif (ref $data eq 'ARRAY' and $p =~ /^\d+$/ and @$data > $p) { }
191 3 25 if ref $data eq 'HASH' and $tied = tied %$data
194 2 15 if $cb