Condition Coverage

blib/lib/Nice/Try.pm
Criterion Covered Total %
condition 153 264 57.9


and 2 conditions

line l !l condition
532 4 0 ref $rv and scalar @$rv
1514 0 12 $token_name_ref and ref $token_name_ref eq "ARRAY" and scalar @$token_name_ref
1908 48 15 $e->can("elements") and scalar $e->elements

and 3 conditions

line !l l&&!r l&&r condition
189 0 0 2 defined $code and length $code
192 2 0 0 @_ && defined $_[0]
232 0 0 0 $e->can("children") and $e->children
297 0 0 300 builtin::blessed($elem) and $elem->isa("PPI::Node")
310 27731 1130 132 $this->class eq 'PPI::Statement' && substr($this->content, 0, 3) eq 'try'
313 270 0 34 $ref and ref $ref
270 34 0 $ref and ref $ref and $self->{'debug'} >= 4
314 270 0 34 $ref and scalar @$ref
342 1504 209 2 $sib->class eq "PPI::Token::Word" and $sib->content eq "try"
346 0 0 2 $next and $next->class eq "PPI::Structure::Block"
378 48 1 8 $o->class eq "PPI::Structure::Block" and $last_control
404 20 1 4 $o->class eq "PPI::Structure::Block" and builtin::refaddr($o) eq builtin::refaddr($last->{'block'})
418 0 0 4 builtin::blessed($new_block->{'children'}[$i]) and $new_block->{'children'}[$i]->isa("PPI::Statement")
545 266 0 34 $ref and scalar @$ref
578 1098 56 143 $sib->class eq "PPI::Token::Word" and $sib->content eq "catch"
597 43 13 $sib->class eq "PPI::Token::Word" and $sib->content eq "finally"
187 215 211 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
580 208 0 127 $sib->class eq "PPI::Structure::Block" and substr("$sib", 0, 1) eq "{"
208 0 127 $sib->class eq "PPI::Structure::Block" and substr("$sib", 0, 1) eq "{" and substr("$sib", -1, 1) eq "}"
2 127 79 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
620 0 151 98 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
665 0 13 1 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
1189 79 18 12 $cdef->{'class'} and $cdef->{'where'}
1332 8 112 7 $has_catch_clause and length $fin_block
1357 0 127 0 scalar keys %main::warnings:: and exists $warnings::Bits{'args_array_with_signatures'}
1495 13 0 0 not defined $ref and warnings::enabled()
1510 0 0 12 defined $tokens and ref $tokens
0 12 0 defined $tokens and ref $tokens and not scalar @$tokens
1514 0 0 12 $token_name_ref and ref $token_name_ref eq "ARRAY"
1622 7264 475 5 $class eq "PPI::Token::Word" and $content =~ /^(?:CORE\::)?(?:GLOBAL\::)?caller$/
1627 6457 1 1286 $e->can("elements") and $e->elements
1643 30 24 396 index($ct, "last") == -1 and index($ct, "next") == -1
54 22 374 index($ct, "last") == -1 and index($ct, "next") == -1 and index($ct, "redo") == -1
46 1 373 index($ct, "last") == -1 and index($ct, "next") == -1 and index($ct, "redo") == -1 and index($ct, "goto") == -1
23 52 321 index($ct, "last") == -1 and index($ct, "next") == -1 and index($ct, "redo") == -1 and index($ct, "goto") == -1 and index($ct, "return") == -1
1659 1253 0 17 $class eq "PPI::Statement::Compound" and defined $e->first_element->content
1253 17 0 $class eq "PPI::Statement::Compound" and defined $e->first_element->content and $e->first_element->content =~ /^(for|foreach|while)$/
1230 40 0 $class eq "PPI::Token::Word" and $content =~ /^(?:CORE\::)?(?:GLOBAL\::)?(next|last|redo)$/
1144 37 3 $class eq "PPI::Token::Word" and ($e->content // "") eq "return"
1181 0 3 $class eq "PPI::Token::Word" and ($e->content // "") eq "return" and $e->sprevious_sibling
37 0 3 $class eq "PPI::Token::Word" and ($e->content // "") eq "return" and $e->sprevious_sibling and $e->sprevious_sibling->class eq "PPI::Token::Operator"
1687 86 0 0 $self->{'debug'} >= 5 and scalar @$words > 1
1690 12 33 41 scalar @$words == 1 || scalar @$words > 1 && $word2 =~ /^(for|foreach|given|if|unless|until|while)$/ || $word1 eq 'return' and $word1 eq 'next' || $word1 eq 'last' || $word1 eq 'redo' || $word1 eq 'return'
1744 0 1 2 $e->snext_sibling and $e->snext_sibling->class eq "PPI::Structure::List"
0 0 1 $e->snext_sibling and $e->snext_sibling->isa("PPI::Token::Quote")
0 0 0 $e->snext_sibling and $e->snext_sibling->class eq "PPI::Token::Structure"
0 0 0 $e->snext_sibling and $e->snext_sibling->class eq "PPI::Token::Structure" and $e->snext_sibling->content eq ";"
1789 997 1 186 $e->can("elements") and $e->elements
1908 0 7 8 $e->can("elements") and scalar $e->elements and index("$e", "__SUB__") != -1
1951 7386 0 0 $heredoc ne "" and $content =~ /\n/
2026 0 0 0 $last_line and not $any_after

or 2 conditions

line l !l condition
129 28 0 'PPI::Document'->new(\$code, 'readonly', 1) || die('Unable to parse: ', 'PPI::Document'->errstr, "\n$code\n")
201 0 18 $opts->{$_} //= 0
209 2 0 'PPI::Document'->new(\$code, 'readonly', 1) || die('Unable to parse: ', 'PPI::Document'->errstr, "\n$code\n")
222 0 0 shift @_ || 0
231 0 0 $e->line_number // "undef"
0 0 $e->class // "undef"
0 0 $e->content // "undef"
429 36 0 $o->remove || die("Unable to remove element '${o}'\n")
1467 127 0 'PPI::Token'->new($envelop) || die('Unable to create token')
1469 127 0 'PPI::Structure'->new($token) || die('Unable to create PPI::Structure element')
1582 12 0 'PPI::Token'->new($begin_block_code) || die('Unable to create token')
1615 1569 0 shift @_ || (return '')
1620 7744 0 $e->content // ""
1638 456 0 shift @_ || (return '')
1655 1270 0 $e->content // ""
1659 40 0 $e->content // ""
1684 86 0 $words->[0]->content // ""
1685 22 0 $words->[1]->content // ""
1800 426 0 shift @_ || (return '')
1855 0 0 $def->{'name'} // "anonymous"
1934 392 0 shift @_ || (return '')

or 3 conditions

line l !l&&r !l&&!r condition
55 0 0 32 $class->can("TIESCALAR") or $class->can("TIEHASH")
0 0 32 $class->can("TIESCALAR") or $class->can("TIEHASH") or $class->can("TIEARRAY")
65 0 32 0 ref $this || $this
135 3 10 15 index($code, '__DATA__') != -1 || index($code, '__END__') != -1
387 4 4 3 $ct eq "try" or $ct eq "catch"
8 0 3 $ct eq "try" or $ct eq "catch" or $ct eq "finally"
456 0 0 0 $last_obj->isa("PPI::Structure") or $last_obj->isa("PPI::Token")
481 21 0 0 $last_obj->insert_after($o) || do { warn q[Failed to insert object of class '], $o->class, q[' before last object of class '], $st->class, "'\n" if $self->{'debug'} }
791 0 0 127 $self->{'is_tied'} or $self->{'dont_want'}
0 0 127 $self->{'is_tied'} or $self->{'dont_want'} or $self->{'is_overloaded'}
1237 69 0 9 $cond eq "if" or $cond eq "elsif"
1251 34 0 0 $cond eq "if" or $cond eq "elsif"
1493 2 11 7707 $this->class eq 'PPI::Statement::Data' || $this->class eq 'PPI::Statement::End'
1508 2 10 27 $this->class eq 'PPI::Token::Data' || $this->class eq 'PPI::Token::End'
1510 1 0 12 not $tokens or defined $tokens and ref $tokens and not scalar @$tokens
1659 0 0 1270 $class eq "PPI::Structure::For" or $class eq "PPI::Statement::Compound" and defined $e->first_element->content and $e->first_element->content =~ /^(for|foreach|while)$/
1690 3 7 12 scalar @$words == 1 || scalar @$words > 1 && $word2 =~ /^(for|foreach|given|if|unless|until|while)$/ || $word1 eq 'return'
21 41 0 $word1 eq 'next' || $word1 eq 'last' || $word1 eq 'redo' || $word1 eq 'return'
2018 0 0 0 scalar @{$tokens[$_]{'_heredoc'};} or defined $tokens[$_]{'_terminator_line'}
2075 0 14 0 ref $this || $this
2116 0 2 0 ref $that || $that