Branch Coverage

lib/File/ByLine/Object.pm
Criterion Covered Total %
branch 167 218 76.6


line true false branch
46 11 24 if (scalar @_ == 0) { }
23 1 elsif (scalar @_ == 1) { }
50 1 22 unless (defined $file)
65 11 58 if (scalar @_ == 0) { }
58 0 elsif (scalar @_ == 1) { }
83 75 706 if (scalar @_ == 0) { }
705 1 elsif (scalar @_ == 1) { }
88 124 581 unless (_is_number($procs))
92 1 580 if ($procs < 1)
95 506 74 if ($procs > 1)
113 59 7 if (scalar @_ == 0) { }
7 0 elsif (scalar @_ == 1) { }
130 392 113 if (scalar @_ == 0) { }
113 0 elsif (scalar @_ == 1) { }
134 110 3 if (defined $code)
135 3 107 unless (_codelike($code))
138 0 107 if ($self->{'header_skip'})
156 276 50 if (scalar @_ == 0) { }
50 0 elsif (scalar @_ == 1) { }
159 0 49 if ($_[0] and $self->{'header_handler'})
175 12 7 if (scalar @_ == 0) { }
7 0 elsif (scalar @_ == 1) { }
191 3 811 if (scalar @_ == 1) { }
3 808 elsif (scalar @_ > 1) { }
195 1 2 if (scalar(@_) % 2) { }
222 13 9 if (exists $ATTRIBUTE{$key}) { }
7 2 elsif (exists $attr_short{$key}) { }
223 0 13 if (exists $set{$key})
235 0 7 if (exists $set{$key})
258 0 409 if (scalar @_ < 2)
261 3 406 unless (defined $file)
262 0 409 unless (defined $file)
263 308 101 unless (_listlike($file))
265 98 311 if (defined $self->{'header_handler'})
273 22 387 if ($self->{'processes'} == 1) { }
295 0 74 if (scalar @_ < 2)
296 0 74 if (scalar @_ > 3)
307 0 115 if (scalar @_ < 2)
308 0 115 if (scalar @_ > 3)
316 0 189 if (scalar @_ < 3)
317 0 189 if (scalar @_ > 4)
320 2 187 unless (defined $file)
321 0 189 unless (defined $file)
322 142 47 unless (_listlike($file))
324 4 185 if (defined $self->{'header_handler'})
336 74 115 if ($type eq 'grep') { }
115 0 elsif ($type eq 'map') { }
344 119 70 if ($procs > 1) { }
370 0 21 if (scalar @_ < 1)
373 5 16 unless (defined $file)
374 0 21 unless (defined $file)
375 19 2 unless (_listlike($file))
385 1 23 unless (defined $fh)
391 21 981 if ($lineno == 1)
392 4 17 if ($self->_handle_header($f, $_, 0, $fileno - 1))
411 0 149 unless (defined $fh)
415 149 0 if (defined $line)
444 0 70 unless (defined $fh)
451 8 64 if ($lineno == 1 and $self->_handle_header($f, $_, $part, $fileno - 1)) { }
454 19 45 if ($extended_info) { }
462 25 47 if ($end > 0 and tell $fh > $end)
495 0 119 unless (defined $fh)
504 6 586 if ($lineno == 1 and $self->_handle_header($f, $_, $part, $fileno - 1)) { }
0 586 elsif (not $part and $fileno == 1 and $lineno == 1 and $self->{'header_skip'}) { }
513 311 275 if ($isgrep) { }
514 3 308 if ($extended_info) { }
515 2 1 if (&$code($_, $extended))
519 258 50 if (&$code($_))
525 3 272 if ($extended_info) { }
534 27 565 if ($end > 0 and tell $fh > $end)
566 0 338 if (scalar @_ != 4)
569 0 338 unless (defined $parts)
570 0 338 unless (defined $part_number)
572 0 338 if ($parts <= $part_number)
575 0 338 if ($parts <= 0)
578 0 338 if ($part_number < 0)
583 0 338 unless (defined $fh)
588 0 338 if ($parts == 0)
598 21 317 if ($parts > $size)
599 9 12 if ($part_number > $size)
607 12 317 if ($parts == 0)
621 54 263 if ($part_number > 0)
626 263 54 if ($parts - 1 == $part_number)
632 2 52 if (tell $fh > $end)
641 0 362 if (scalar @_ != 2)
644 1 361 if (not -r $file and $self->{'skip_unreadable'}) { }
0 361 elsif (not -e _) { }
0 361 elsif (not -r _) { }
651 0 361 unless &File::ByLine::Object::open(my $fh, '<', $file)
657 0 506 if (scalar @_ != 1)
661 0 506 unless require Parallel::WorkUnit
663 0 506 if ($Parallel::WorkUnit::VERSION < 2.18185)
675 0 110 if (scalar @_ != 1)
678 106 4 if (defined &reftype($thing) and &reftype($thing) eq 'CODE')
679 1 3 if (&blessed($thing) and overload::Method($thing, '&{}'))
685 0 619 if (scalar @_ != 1)
688 150 469 if (&reftype($thing))
689 0 469 if (defined &blessed($thing) and overload::Method($thing, '[]'))
698 0 0 if (scalar @_ != 3)
701 0 0 if (exists $hash->{$key}) { }
709 0 705 if (scalar @_ != 1)
712 1 704 unless (defined $val)
724 0 248 if (scalar @_ != 3)
751 0 301 if (scalar @_ != 5)
754 35 266 if ($part)
756 99 162 unless ($self->header_skip or defined $self->header_handler)
760 46 121 if ($fileno and not $self->header_all_files)
765 116 5 if (defined $self->header_handler)
768 59 57 if ($self->{'extended_info'}) { }