Branch Coverage

blib/lib/PPIx/QuoteLike/Utils.pm
Criterion Covered Total %
branch 57 104 54.8


line true false branch
82 1 8 unless ref $elem
85 1 7 unless &Scalar::Util::blessed($elem)
89 5 20 if $elem->isa($class)
105 0 66 unless &Scalar::Util::blessed($ppi)
124 1 65 if $ppi->isa("PPIx::QuoteLike")
126 0 65 if $ppi->isa("PPIx::QuoteLike::Token")
132 0 65 if ($ppi->isa("PPIx::Regexp::Element"))
133 0 0 unless $ppi->find("PPIx::Regexp::Token::Code")
142 0 65 unless $ppi->isa("PPI::Element")
149 0 57 if _is_bareword_subscript($sym)
151 0 57 if (defined(my $name = _name_from_misparsed_magic($sym))) { }
168 0 0 unless $name =~ s/ \A \$ [#] /\@/msx
180 0 7 unless my $previous = $elem->sprevious_sibling
182 0 7 unless $previous->isa("PPI::Token::Cast")
185 0 7 unless $cast_allowed_for_bare_bracketed_variable->{$sigil}
188 7 0 if (my(@kids) = $elem->schildren) { }
192 0 7 unless 1 == @kids
194 0 7 unless $kids[0]->isa("PPI::Statement")
197 5 2 unless (my $name = join("", map({$_->content;} $kids[0]->children))) =~ m( \A @{[qr/ [[:alpha:]_]\w* (?: :: [[:alpha:]_] \w* )* | \^ [A-Z_] | [0-9]+ | [-!"#\$%&'()+,.\/:;<=>?[\\\]^_`{|}~] /msx];} \z )mosx
207 0 0 unless my $stmt = $elem->statement
209 0 0 if (my $finish = $elem->finish) { }
212 0 0 unless my $next = $stmt->next_sibling
214 0 0 unless $next->isa("PPI::Statement::UnmatchedBrace") and "}" eq $next->content
221 0 0 unless my $next = $stmt->next_sibling
223 0 0 unless my $finish = $next->next_sibling
225 0 0 unless $finish->isa("PPI::Statement::UnmatchedBrace") and "}" eq $finish->content
238 0 8 unless my $ql = "PPIx::QuoteLike"->new($elem)
240 2 6 unless $ql->interpolates
251 0 65 if (&HAVE_PPIX_REGEXP())
258 0 0 unless my $re = "PPIx::Regexp"->new($elem)
260 0 0 unless $re->find("PPIx::Regexp::Token::Code")
280 431 65 unless $elem->find($class)
496 24 if $elem->isa("PPI::Node")
281 2 22 if $elem->isa($class)
288 47 144 unless &Scalar::Util::blessed($object)
299 57 0 unless $elem->content =~ / \A \w+ \z /msx
302 0 0 unless $parent = $elem->parent and $parent->isa("PPI::Statement") and 1 == $parent->children
306 0 0 unless $parent = $parent->parent and $parent->isa('PPI::Structure::Subscript') || $parent->isa('PPI::Structure::Block') and 1 == $parent->children
312 0 0 unless $start = $parent->start and $start->isa("PPI::Token::Structure") and "{" eq $start->content
348 13 41 if $REGEXP_CACHE{$ql}
350 20 21 if (my $right = $matching_bracket{$left}) { }
390 47 8 unless my $right = $matching_bracket{$left}
400 3 41 if (/ \A \@ [{] \s* ( $BRACKETED_RE ) \s* [}] \z /mosx)
408 1 40 if (/ \A \$ [{] \s* \\ \s* ( $PARENTHESIZED_RE ) \s* [}] \z /mosx)
418 8 32 if / \A ( $SIGIL_AND_CAST_RE ) \s* [{] \s* ( $NORMAL_SYMBOL_NAME_RE ) \s* [}] \z /mosx
430 1 31 if (/ \A ( $SIGIL_AND_CAST_RE ) \s+ ( $SYMBOL_NAME_RE ) ( .* ) /mosx)
440 0 3 unless my $top = $self->top
442 0 3 unless $top->can("source")
444 0 3 unless my $source = $top->source
446 0 3 unless $source->can("statement")
516 49 8 unless $elem->isa("PPI::Token::Magic")
518 6 2 unless my $code = $$special{$elem->content}