Branch Coverage

blib/lib/Perl/Critic/Policy/ErrorHandling/RequireCarping.pm
Criterion Covered Total %
branch 61 70 87.1


line true false branch
49 3 542 if ($elem eq 'warn') { }
123 419 elsif ($elem eq 'die') { }
59 0 126 unless is_function_call($elem)
61 125 1 if ($self->{'_allow_messages_ending_with_newlines'})
62 55 70 if _last_flattened_argument_list_element_ends_in_newline($elem)
66 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)
78 15 110 unless my $last_flattened_argument = _find_last_flattened_argument_list_element($die_or_warn)
82 94 16 if ($last_flattened_argument->isa('PPI::Token::Quote')) { }
2 14 elsif ($last_flattened_argument->isa('PPI::Token::HereDoc')) { }
85 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)
194 77 92 if ($current_candidate->isa('PPI::Structure::List')) { }
4 88 elsif (not $current_candidate->isa('PPI::Token')) { }
207 6 115 unless $current_candidate
208 0 115 if _is_complex_expression_token($current_candidate)
211 100 15 if ($penultimate_element)
215 52 48 if ($penultimate_element->isa('PPI::Token::Operator')) { }
5 43 elsif ($penultimate_element != $die_or_warn) { }
216 0 52 if ($penultimate_element ne $Perl::Critic::Policy::ErrorHandling::RequireCarping::COMMA and $penultimate_element ne $Perl::Critic::Policy::ErrorHandling::RequireCarping::PERIOD)
257 71 6 if ($prior_sibling)
261 24 47 if ($prior_sibling->isa('PPI::Token::Operator')) { }
3 44 elsif ($prior_sibling != $die_or_warn) { }
262 0 24 if ($prior_sibling ne $Perl::Critic::Policy::ErrorHandling::RequireCarping::COMMA)
275 2 72 if scalar @list_children != 1
281 0 72 unless is_ppi_expression_or_generic_statement($list_child)
284 0 72 if scalar @statement_children < 1
297 50 5 if ($element->isa("PPI::Token::Word") and $POSTFIX_OPERATORS{$element})
321 81 203 unless $element->isa("PPI::Token")
324 115 971 if $element->isa($class)
353 81 203 unless $element->isa("PPI::Token")
356 0 2233 if $element->isa($class)
370 1 8 if $parent->isa("PPI::Statement::Sub")
371 6 2 unless $parent->isa("PPI::Structure::Block")
372 0 2 unless my $prior_elem = $parent->sprevious_sibling
373 1 1 if $prior_elem->isa("PPI::Token::Word") and "sub" eq $prior_elem->content
391 1 0 if ($prior_elem->isa("PPI::Statement::Package"))