Branch Coverage

blib/lib/Perl/Critic/Policy/RegularExpressions/ProhibitEmptyAlternatives.pm
Criterion Covered Total %
branch 39 46 84.7


line true false branch
70 1 24 if ($self->{'_ignore_files__re'} and defined(my $logical_filename = $document->logical_filename))
74 1 0 if $logical_filename =~ /$self->{'_ignore_files__re'}/
78 0 24 unless my $ppix = $document->ppix_regexp_from_element($elem)
82 0 24 unless my $re = $ppix->regular_expression
85 13 11 unless $self->_is_node_in_violation($re)
98 1 41 unless my(@schildren) = $node->schildren
106 48 172 if ($kid->isa($OPERATOR_CLASS) and $Perl::Critic::Policy::RegularExpressions::ProhibitEmptyAlternatives::PIPE eq $kid->content) { }
112 8 164 if $kid->isa($NODE_CLASS) and $self->_is_node_in_violation($kid)
127 16 17 unless $found_empty_alternative or $prev_is_alternation
132 3 14 if $node->in_regex_set
141 1 4 if $prev_is_alternation and not $found_empty_alternative and $self->{'_allow_empty_final_alternative'}
146 5 8 if $self->{'_allow_if_group_anchored'} and $self->_is_node_anchored($node)
167 3 10 if $elem->isa($MAIN_CLASS)
172 1 9 if ($elem->isa($OPERATOR_CLASS) and $Perl::Critic::Policy::RegularExpressions::ProhibitEmptyAlternatives::PIPE eq $elem->content)
183 0 9 unless defined($is_matcher = $elem->is_matcher)
190 2 7 unless $is_matcher
195 2 5 if _maybe_quantified_to_zero($elem)
201 0 5 if $elem->isa('PPIx::Regexp::Structure::Assertion') and $ZERO_LENGTH_LOOKBEHIND{$elem->content}
242 0 1 unless my $parent = $elem->parent
253 1 9 if (defined $config_string and $Perl::Critic::Policy::RegularExpressions::ProhibitEmptyAlternatives::EMPTY ne $config_string)
254 0 1 unless $self->{'_ignore_files__re'} = eval {
272 4 3 unless my $quant = $elem->snext_sibling
274 1 2 unless $quant->is_quantifier