Branch Coverage

blib/lib/CodeGen/Cpppp.pm
Criterion Covered Total %
branch 89 138 64.4


line true false branch
24 0 33 if defined $newval
28 0 33 if defined $newval
33 0 15 if defined $newval
44 17 0 !(@attrs & 1) ? :
0 17 @attrs == 1 && ref $attrs[0] ? :
49 1 16 if defined $self->{'include_path'} and ref $self->{'include_path'} ne "ARRAY"
56 0 1 unless my $path = $self->find_template($filename)
64 0 1 if $filename =~ m[/]u and -e $filename
66 0 1 if $filename =~ m[^\.?\.?/]u
70 1 0 if -e $p
77 9 3 $class_or_filename =~ /^CodeGen::Cpppp::/u && $class_or_filename->can('new') ? :
84 8 0 1 == @params && ref $params[0] eq 'HASH' ? :
4 8 !(@params & 1) ? :
95 0 24 unless (eval $perl)
109 0 23 if $line =~ /use \s+ ( v.* | ["']? [0-9.]+ ["']? ) \s* ; /ux
111 0 23 if $line =~ /use \s+ CodeGen::Cpppp \s* ( v.* | ["']? [0-9.]+ ["']? ) \s* ; /ux
113 0 23 if $line =~ /use \s+ CodeGen::Cpppp::Template \s+/u
115 22 1 if ($line =~ /^# line (\d+) "([^"]+)"/u) { }
122 0 24 if ($opts{'with_data'})
255 23 7 if (not defined $prev or length $_ <= length $prev) { }
7 0 elsif (length $prev < length $_) { }
256 0 22 /\t/u ? :
1 22 /^\t+$/u ? :
259 0 7 if ($prev =~ /\t/u or $_ =~ /\t/u) { }
260 0 0 if ($prev =~ /^\t+$/u and $_ =~ /^\t+$/u) { }
267 5 2 if (0 == length($prev) % $step)
278 0 2 if not defined $guess or $evidence{$_} > $evidence{$guess} or $evidence{$_} == $evidence{$guess} and $_ lt $guess
280 0 33 defined $guess && $guess eq 'mixed_tabs' ? :
286 5 75 if ($pl =~ /^ \s* (my \s+)? sub \s* ([\w_]+) \b \s* /ux)
290 0 5 defined $1 ? :
294 15 65 if ($pl =~ /^ \s* (param) \b /cgux) { }
0 65 elsif ($pl =~ /^ \s* (define) \s+ ([\w_]+) (\s*) \(/ux) { }
297 0 15 unless $pl =~ /\G \s* ( [\$\@\%] [\w_]+ ) /cgux
300 0 15 unless $pl =~ /\G \s* ([;=]) /cgux
304 4 11 $term eq ';' ? :
324 66 13 if (defined $s->{'eval'})
326 19 47 if (defined $cache{$s->{'eval'}})
331 0 47 $s->{'eval'} =~ /self|output/u ? :
332 11 36 if ($s->{'line'} == $cur_line) { }
6 30 elsif ($s->{'line'} == $cur_line + 1) { }
344 27 16 if index($code, "\n") != -1
356 4 0 if (grep $_->{'follows_eval'}, @{$$coltrack{$col}{'members'}}) { }
366 5 40 unless substr($text, -1) eq "\n"
367 0 45 if ($text =~ /^# line (\d+) "([^"]+)"/u)
376 45 0 unless (defined $CodeGen::Cpppp::parse->{'indent'})
424 72 69 if (exists $s->{'colgroup'}) { }
429 10 62 if ($CodeGen::Cpppp::parse->{'coltrack'}{$col})
430 10 0 if ($CodeGen::Cpppp::parse->{'coltrack'}{$col}{'members'}[-1]{'line'} == $s->{'line'} - 1)
441 5 57 if (substr($text, $linestart, $s->{'pos'} - $linestart) =~ /\S/u)
465 3 8 if $CodeGen::Cpppp::parse->{'coltrack'}{$c}{'line'} < $line - 1
474 0 2 unless $new_content =~ /\n\Z/u or not length $new_content
476 0 2 unless open my $fh, "+<", $fname
478 0 2 unless $content =~ s/(BEGIN \Q$patch_markers\E[^\n]*\n).*?(^[^\n]+?END \Q$patch_markers\E)/$1$new_content$2/msu
481 0 2 unless $fh->seek(0, 0)
482 0 2 unless $fh->print($content)
483 0 2 unless $fh->truncate($fh->tell)
484 0 2 unless $fh->close
490 0 6 unless $new_content =~ /\n\Z/u
492 0 6 if (-e $fname)
496 0 0 unless File::Copy::copy($fname, "$fname.$n")
498 0 6 unless open my $fh, ">", $fname
499 0 6 unless $fh->print($new_content)
500 0 6 unless $fh->close
508 4 11 if ($self->convert_linecomment_to_c89)
515 6 14 if ($_->type eq "comment")
516 3 3 if (substr($content, $_->src_pos, 2) eq "//")
529 2 6 if (defined $patch_markers) { }
538 0 0 unless open my $fh, "<", $fname
540 0 0 unless $fh->close