Branch Coverage

blib/lib/Module/AnyEvent/Helper/PPI/Transform.pm
Criterion Covered Total %
branch 100 128 78.1


line true false branch
32 2 899 unless blessed($_[0])
34 2 899 unless blessed $word and $word->isa('PPI::Element')
36 111 788 unless $st
37 599 189 if $st->class ne 'PPI::Statement::Sub'
43 2 292 unless blessed($_[0])
45 2 292 unless blessed $word and $word->isa('PPI::Token::Word')
51 2 21 unless blessed($_[0])
53 2 21 unless blessed $word and $word->isa('PPI::Token::Word')
59 2 47 unless not defined $_[0] or $_[0] eq '' or blessed($_[0])
62 2 10 unless blessed $prev and $prev->isa('PPI::Element') or blessed $next and $next->isa('PPI::Element')
63 2 55 unless blessed $target and $target->isa('PPI::Element')
66 0 193 unless my $new_elem = $elem->clone
67 183 10 if ($prev) { }
68 0 183 unless $prev->insert_after($new_elem)
70 0 10 unless $next->insert_before($new_elem)
81 2 9 unless blessed($_[0])
83 2 9 unless blessed $block and $block->isa('PPI::Structure::Block')
90 2 9 unless blessed($_[0])
92 2 9 unless blessed $word and $word->isa('PPI::Token::Word')
101 0 19 unless blessed($_[0])
103 0 19 unless blessed $word and $word->isa('PPI::Element')
112 1 26 unless $sprev
113 4 22 if ($state eq 'INIT' || $state eq 'LIST' || $state eq 'TERM' || $state eq 'SUBTERM' and $sprev->isa('PPI::Token::Operator') and $sprev->content eq '->') { }
0 22 elsif ($state eq 'OP' and $sprev->isa('PPI::Structure::List')) { }
4 18 elsif ($state eq 'OP' || $state eq 'LIST' and $sprev->isa('PPI::Token::Word') || $sprev->isa('PPI::Token::Symbol')) { }
0 18 elsif ($state eq 'OP' || $state eq 'SUBTERM' and $sprev->isa('PPI::Structure::Constructor') || $sprev->isa('PPI::Structure::List') || $sprev->isa('PPI::Structure::Subscript')) { }
0 18 elsif ($state eq 'OP' || $state eq 'SUBTERM' and $sprev->isa('PPI::Token::Word') || $sprev->isa('PPI::Token::Symbol')) { }
0 18 elsif ($state eq 'OP' || $state eq 'TERM' and $sprev->isa('PPI::Structure::Block')) { }
0 18 elsif ($state eq 'BLOCK' and $sprev->isa('PPI::Token::Cast')) { }
18 0 elsif ($state eq 'INIT' or $state eq 'TERM' or $state eq 'SUBTERM') { }
137 0 4 unless $state eq 'INIT' or $state eq 'TERM' or $state eq 'SUBTERM'
138 4 15 if ($state ne 'INIT')
150 0 19 unless blessed($_[0])
152 0 19 unless blessed $word and $word->isa('PPI::Element')
159 19 0 if ($next and $next->isa('PPI::Structure::List'))
174 2 19 unless blessed($_[0])
176 2 19 unless blessed $word and $word->isa('PPI::Element')
185 4 15 $is_array ? :
186 38 114 if $_[1]->class eq 'PPI::Token::Word'
187 19 0 if (defined $args)
214 0 9 unless blessed($_[0])
216 0 9 unless blessed $doc and $doc->isa('PPI::Element')
218 0 9 unless $first->significant
226 0 9 unless blessed($_[0])
228 0 9 unless blessed $doc and $doc->isa('PPI::Element')
237 9 0 unless $last->significant
251 6 3 if exists $arg{-'replace_func'}
252 9 0 if exists $arg{-'remove_func'}
253 6 3 if exists $arg{-'delete_func'}
254 9 0 if exists $arg{-'translate_func'}
257 9 0 exists $arg{-'translate_func'} ? :
259 5 4 if exists $arg{-'exclude_func'}
302 1 0 if not $word->snext_sibling || $word->sprevious_sibling and $word->parent and $word->parent->isa('PPI::Statement::Expression') and $word->parent->parent and $word->parent->parent->isa('PPI::Structure::Subscript')
305 0 72 if $word->snext_sibling and $word->snext_sibling->isa('PPI::Token::Operator') and $word->snext_sibling->content eq '=>'
315 5 4 exists $$self{'_XFUNC'} ? :
320 0 292 unless defined $word
321 72 220 if (is_function_declaration($word)) { }
322 21 51 if ($self->_is_remove_func($word->content) or $self->_is_delete_func($word->content)) { }
9 42 elsif ($self->_is_translate_func($word->content)) { }
328 24 196 unless defined $word->document
329 111 85 unless defined function_name($word)
330 12 73 unless $self->_is_translate_func(function_name($word))
331 1 72 unless $self->_is_calling($word)
333 19 53 if ($self->_is_replace_target($name))