Branch Coverage

blib/lib/Perl/Critic/Policy/ErrorHandling/RequireCarping.pm
Criterion Covered Total %
branch 56 64 87.5


line true false branch
50 3 542 if ($elem eq 'warn') { }
123 419 elsif ($elem eq 'die') { }
60 0 126 unless is_function_call($elem)
62 125 1 if ($self->{'_allow_messages_ending_with_newlines'})
63 55 70 if _last_flattened_argument_list_element_ends_in_newline($elem)
67 2 2 if $self->{'_allow_in_main_unless_in_subroutine'} and not $self->_is_element_contained_in_subroutine($elem) and $self->_is_element_in_namespace_main($elem)
79 15 110 unless my $last_flattened_argument = _find_last_flattened_argument_list_element($die_or_warn)
83 94 16 if ($last_flattened_argument->isa('PPI::Token::Quote')) { }
2 14 elsif ($last_flattened_argument->isa('PPI::Token::HereDoc')) { }
86 53 41 if ($last_flattened_argument_string =~ / \n \z /msx or $last_flattened_argument->isa('PPI::Token::Quote::Double') || $last_flattened_argument->isa('PPI::Token::Quote::Interpolate') and $last_flattened_argument_string =~ / [\\] n \z /msx)
195 77 92 if ($current_candidate->isa('PPI::Structure::List')) { }
4 88 elsif (not $current_candidate->isa('PPI::Token')) { }
208 6 115 unless $current_candidate
209 0 115 if _is_complex_expression_token($current_candidate)
212 100 15 if ($penultimate_element)
216 52 48 if ($penultimate_element->isa('PPI::Token::Operator')) { }
5 43 elsif ($penultimate_element != $die_or_warn) { }
217 0 52 if ($penultimate_element ne $Perl::Critic::Policy::ErrorHandling::RequireCarping::COMMA and $penultimate_element ne $Perl::Critic::Policy::ErrorHandling::RequireCarping::PERIOD)
258 71 6 if ($prior_sibling)
262 24 47 if ($prior_sibling->isa('PPI::Token::Operator')) { }
3 44 elsif ($prior_sibling != $die_or_warn) { }
263 0 24 if ($prior_sibling ne $Perl::Critic::Policy::ErrorHandling::RequireCarping::COMMA)
276 2 72 if scalar @list_children != 1
282 0 72 unless is_ppi_expression_or_generic_statement($list_child)
285 0 72 if scalar @statement_children < 1
315 81 203 unless $element->isa("PPI::Token")
343 81 203 unless $element->isa("PPI::Token")
356 1 8 if $parent->isa("PPI::Statement::Sub")
357 6 2 unless $parent->isa("PPI::Structure::Block")
358 0 2 unless my $prior_elem = $parent->sprevious_sibling
359 1 1 if $prior_elem->isa("PPI::Token::Word") and "sub" eq $prior_elem->content
377 1 0 if ($prior_elem->isa("PPI::Statement::Package"))