Branch Coverage

blib/lib/Module/ScanDeps.pm
Criterion Covered Total %
branch 195 278 70.1


line true false branch
608 34 121 if ($path =~ /\.pm$/io) { }
609 0 34 unless -f $path
611 0 34 unless defined $module_info
613 34 0 if (defined $inc_name) { }
617 0 0 if $warn
629 29 10 @_ && $_[0] =~ /^(?:$Keys)$/o ? :
634 38 1 unless (defined $args{'keys'})
639 8 31 if ($cache_file)
642 8 0 if ($using_cache) { }
654 1 55 unless ($input_file =~ /$Module::ScanDeps::ScanFileRE/)
657 0 1 if $args{'warn_missing'}
663 11 44 if ($type eq 'module') { }
730 0 39 if ($args{'execute'} or $args{'compile'})
740 8 31 if ($using_cache)
760 34 5 unless $skip
764 1587 553 if $_skip->{$file}++
767 4 549 unless $file =~ /$Module::ScanDeps::ScanFileRE/
771 51 498 if ($cache_cb) { }
779 20 31 unless ($found_in_cache)
800 1536 47 unless my(@preload) = _get_preload($pm)
815 0 111 if $rv->{'utf8.pm'}
819 2290 0 if defined $_->{'file'}
829 29 43 if $count == keys %$rv
838 15 0 @_ && $_[0] =~ /^(?:$Keys)$/o ? :
845 15 0 ref $files ? :
847 5 10 if ($compile) { }
10 0 elsif ($execute) { }
849 0 5 unless $file =~ /$Module::ScanDeps::ScanFileRE/
856 5 5 unless ref $execute
868 0 518 unless open my $fh, $file
876 247 2201 if $pm eq "__END__"
878 224 1977 if ($pm eq "__POD__")
880 222 11339 if $line =~ /^=cut/
886 0 1979 if ($pm =~ /^Tk\b/)
887 0 0 if $file =~ /(?:^|$pathsep)Term${pathsep}ReadLine\.pm$/
888 0 0 if $file =~ /(?:^|$pathsep)Tcl${pathsep}Tk\W/
895 0 518 unless close $fh
903 247 105850 if $line =~ /^__(?:END|DATA)__$/
904 224 105626 if $line =~ /^=\w/
915 515 83248 if (/^package\s+(\w+)/)
921 86 83162 if (/^(?:use|require)\s+v?(\d[\d\._]*)/)
923 13 73 if ("version"->new($1) >= "version"->new("5.9.5"))
930 11 83151 if (my($pragma, $args) = /^use \s+ (autouse|if) \s+ (.+)/x)
943 5 6 if ($pragma eq 'autouse') { }
958 0 11 if $@ or not defined $module
965 4 83147 if (my($how, $libs) = /^(use \s+ lib \s+ | (?:unshift|push) \s+ \@INC \s+ ,) (.+)/x)
967 4 0 defined $Module::ScanDeps::Config{'archname'} ? :
968 4 0 defined $Module::ScanDeps::Config{'version'} ? :
970 0 4 unless defined $dir
972 4 0 if $how =~ /lib/
975 4 12 if -d $_
1001 2264 35 if length $_
1024 49 83111 if (my($loader, $list) = $_ =~ /$LoaderRE/sx)
1027 2 47 if ($loader eq "Catalyst")
1031 1 1 $1 eq '-' ? :
2 3 $list =~ /([+-])\Q$_\E(?:$|[^\w:])/ ? :
1042 0 83111 if (/^use \s+ Class::Autouse \b \s* (.*)/sx or /^Class::Autouse \s* -> \s* autouse \s* (.*)/sx)
1048 1209 81902 if (s/^(?:use|no) \s+//x)
1053 628 81274 if (s/^(require|do) [\s(]+//x)
1054 562 66 $1 eq 'require' && /^([\w:]+)/ ? :
1059 358 80916 if (/(<[^>]*[^\$\w>][^>]*>)/)
1061 31 327 if $diamond =~ /[*?\[\]{}~\\]/
1064 0 81243 if /\bdbi:(\w+):/i
1067 2 81241 if (s/^(with|extends)\s+//)
1074 172 81069 if (my($args) = /\b(?:open|binmode)\b(.*)/)
1076 1 171 if $args =~ /:encoding\((.*?)\)/
1080 1 5 if $1 eq "encoding"
1082 4 168 if @mods
1083 4 168 if @mods
1085 2 81235 if (/\b(?:en|de)code\(\s*['"]?([-\w]+)/)
1089 0 81235 if ($SeenTk)
1098 0 0 if (/->\s*setPalette/g)
1110 0 81235 if s/^(?:require_module|use_module|use_package_optimistically) \s* \( \s*//x
1113 2 81233 if s/^(?:require_ok|use_ok) \s* \( \s*//x
1120 81233 1927 unless defined $module
1121 57 0 wantarray ? :
57 1870 if ref $module
1124 29 1841 if ($module =~ /^(['"]) (.*?) \1/x) { }
0 1841 elsif ($module =~ s/^qq? \s* (\W)//x) { }
1133 1 1869 if $module =~ /^(?:[\d\._]+|'.*[^']|".*[^"])$/
1135 37 1832 unless $module =~ /\./
1141 0 4 unless $] >= "5.008" and eval { do { require Encode; %Encode::ExtModule } }
1143 4 0 unless my $mod = eval { do { $Encode::ExtModule{Encode::find_encoding($enc)->name} } }
1151 0 2087 unless defined $module and defined $file
1159 0 2087 if ("File::Spec"->case_tolerant)
1161 0 0 if (lc $key eq lc $module)
1166 0 0 if (defined $used_by)
1167 0 0 if (lc $used_by eq lc $module) { }
1171 0 0 if (lc $key eq lc $used_by)
1186 2020 67 if (defined $used_by and $used_by ne $module)
1189 1942 78 if not 'File::Spec'->case_tolerant || grep({$_ eq $used_by;} @{$$rv{$module}{'used_by'};}) or "File::Spec"->case_tolerant and not grep({lc $_ eq lc $used_by;} @{$$rv{$module}{"used_by"};})
1194 1942 78 if not 'File::Spec'->case_tolerant || grep({$_ eq $module;} @{$$rv{$used_by}{'uses'};}) or "File::Spec"->case_tolerant and not grep({lc $_ eq lc $module;} @{$$rv{$used_by}{"uses"};})
1200 0 0 ref $_[0] ? :
1641 0 @_ && $_[0] =~ /^(?:modules|rv|used_by|warn_missing)$/ ? :
1211 77 1918 unless my $file = _find_in_inc($module)
1212 1 1917 if $skip->{$file}
1214 1514 403 if (exists $rv->{$module})
1225 387 16 if ((my $path = $module) =~ s/\.p[mh]$//i)
1228 45 135 if $_->{'name'} =~ m[^auto/$path/.*/]
1229 9 126 if $_->{'name'} =~ m[/(?:\.exists|\.packlist)$|\Q$Module::ScanDeps::Config{'lib_ext'}\E$]
1259 0 1995 unless defined $file
1262 1918 17617 if -f "$dir/$file"
1266 0 77 if -f $file
1281 13586 83 unless -d $dir
1288 147 549 unless -f $_
1289 0 549 if $pm_only and not /\.p[mh]$/i
1292 369 180 $pm_only ? :
1314 0 0 unless -d $dir
1316 0 0 unless opendir my $dh, $dir
1321 0 0 $pm_only ? :
1355 0 0 unless $module =~ /\.p[mh]$/i
1357 0 0 unless my $file = _find_in_inc($module)
1391 1 126 if ($cache{$val->{'key'}}) { }
1392 1 0 unless defined $val->{'used_by'}
1408 1 3 if $type eq "main"
1411 3 0 if (UNIVERSAL::isa($info->{$type}, "HASH"))
1419 1 2 if $type eq "module"
1431 0 0 if $Preload{$pm}
1460 10 5 $execute ? :
1552 0 15 unless open my $fh, "<", $file
1562 10 5 $execute ? :
10 5 $execute ? :
1566 0 0 $execute ? :
0 15 unless $rc == 0
1571 0 15 unless my $info = do $data_file
1620 76 657 if $name =~ /\.(?:ix|al|bs)$/i
1621 547 110 if $name =~ /\.p[mh]$/i
1622 48 62 if $name =~ /\.\Q$Module::ScanDeps::Config{'dlext'}\E$/i
1633 0 164 if ($rv->{$key} and _not_dup($key, $rv, $rv_sub)) { }
0 164 elsif ($rv->{$key}) { }
1668 0 0 if ('File::Spec'->case_tolerant) { }
1678 0 0 if $SeenRuntimeLoader{$module}++
1688 77 0 unless $warn
1689 0 0 unless $module =~ /\.p[ml]$/
1690 0 0 if not -f $module
1696 1934 56 unless my $preload = $Preload{$pm}
1697 1 55 if ($preload eq 'sub') { }
29 26 elsif (UNIVERSAL::isa($preload, 'CODE')) { }
1715 0 406 if $seen->{$pm}