Branch Coverage

blib/lib/Perl/Critic/Policy/Subroutines/RequireFinalReturn.pm
Criterion Covered Total %
branch 52 68 76.4


line true false branch
53 4 55 if $elem->isa("PPI::Statement::Scheduled")
56 0 55 if (@blocks > 1) { }
1 54 elsif (@blocks == 0) { }
68 33 21 if ($self->_block_is_empty($block) or $self->_block_has_return($block))
74 21 0 if (my $name = $elem->name) { }
97 1 83 unless $final
108 21 62 if $self->_is_conditional_stmnt($final)
118 20 15 unless ($final->isa("PPI::Statement::Compound"))
123 0 15 unless $begin
124 1 14 unless ($begin->isa("PPI::Token::Word") and $begin->content eq 'if' || $begin->content eq 'unless')
132 0 14 if (&any(sub {
138 6 19 unless ($self->_block_has_return($block))
151 33 4 unless ($final->isa("PPI::Statement::Given"))
156 0 4 unless $begin
157 0 4 unless ($begin->isa("PPI::Token::Word") and $begin->content eq "given")
165 0 4 if (&any(sub {
169 0 4 if (@blocks > 1)
173 0 4 unless @blocks
179 6 1 if ($stmnt->isa('PPI::Statement::When')) { }
183 3 3 if $first_token = $stmnt->schild(0) and "default" eq $first_token->content
187 1 5 unless $self->_is_when_stmnt_with_return($stmnt)
192 0 1 unless $self->_is_suffix_when_with_return($stmnt)
206 29 34 unless $stmnt->isa("PPI::Statement::Break")
217 0 31 unless $stmnt->isa("PPI::Statement")
220 12 19 if exists $self->{'_terminal_funcs'}{$first_token}
223 12 6 unless $second_token->isa("PPI::Token::Operator") and $second_token eq "->"
233 0 83 unless $stmnt->isa("PPI::Statement")
236 21 67 if $elem->isa("PPI::Token::Word") and exists $CONDITIONALS{$elem}
249 0 6 if (&any(sub {
252 0 6 if @inner > 1
254 0 6 unless @inner
257 1 5 unless ($self->_block_has_return($block))
269 0 1 unless $stmnt->isa("PPI::Statement")
271 1 2 if $elem->isa("PPI::Token::Word") and "when" eq $elem->content