Branch Coverage

blib/lib/PPIx/EditorTools/RenameVariable.pm
Criterion Covered Total %
branch 36 52 69.2


line true false branch
80 0 8 if ($args{'to_camel_case'} || $args{'from_camel_case'} and defined $replacement) { }
0 8 elsif (not $args{'to_camel_case'} || $args{'from_camel_case'} || defined $replacement) { }
94 0 8 unless defined $token
97 0 8 unless defined $declaration
110 4 4 unless (defined $replacement)
111 2 2 if ($args{'from_camel_case'}) { }
116 0 4 if ($varname eq $replacement)
129 2 6 $type eq '%' ? :
0 8 $type eq '@' ? :
132 2 6 if ($type eq '@' or $type eq '%') { }
140 2 0 if ($type eq '%') { }
0 0 elsif ($type eq '@') { }
166 44 424 if ($node->isa('PPI::Token::Symbol')) { }
0 424 elsif ($type eq '@' and $node->isa('PPI::Token::ArrayIndex')) { }
360 64 elsif ($node->isa('PPI::Token')) { }
167 26 18 unless $node->symbol eq $varname
179 0 0 unless substr($node->content, 2) eq substr($varname, 1)
186 4 356 if ($str =~ s(($finder_regexp)([\[{]?))[if ($1 =~ tr/{//) { substr($1, 0, $1 =~ tr/#// + 1) . "{$replacement}$2"; } else { substr($1, 0, $1 =~ tr/#// + 1) . "$replacement$2"; } ;]eg)
187 4 0 if ($1 =~ tr/{//) { }
213 6 32 if ($var =~ s/^(\W*_)//)
217 19 19 if $ucfirst
218 6 32 if defined $prefix
226 56 0 if ($var =~ s/^(\W*_?)//)
229 28 28 if ($ucfirst) { }
237 56 0 if defined $prefix
244 8 0 if ($var =~ s/^([\$\@\%])(.+)$/$1{$2}/)