Branch Coverage

blib/lib/Mason/Compilation.pm
Criterion Covered Total %
branch 145 160 90.6


line true false branch
105 0 285 if taint_is_on()
108 15 270 if ($$self{'is_pure_perl'})
116 0 998 if ++$iter > 1000
119 236 762 if $self->_match_end
120 22 739 if $self->_match_apply_filter_end
121 110 625 if $self->_match_unnamed_block and $lm = 'unnamed_block'
122 24 592 if $self->_match_named_block and $lm = 'named_block'
123 0 590 if $self->_match_unknown_block and $lm = 'unknown_block'
124 22 567 if $self->_match_apply_filter and $lm = 'apply_filter'
125 178 383 if $self->_match_substitution and $lm = 'substitution'
126 32 350 if $self->_match_component_call and $lm = 'component_call'
127 45 304 if $self->_match_perl_line and $lm = 'perl_line'
128 0 302 if $self->_match_bad_close_tag and $lm = 'bad_close_tag'
129 302 0 if $self->_match_plain_text and $lm = 'plain_text'
160 1 3 if ($$self{'last_match'} ne 'perl_line')
167 589 26 if ($$self{'last_match'} ne 'perl_line')
175 1 26 if $$self{'in_recursive_parse'}
181 0 10 if $self->bad_attribute_hash->{$name}
204 1 13 unless $name =~ /^$identifier$/
211 1 11 if exists $$self{'methods'}{"$method_key"}
226 22 1 if (my $incr = $$self{'end_parse'}) { }
251 6 10 if $line =~ /^\#/ or not $line =~ /\S/
252 10 0 if (my($name, $rest) = $line =~ / ^ \s* # optional whitespace (?: \$\.)? # optional $. prefix ([^\W\d]\w*) # valid Perl variable name (?:\s*=>\s*(.*))? # optional arrow then default or attribute params /x) { }
265 7 3 if (defined $rest and length $rest) { }
266 3 4 if ($rest =~ /^\s*\(/) { }
276 3 7 if ($attr_type eq 'shared')
296 29 3 if ($call =~ m[^[\w/.]])
298 24 5 if $comma == -1
353 8 0 if (defined $flag and defined $value and length $flag and length $value)
354 7 1 if ($self->valid_flags_hash->{$flag}) { }
356 1 6 if $@
371 1 16 unless $name =~ /^$identifier$/
374 1 15 if $self->bad_method_hash->{$name}
377 1 14 if exists $$self{'methods'}{$name}
395 41 4 if ($type eq 'perl') { }
428 1 177 unless (grep {/^\s*[^\s\#]/;} @lines)
434 12 165 if ($filter_list)
435 12 0 if (my(@filters) = grep({/\S/;} split(/\s*,\s*/, $filter_list, 0)))
459 20 570 if ($$self{'source'} =~ / \G (?<=^) % ([^\n]*) \{\{ [^\S\n]* (?:\#.*)? \n /cgmx)
467 5 565 if ($$self{'source'} =~ /\G(\n)? <% (.+?) (\s*\{\s*) %>(\n)?/cgsx)
472 3 2 if (not $filter_expr =~ /%>/) { }
474 6 3 if defined $_
489 20 742 if ($$self{'source'} =~ / \G (?<=^) % [ \t]+ \}\} [^\S\n]* (?:\#.*)? (?:\n\n?|\z) /cgmx)
490 19 1 if ($$self{'current_method'}{'type'} eq 'apply_filter') { }
500 3 739 if ($$self{'current_method'}{'type'} eq 'apply_filter' and $$self{'source'} =~ m[\G (?: (?: <% [ \t]* \} [ \t]* %> ) | (?: </%> ) ) (\n?\n?)]cgx)
517 147 1217 if ($$self{'source'} =~ /$regex/cgs)
520 2 145 if $named and not defined $name
523 1 144 if not $named and defined $name
528 21 123 if $preceding_newline
535 80 54 if $nl
544 143 1 if ($$self{'source'} =~ /$re/cg) { }
553 33 350 if ($$self{'source'} =~ /\G<&(?!\|)/cgs)
554 32 1 if ($$self{'source'} =~ /\G(.*?)&>/cgs) { }
568 236 762 if ($$self{'source'} =~ /(\G\z)/cgs)
570 0 236 defined $1 && length $1 ? :
580 46 304 if ($$self{'source'} =~ /\G(?<=^)(%%?)([^\n]*)(?:\n|\z)/cgm)
582 1 45 if (length $line and not $line =~ /^\s/)
585 4 41 if ($percents eq '%%')
586 0 4 if ($line =~ /\{\s*$/ and $$self{'source'} =~ /\G(?!%%)/cgm)
590 41 4 $percents eq '%' ? :
605 302 0 if ($$self{'source'} =~ m[ \G (.*?) # anything, followed by: ( (?<=\n)(?=%) # an eval line - consume the \n | (?=<%\s) # a substitution tag | (?=[%&]>) # an end substitution or component call | (?=</?[%&]) # a block or call start or end # - don't consume | \\\n # an escaped newline - throw away | \z # end of string ) ]cgsx)
631 15 287 if (substr($$self{'source'}, pos $$self{'source'}, 3) =~ /<%[a-z]/)
634 301 1 if length $text
648 383 184 unless $$self{'source'} =~ /\G<%/cgs
650 183 1 if ($$self{'source'} =~ / \G (\s*) # Initial whitespace (.*?) # Substitution body ($1) ( \s* (?<!\|) # Not preceded by a '|' \| # A '|' \s* ( # (Start $3) $identifier # A filter name (?:\s*,\s*$identifier)* # More filter names, with comma separators ) )? (\s*) # Final whitespace %> # Closing tag /cgisx) { }
671 3 180 unless $body =~ /\S/
672 1 179 unless length $start_ws
675 1 178 unless length $end_ws
687 2 590 if ($$self{'source'} =~ /\G(?:\n?)<%([A-Za-z_]+)>/cg)
697 2 302 if (my($end_tag) = $$self{'source'} =~ /\G\s*(%>|&>)/cg)
760 1694 205 if defined $_
771 6 205 if (my $flags = $$self{'blocks'}{'flags'})
772 6 0 if (%$flags)
791 652 5 unless ($self->interp->no_source_line_numbers)
793 652 0 if ($line_number)
810 8 208 $type eq 'modifier' ? :
2 216 $modifier eq 'around' ? :
22 218 $type eq 'apply_filter' ? :
815 10 230 $modifier ? :
837 0 17 unless index($a, ' ') <=> index($b, ' ')