Branch Coverage

blib/lib/Perl/Critic/Document.pm
Criterion Covered Total %
branch 86 130 66.1


line true false branch
32 2783 11156 if $function_name eq "DESTROY"
83 0 2780 if (@_ == 1) { }
99 2706 57 ref $source_code ? :
17 2763 _is_ppi_doc($source_code) ? :
107 0 2780 unless (defined $ppi_document)
109 0 0 ref $source_code ? :
153 2 19272 if (ref $wanted or not $wanted or not $wanted =~ / \A PPI:: /msx)
161 2738 16534 unless ($self->{'_elements_of'})
187 18 114 if (ref $wanted or not $wanted or not $wanted =~ / \A PPI:: /msx)
192 98 16 $result ? :
202 2 1 if (ref $wanted or not $wanted or not $wanted =~ / \A PPI:: /msx)
207 1 0 $result ? :
225 0 0 $subdocuments ? :
233 354 0 if (&blessed($element) and $element->isa('PPI::Element')) { }
236 0 354 if exists $self->{'_ppix_regexp_from_element'}{$addr}
251 334 20 unless $self->find("PPI::Statement::Include")
253 8 15 unless "re" eq $use_re->module
255 3 12 unless $self->element_is_in_lexical_scope_after_statement_containing($elem, $use_re)
258 3 9 'no' eq $use_re->type ? :
263 9 36 $_->isa('PPI::Token::QuoteLike::Words') ? :
3 45 $_->isa('PPI::Token::Quote') ? :
283 0 15 if ($outer_elem->scope)
294 0 15 unless my $stmt = $outer_elem->statement
299 0 15 unless $last_elem = $last_elem->last_element
303 0 15 unless my $stmt_loc = $last_elem->location
306 0 15 unless my $inner_loc = $inner_elem->location
309 0 15 if $stmt_loc->[0] > $inner_loc->[0]
311 0 15 if $stmt_loc->[0] == $inner_loc->[0] and $stmt_loc->[1] >= $inner_loc->[1]
327 0 15 if _inner_is_defined_by_outer($inner_elem, $parent) and _location_is_in_right_hand_side_of_assignment($parent, $inner_elem)
331 0 15 unless $parent = $parent->parent
348 15 0 unless $outer_elem->isa("PPI::Statement::Variable") and $inner_elem->isa("PPI::Token::Symbol")
365 0 0 unless $outer_elem->scope
367 0 0 unless $inner_elem->descendant_of($outer_elem)
369 0 0 if ($outer_elem->isa("PPI::Statement::Compound"))
370 0 0 unless my $first = $outer_elem->schild(0)
372 0 0 if ({"for", 1, "foreach", 1}->{$first->content})
375 0 0 unless $next->isa("PPI::Structure::List")
395 0 0 unless $kid->isa("PPI::Token::Operator") and "=" eq $kid->content
399 0 0 if $l->[0] > $inner_loc->[0]
401 0 0 if $l->[0] == $inner_loc->[0] and $l->[1] >= $inner_loc->[1]
416 2 2870 if (defined $self->{'_filename_override'}) { }
421 2870 0 $doc->can('filename') ? :
433 93 141 unless (exists $self->{'_highest_explicit_perl_version'})
436 12 81 if ($includes) { }
453 2 2 $a >= $b ? :
465 12 222 if $highest_explicit_perl_version
498 13 3158 if $policy_name eq "Perl::Critic::Policy::Miscellanea::ProhibitUnrestrictedNoCritic"
500 0 3158 if $policy_name eq "Perl::Critic::Policy::Miscellanea::ProhibitUselessNoCritic"
503 94 3064 if $self->{'_disabled_line_map'}{$line}{$policy_name}
504 39 3025 if $self->{'_disabled_line_map'}{$line}{'ALL'}
517 45 44 $annotation->disables_all_policies ? :
576 4909 94 unless $element->isa("PPI::Statement::Include")
577 16 78 if $element->version
596 24674 114680 unless ($classes)
633 1 2761 if ($first_stmnt =~ /$fixin_rx/ms)
648 57 2723 if (defined $file_name and ref $args->{'-program-extensions'} eq "ARRAY")
653 57 0 ref $ext eq 'Regexp' ? :
658 0 57 if $file_name =~ /$regex/msx
662 14 2766 if shebang_line($self)
663 1 2765 if defined $file_name and $file_name =~ / [.] PL \z /msx
675 0 2 if $nodes
678 0 2 unless ($ppi_document)
704 428 40 if $mapping
707 35 5 unless ($includes)
713 0 5 unless $_->module