Condition Coverage

blib/lib/Nice/Try.pm
Criterion Covered Total %
condition 99 172 57.5


and 3 conditions

line !l l&&!r l&&r condition
182 0 0 0 defined $code and length $code
185 0 0 0 @_ && defined $_[0]
225 0 0 0 $e->can("children") and $e->children
289 0 0 267 &Scalar::Util::blessed($elem) and $elem->isa("PPI::Node")
297 24434 997 118 $this->class eq 'PPI::Statement' && substr($this->content, 0, 3) eq 'try'
300 242 0 25 $ref and ref $ref
242 25 0 $ref and ref $ref and $self->{'debug'} >= 4
301 242 0 25 $ref and scalar @$ref
321 1349 187 2 $sib->class eq "PPI::Token::Word" and $sib->content eq "try"
325 0 0 2 $next and $next->class eq "PPI::Structure::Block"
357 48 1 8 $o->class eq "PPI::Structure::Block" and $last_control
385 20 1 4 $o->class eq "PPI::Structure::Block" and &Scalar::Util::refaddr($o) eq &Scalar::Util::refaddr($last->{'block'})
521 982 48 129 $sib->class eq "PPI::Token::Word" and $sib->content eq "catch"
534 35 13 $sib->class eq "PPI::Token::Word" and $sib->content eq "finally"
160 193 189 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
524 183 0 113 $sib->class eq "PPI::Structure::Block" and substr("$sib", 0, 1) eq "{"
183 0 113 $sib->class eq "PPI::Structure::Block" and substr("$sib", 0, 1) eq "{" and substr("$sib", -1, 1) eq "}"
2 113 68 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
566 0 136 87 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
613 0 13 1 $sib->class eq "PPI::Token::Whitespace" and $sib->content =~ /[\015\012]+/
1059 66 18 12 $cdef->{'class'} and $cdef->{'where'}
1204 8 98 7 $has_catch_clause and length $fin_block
1361 6626 446 5 $class eq "PPI::Token::Word" and $content =~ /^(?:CORE\::)?(?:GLOBAL\::)?caller$/
1367 5903 1 1173 $e->can("elements") and $e->elements
1390 5963 0 35 $class eq "PPI::Statement::Compound" and defined $e->first_element->content
5963 35 0 $class eq "PPI::Statement::Compound" and defined $e->first_element->content and $e->first_element->content =~ /^(for|foreach|while)$/
5664 334 0 $class eq "PPI::Token::Word" and $content =~ /^(?:CORE\::)?(?:GLOBAL\::)?(next|last|redo)$/
1420 82 0 0 $self->{'debug'} >= 5 and scalar @$words > 1
1424 12 33 37 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'
1470 4934 1 981 $e->can("elements") and $e->elements
1502 6767 0 0 $heredoc ne "" and $content =~ /\n/
1577 0 0 0 $last_line and not $any_after

or 2 conditions

line l !l condition
132 25 0 'PPI::Document'->new(\$code, 'readonly', 1) || die('Unable to parse: ', 'PPI::Document'->errstr, "\n$code\n")
194 0 0 $opts->{$_} //= 0
202 0 0 'PPI::Document'->new(\$code, 'readonly', 1) || die('Unable to parse: ', 'PPI::Document'->errstr, "\n$code\n")
215 0 0 shift @_ || 0
404 36 0 $o->remove || die("Unable to remove element '${o}'\n")
1313 113 0 'PPI::Token'->new($envelop) || die('Unable to create token')
1316 113 0 'PPI::Structure'->new($token) || die('Unable to create PPI::Structure element')
1353 1428 0 shift @_ || (return '')
1358 7077 0 $e->content // ""
1380 1223 0 shift @_ || (return '')
1386 5998 0 $e->content // ""
1417 82 0 $words->[0]->content // ""
1418 22 0 $words->[1]->content // ""
1485 351 0 shift @_ || (return '')

or 3 conditions

line l !l&&r !l&&!r condition
55 0 0 25 $class->can("TIESCALAR") or $class->can("TIEHASH")
0 0 25 $class->can("TIESCALAR") or $class->can("TIEHASH") or $class->can("TIEARRAY")
65 0 25 0 ref $this || $this
366 4 4 3 $ct eq "try" or $ct eq "catch"
8 0 3 $ct eq "try" or $ct eq "catch" or $ct eq "finally"
442 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'} }
748 0 0 113 $self->{'is_tied'} or $self->{'dont_want'}
0 0 113 $self->{'is_tied'} or $self->{'dont_want'} or $self->{'is_overloaded'}
1108 56 0 9 $cond eq "if" or $cond eq "elsif"
1123 33 0 0 $cond eq "if" or $cond eq "elsif"
1390 0 0 5998 $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)$/
1424 3 7 12 scalar @$words == 1 || scalar @$words > 1 && $word2 =~ /^(for|foreach|given|if|unless|until|while)$/ || $word1 eq 'return'
21 37 0 $word1 eq 'next' || $word1 eq 'last' || $word1 eq 'redo' || $word1 eq 'return'
1569 0 0 0 scalar @{$tokens[$_]{'_heredoc'};} or defined $tokens[$_]{'_terminator_line'}
1625 0 14 0 ref $this || $this
1665 0 2 0 ref $that || $that