Branch Coverage

blib/lib/JSON/Lines.pm
Criterion Covered Total %
branch 87 130 66.9


line true false branch
14 0 4 scalar @_ == 1 ? :
19 0 2 $args{'file'} ? :
2 2 if $args{'encode'}
23 0 2 $args{'file'} ? :
2 0 if $args{'decode'}
26 0 40 scalar @_ == 1 ? :
34 4 5 if @_ == 1
40 3 4 if @_ == 1
46 3 3 if @_ == 1
52 3 2 if @_ == 1
58 3 2 if @_ == 1
64 3 2 if @_ == 1
69 9 9 scalar @_ == 1 ? :
71 2 16 if $self->{'parse_headers'}
75 0 66 if ($@) { }
76 0 0 if ($self->{'error_cb'}) { }
82 0 66 if $self->{'success_cb'}
83 18 48 $json =~ /\n$/ ? :
97 2 158 if (defined $self->{'_buffer'} and length $self->{'_buffer'})
105 138 224 if ($string =~ /\G[\s\n]+/cg)
111 219 5 if (defined $obj) { }
0 5 elsif ($regex_matched) { }
115 0 0 if $chars_consumed > 0
116 0 0 if $chars_consumed == 0
118 4 1 if ($remaining =~ /^[\[\{]/)
122 1 0 if ($string =~ /\G[^\[\{]+/cg) { }
131 1 159 if $self->{'parse_headers'}
132 154 6 wantarray ? :
152 0 2 if (defined $fh) { }
170 1 2 if eof $fh
172 0 1 wantarray ? :
177 3 14 if (@{$self->{'_line_buffer'};})
182 2 12 if $line eq "" and eof $fh
184 0 12 unless @objects
192 7 9 $index =~ /:/ ? :
197 9 7 if ($seek)
204 2 14 if ($target_line < $self->{'_line_pos'}{$fh_id})
213 1 15 if eof $fh
214 0 15 if (exists $self->{'_parsed_lines'}{$fh_id}{$target_line})
216 0 0 unless $line_objects and @$line_objects > $target_offset
225 0 15 unless $line =~ /^$LINES/
228 0 15 unless @objects > $target_offset
234 1 2 if (ref $fh ne "GLOB")
236 0 1 unless open my $ffh, "<", $file
245 29 0 if ($line =~ /^$LINES/)
250 1 2 unless ($in_fh)
254 0 3 if $end > $#all_objects
256 0 3 if ($out_file)
257 0 0 unless open my $cfh, ">", $out_file
266 0 7 unless defined $key
276 0 40 unless $line =~ /^$LINES/
283 19 26 ref $key eq 'CODE' ? :
284 10 35 @objects > 1 ? :
293 1 223 unless $string =~ /^[\[\{]/
294 219 4 if ($string =~ /^($LINES)/)
298 0 219 if ($@)
301 1 218 if $self->{'success_cb'}
309 0 0 if ($@)
310 0 0 if ($self->{'error_cb'}) { }
316 0 0 if $self->{'success_cb'}
322 2 0 unless (@headers)
323 0 2 if (ref $data[0] eq 'ARRAY') { }
340 0 5 ref $d eq 'ARRAY' ? :
351 0 1 unless ref $data[0] eq "ARRAY"
360 0 2 ref $d eq 'HASH' ? :