Branch Coverage

blib/lib/App/yajg.pm
Criterion Covered Total %
branch 91 130 70.0


line true false branch
19 0 7 if `which highlight 2>/dev/null`
39 114 24 unless ref $_[0] eq 'ARRAY' and @{$_[0];}
44 3 3 wantarray ? :
4 6 ref $_[0] eq 'HASH' ? :
4 10 ref $_[0] eq 'ARRAY' ? :
53 0 0 if utf8::is_utf8($_)
55 0 0 if $@
56 0 0 unless ref $_
72 117 348 if (s/^\{(.*)\}$/$1/u) { }
114 234 elsif (s/^\[(.*)\]$/$1/u) { }
116 118 elsif (s[^/(.*)/$][$1]u) { }
74 3 114 if ($args->{'ignore_case'})
88 42 243 unless length $_
89 3 240 unless (/^[+-]?[0-9]++$/u)
96 5 109 if $err or not @$list
105 3 113 if $args->{'ignore_case'}
106 2 114 unless eval { do { $_ = qr/$pat/u } }
114 3 115 if ($args->{'ignore_case'})
131 107 124 unless @_
133 18 106 unless ref $data ~~ ['HASH', 'ARRAY']
138 57 49 if (ref $data eq 'HASH') { }
49 0 elsif (ref $data eq 'ARRAY') { }
141 2 31 unless exists $data->{$val}
143 2 29 if @_ and not defined $selected
150 0 8 if @_ and not defined $selected
153 4 2 %selected ? :
159 0 12 if @_ and not defined $selected
162 6 1 %selected ? :
171 0 7 unless @slice
175 0 23 if @_ and not defined $selected
178 7 0 @selected ? :
184 8 20 if @_ and not defined $selected
187 5 3 @selected ? :
190 1 23 unless $val =~ /^[+-]?[0-9]++$/u
191 2 21 unless exists $data->[$val]
193 0 21 if @_ and not defined $selected
206 9 112 unless defined $key_pat or defined $val_pat
212 0 112 if (++$r > 300)
218 12 100 unless ref $data ~~ ['ARRAY', 'HASH']
222 0 100 if $visited->{$data}
226 61 39 if (ref $data eq 'HASH') { }
39 0 elsif (ref $data eq 'ARRAY') { }
229 41 96 if (defined $key_pat and not defined $val_pat and /$key_pat/u or not ref $data->{$_} and defined $data->{$_} and !defined($key_pat) || /$key_pat/u and !defined($val_pat) || ($data->{$_} =~ /$val_pat/u xor $i) or $i and defined $val_pat and !defined($data->{$_}) || ref $data->{$_} && !&size($data->{$_})) { }
46 50 elsif (ref $data->{$_} ~~ ['ARRAY', 'HASH']) { }
249 16 30 if &size($filtered)
259 32 73 if (ref $_ ~~ ['HASH', 'ARRAY']) { }
26 51 elsif (defined $val_pat and defined $_ && !ref($_) && (/$val_pat/u xor $i) || $i && (!defined($_) || ref $_ && !&size($_))) { }
261 15 17 if &size($filtered)
279 0 10 if @_ == 1
283 9 1 if (@_ > 2)
288 0 10 unless &size($hooks)
290 0 10 if (++$r > 300)
295 3 7 if (ref $_[0] eq 'HASH') { }
1 6 elsif (ref $_[0] eq 'ARRAY') { }
296 1 2 if $$visited{$_[0]}
301 0 1 if $$visited{$_[0]}
313 0 0 unless $CAN{'highlight'}
317 0 0 unless (defined $pid)
323 0 0 unless ($pid)
324 0 0 unless open my $hl_in, '|-', 'highlight', '-O', 'ansi', '-S', $lang
326 0 0 if utf8::is_utf8($string)
335 0 0 unless $? == 0
336 0 0 if $utf8 and not utf8::is_utf8($highlighted)
409 0 0 unless $OUT{$output}
411 0 0 if not $CAN{'ddp'} and $output eq 'ddp'