Branch Coverage

blib/lib/PPI/Document.pm
Criterion Covered Total %
branch 87 128 67.9


line true false branch
188 0 33599 ref $_[0] ? :
190 16801 16798 unless (@_)
202 0 16798 if (not defined $source) { }
509 16289 elsif (not ref $source) { }
16286 3 elsif (&_SCALAR0($source)) { }
3 0 elsif (&_ARRAY0($source)) { }
207 0 509 if ($source =~ /(?:\012|\015)/)
215 3 506 if ($CACHE) { }
219 0 3 unless ref $file_contents
223 2 1 if $document
226 1 0 if ($document)
233 506 0 if $document
238 16285 1 if $document
243 3 0 if $document
251 1 0 if (&_INSTANCE($@, 'PPI::Exception')) { }
0 0 elsif ($@) { }
0 0 elsif ('PPI::Lexer'->errstr) { }
276 1 16800 if ($ENV{'PPI_CUSTOM_FEATURE_INCLUDES'})
278 0 1 if $@
283 1 0 unless $document->{'custom_feature_includes'}
311 0 3 ref $_[0] ? :
313 2 1 if (defined $_[0]) { }
315 0 2 unless my $object = &_INSTANCE(shift(), "PPI::Cache")
396 57946 2 unless @_
406 67238 0 unless @_
416 212234 0 unless @_
426 213317 0 unless @_
445 0 2 unless open FILE, ">", $_[0]
447 0 2 unless print FILE $self->serialize
448 0 2 unless close FILE
485 276878 631 unless ($Token->isa("PPI::Token::HereDoc"))
489 276435 443 unless ($heredoc ne "" and $content =~ /\n/)
496 321 122 if ($content eq "\n") { }
519 138 851 "\n" eq $line ? :
522 459 172 if ($Token->{'_damaged'})
535 283 176 if ($tokens[$last_index]{'content'} =~ /^[^\n]*\n$/)
543 1225 0 if $tokens[$_]
545 0 459 unless (defined $last_line)
559 2 1506 if $tokens[$_]->isa("PPI::Token::HereDoc")
560 0 459 unless (defined $any_after)
567 0 459 unless ($last_line and not $any_after)
569 0 0 unless (defined $Token->{'_terminator_line'})
575 0 0 unless ($Token->{'_terminator_line'} =~ /\n$/)
582 179 452 if (defined $Token->{'_terminator_line'})
589 0 7207 if ($heredoc ne "")
592 0 0 unless ($output =~ /\n$/)
657 0 259 if $Token->{'_location'}
661 0 259 $_ ? :
670 259 0 if (defined $first)
677 34 68769 if ($Token->isa("PPI::Token::HereDoc"))
688 262 0 $self->can('filename') ? :
706 57641 11162 unless ($newlines)
725 31 11131 if ($heredoc and $$heredoc)
733 304 10858 if ($content =~ /\n([^\n]+?)\z/)
749 10884 57919 if ($start->[1] == 1)
750 1771 9113 if ($Token->isa('PPI::Token::Comment')) { }
351 8762 elsif ($Token->isa('PPI::Token::Pod')) { }
751 13 1758 if ($Token->content =~ /
785 6 345 if (defined $line)
804 53535 4410 unless $content =~ /\t/
809 8040 8107 if ($part eq "\t") { }
878 0 15 if $_[1]->isa("PPI::Structure")
882 0 2 if $self->find_any(sub {
891 0 2 unless @child