Branch Coverage

blib/lib/Perl/ToPerl6/Utils.pm
Criterion Covered Total %
branch 164 248 66.1


line true false branch
336 1 4 unless $nodes_ref
338 3 1 @matches ? :
346 2 33 if (&blessed($elem) and $elem->isa('PPI::Statement::Sub'))
359 0 4 unless $elem
370 0 16 unless $elem
401 0 7 unless $elem
413 0 15 unless $elem
667 0 0 unless $elem
683 0 0 unless $name
692 0 36 unless $elem
693 4 32 ref $elem ? :
700 0 24 unless $elem
703 8 16 if _is_followed_by_parens($elem)
707 0 16 unless $parent
709 0 16 unless $grandparent
710 2 14 if $grandparent->isa('PPI::Structure::Subscript')
715 0 14 unless $sib
716 0 14 if $sib->isa('PPI::Token::Operator') and $sib eq '=>'
725 0 24 unless $elem
735 0 15 unless $elem
737 0 15 unless $stmnt
738 15 0 unless $stmnt->isa('PPI::Statement::Include')
746 0 289 unless defined $value
755 0 14 unless $elem
758 0 14 unless $statement
761 12 2 unless $psib
771 0 15 unless $elem
780 0 15 unless $elem
790 12 18 unless $elem
799 0 15 unless $elem
801 0 15 unless $stmnt
802 15 0 unless $stmnt->isa('PPI::Statement::Package')
810 0 17 unless $elem
812 12 5 unless $sib
814 0 5 unless $stmnt
821 0 16 unless my $elem = shift()
823 1 15 if is_perl_bareword($elem)
824 0 15 if is_perl_filehandle($elem)
825 0 15 if is_package_declaration($elem)
826 0 15 if is_included_module_name($elem)
827 0 15 if is_method_call($elem)
828 0 15 if is_class_name($elem)
829 1 14 if is_subroutine_name($elem)
830 0 14 if is_label_pointer($elem)
831 0 14 if is_hash_key($elem)
846 0 8 if &blessed($doc) and $doc->isa('Perl::ToPerl6::Document')
849 5 3 if shebang_line($doc)
850 1 2 if _is_PL_file($doc)
858 2 1 unless $doc->can('filename')
860 1 0 if $filename =~ /[.] PL \z/msx
870 0 0 if $token->sprevious_sibling
873 0 0 if ($parent)
874 0 0 if $parent->isa('PPI::Structure::List')
875 0 0 if $parent->isa('PPI::Structure::For')
876 0 0 if $parent->isa('PPI::Structure::Condition')
877 0 0 if $parent->isa('PPI::Structure::Constructor')
878 0 0 if $parent->isa('PPI::Structure::Subscript')
881 0 0 if ($grand_parent)
883 0 0 if $parent->isa('PPI::Structure::Block') and not $grand_parent->isa('PPI::Statement::Compound')
895 76 2800 unless ($transformer_name =~ / \A $POLICY_NAMESPACE /msx)
914 0 7 unless $sib
916 2 5 if ($sib->isa('PPI::Structure::List'))
919 1 1 unless $expr
920 1 0 $expr->isa('PPI::Statement') ? :
931 0 11 unless $sib
933 3 8 if ($sib->isa('PPI::Structure::List')) { }
937 0 3 unless @list_contents
941 3 1 if (is_ppi_expression_or_generic_statement($item)) { }
962 8 11 if $iter->isa('PPI::Token::Structure') and $iter eq $SCOLON
963 0 11 if $iter->isa('PPI::Token::Operator') and $MIN_PRECEDENCE_TO_TERMINATE_PARENLESS_ARG_LIST <= precedence_of($iter)
980 8 17 if ($node->isa('PPI::Token::Operator') and $node eq $COMMA || $node eq $FATCOMMA) { }
7 10 elsif ($node->isa('PPI::Token::QuoteLike::Words')) { }
984 7 1 if (@node_stacks)
1034 1 18 unless defined $verbosity
1035 2 16 if is_integer($verbosity)
1056 46 6 if is_integer($severity)
1059 1 5 unless (defined $severity_number)
1068 0 46 $s > $SEVERITY_HIGHEST ? :
1069 0 46 $s < $SEVERITY_LOWEST ? :
1089 17 38 if (-d $file)
1090 0 17 unless opendir my $dh, $file
1099 38 0 if (-f $file and not _is_backup($file) and _is_perl($file))
1112 1 44 if $file =~ / [.] swp \z/msx
1113 1 43 if $file =~ / [.] bak \z/msx
1114 1 42 if $file =~ / ~ \z/msx
1115 1 41 if $file =~ / \A [#] .+ [#] \z/msx
1128 1 54 if $file =~ / [.] PL \z/msx
1129 40 14 if $file =~ / [.] p[lm] \z/msx
1130 1 13 if $file =~ / [.] t \z/msx
1133 4 9 unless open my $fh, '<', $file
1135 0 9 unless close $fh
1137 6 3 if defined $first and $first =~ / \A [#]!.*perl /msx
1146 0 67 unless $first_element
1147 51 16 unless $first_element->isa('PPI::Token::Comment')
1149 0 16 unless $location
1152 0 16 if $location->[0] != 1
1153 0 16 if $location->[1] != 1
1155 2 14 unless $shebang =~ / \A [#]! /msx
1182 0 14 unless is_function_call($elem)
1185 2 12 if (my $sib = $elem->sprevious_sibling)
1186 2 0 if $sib
1190 12 0 if (my $statement = $elem->statement)
1199 77 13 unless $elem->isa('PPI::Token::Operator')
1200 12 1 if $elem ne 'or' and $elem ne '||'
1204 1 11 if $statement->find($or_operators)
1207 11 0 if (my $parent = $elem->statement->parent)
1210 0 11 if $parent->isa('PPI::Structure::Condition')
1213 0 11 if $parent->isa('PPI::Structure::Constructor')
1216 6 5 if ($parent->isa('PPI::Structure::List'))
1217 1 5 if (my $uncle = $parent->sprevious_sibling)
1218 1 0 if $uncle
1224 7 3 if _is_fatal($elem)
1328 0 10 unless $top->isa('PPI::Document')
1331 2 8 unless $includes
1334 0 8 if 'use' ne $include->type
1336 2 6 if ('Fatal' eq $include->module) { }
2 4 elsif ('Fatal::Exception' eq $include->module) { }
4 0 elsif ('autodie' eq $include->pragma) { }
1339 2 0 if $arg->[0]->isa('PPI::Token::Quote') and $elem eq $arg->[0]->string
1346 2 0 if $arg->[0]->isa('PPI::Token::Quote') and $elem eq $arg->[0]->string
1366 0 4 if ($first_arg and $first_arg->isa('PPI::Token::Number'))
1368 3 1 if (@args) { }
1375 2 2 if $builtins and $$builtins{$elem->content}
1382 1 0 if $builtins and $$builtins{$elem->content}