Branch Coverage

blib/lib/ModPerl/CScan.pm
Criterion Covered Total %
branch 21 224 9.3


line true false branch
163 0 0 unless my $stream = 'C::Preprocessed'->new(@_)
167 0 0 unless /^\s*\#\s* # Leading hash (line\s*)? # 1: Optional line ([0-9]+)\s* # 2: Line number (.*) # 3: The rest /x
173 0 0 if $include =~ /"(.*)"/
174 0 0 if $^O eq 'os2'
175 0 0 if $include ne ''
183 0 5 unless open C, $file
186 744 599 unless $line =~ s/ ^ \s* \# \s* # Start of directive define \s+ (\w+) # 1: symbol (?: \( (.*?) \s* \) # 2: Minimal match for arguments # in parenths (without trailing # spaces) )? # optional, no grouping \s* # rest is the definition ([\s\S]*) # 3: the rest //x
202 22 577 if (defined $args) { }
208 0 5 unless close C
220 0 0 unless my $stream = 'C::Preprocessed'->new(@_)
225 0 0 unless $line =~ s/ ^ \s* \# \s* # Start of directive define \s+ (\w+) # 1: symbol (?: \( (.*?) \s* \) # 2: Minimal match for arguments # in parenths (without trailing # spaces) )? # optional, no grouping \s* # rest is the definition ([\s\S]*) # 3: the rest //x
241 0 0 if (defined $args) { }
323 0 0 if ($wh =~ /,/ or not $wh =~ /\w/) { }
0 0 elsif ($td =~ /\(\s* \*? \s* ([^)]+) \s* \) \s* \(.*\)/gsx) { }
328 0 0 if (matchingbrace($wh)) { }
335 0 0 if ($c =~ /[\(\{\[]/) { }
0 0 elsif ($c =~ /[\)\]\}]/) { }
340 0 0 if $d < 0
342 0 0 if ($s < 0)
355 0 0 if $pre =~ /(?=\*)/g
377 0 0 unless $p =~ /\S/
390 0 0 unless $post =~ /\S/
406 0 0 unless $in =~ /^struct\s*(\w+)/
407 0 0 unless $in =~ s/^(struct\s*)(\w+)/$key = "struct $2"; $1 . ' ' x length($2);/e
412 0 0 defined $name ? :
416 0 0 defined $name ? :
424 0 0 if $in =~ / ^ \s* (struct | union) \s+ (\w+) \s* $ /x
427 0 0 unless ($structname, $in) = $in =~ / ^ \s* ( (?: struct | union ) (?: \s+ \w+ )? ) \s* { \s* (.*?) \s* } \s* $ /gisx
430 0 0 unless $structname =~ /\s/
431 0 0 if exists $$structs{$structname}
436 0 0 if $1 eq '{'
438 0 0 if $b == $e
441 0 0 if ($chunk =~ /\G\s*(struct|union|enum).*\}/gs) { }
448 0 0 unless $vars
460 0 0 if ($word eq ';' or $word eq '') { }
0 0 elsif ($word eq ',') { }
0 0 elsif ($word eq '[') { }
0 0 elsif ($word eq '(') { }
0 0 elsif ($word =~ /^:/) { }
461 0 0 unless defined $id
462 0 0 unless defined $type
466 0 0 unless defined $id
467 0 0 unless defined $type
472 0 0 unless defined $id
473 0 0 unless defined $type
479 0 0 if defined $id
480 0 0 unless defined $type
481 0 0 if ($in =~ /\G\s*(\*[\s\*]*?)\s*(\w+)[\[\]\d\s]*(\)\s*\()/cg) { }
494 0 0 unless defined $type
497 0 0 if (defined $post) { }
498 0 0 if ($func) { }
504 0 0 if defined $id
509 0 0 unless ($vars)
520 0 0 if /[()]/
522 0 0 unless $copy =~ s/^\s*extern\s*//
541 0 0 unless $in =~ /;/g
556 0 0 unless defined $b1
558 0 0 if ($e - $b - $b1 > 0)
561 0 0 if ($chunk =~ /,/) { }
571 0 0 if ($chunk =~ /\)\Z/) { }
0 0 elsif ($chunk =~ / ^ \s* (enum|struct|union|class) \s+ \w+ \s* $ /x) { }
572 0 0 if (not $chunk =~ / \( .* \( # Multiple parenths /x and $chunk =~ / \w \s* \( /x)
583 0 0 if ($isvar) { }
0 0 elsif ($isfunc) { }
589 0 0 if $isvar or $isfunc
660 0 0 unless ($out =~ /\w/)
663 0 0 if ($tout =~ /(\w+\s+)*(\w+)\s*\(/g) { }
671 0 0 $tout =~ s/(\W*)$// ? :
673 0 0 $tout =~ s/.*?(\w*)$/$1/ ? :
679 0 0 if length $in != length $out
682 0 0 if $out =~ /\w[^\w,]+\w/
684 0 0 unless $out =~ /\w/
693 382 787 $1 ? :
694 405 764 if $n < 0
703 0 0 if $in =~ m[/\*]
721 4 0 defined $3 ? :
0 4 defined $2 ? :
261 4 defined $4 ? :
0 265 defined $1 ? :
726 0 5 if $in =~ m[ /\* ]x
782 0 0 if ($w =~ /^(struct|class|enum|union)$/)
783 0 0 unless $decl =~ /\G\s+\w+/g
789 0 0 unless $decl =~ /\G[\s*]*\*/g
791 0 0 unless $decl =~ /\G\s*/g
794 0 0 if (defined $argnum) { }
795 0 0 if ($decl =~ /\G(\w+)((\s*\[[^][]*\])*)/g) { }
805 0 0 unless $decl =~ /\G(\w+)/g
811 0 0 unless $decl =~ /\G\s*/g
817 0 0 if (pos $decl != length $decl)
819 0 0 unless $decl =~ /\G\(/g
823 0 0 unless matchingbrace($argstring)
828 0 0 if ($argstring ne '')
858 0 0 if ($w =~ /^(struct|class|enum|union)$/)
859 0 0 unless $decl =~ /\G\s+\w+/g
865 0 0 unless $decl =~ /\G[\s*]*\*/g
867 0 0 unless $decl =~ /\G\s*/g
869 0 0 if (defined $argnum) { }
870 0 0 if ($decl =~ /\G(\w+)((\s*\[[^][]*\])*)/g) { }
880 0 0 unless $decl =~ /\G(\w+)/g
885 0 0 unless $decl =~ /\G\s*/g
891 0 0 if (pos $decl != length $decl)
893 0 0 unless $decl =~ /\G\(/g
897 0 0 unless matchingbrace($argstring)
902 0 0 if ($argstring ne '')
933 0 5 if @_ < 2 or @_ > 5
941 5 0 if defined $Includes and @$Includes
949 5 0 if open $sym, $cmd or die "Cannot open pipe from `${cmd}': $!"
956 0 5 if (defined $filter)
971 0 0 $on ? :
976 0 0 if /^\#/
977 0 0 if $on
983 0 5 unless close $_[0]