Branch Coverage

blib/lib/Module/ScanDeps.pm
Criterion Covered Total %
branch 193 278 69.4


line true false branch
557 34 121 if ($path =~ /\.pm$/io) { }
558 0 34 unless -f $path
560 0 34 unless defined $module_info
562 34 0 if (defined $inc_name) { }
566 0 0 if $warn
578 29 10 @_ && $_[0] =~ /^(?:$Keys)$/o ? :
583 38 1 unless (defined $args{'keys'})
588 8 31 if ($cache_file)
591 8 0 if ($using_cache) { }
603 1 55 unless ($input_file =~ /$Module::ScanDeps::ScanFileRE/)
606 0 1 if $args{'warn_missing'}
612 11 44 if ($type eq 'module') { }
679 0 39 if ($args{'execute'} or $args{'compile'})
689 8 31 if ($using_cache)
709 34 5 unless $skip
713 1587 553 if $_skip->{$file}++
716 4 549 unless $file =~ /$Module::ScanDeps::ScanFileRE/
720 51 498 if ($cache_cb) { }
728 20 31 unless ($found_in_cache)
749 1535 47 unless my(@preload) = _get_preload($pm)
764 0 111 if $rv->{'utf8.pm'}
768 2290 0 if defined $_->{'file'}
778 29 43 if $count == keys %$rv
787 15 0 @_ && $_[0] =~ /^(?:$Keys)$/o ? :
794 15 0 ref $files ? :
796 5 10 if ($compile) { }
10 0 elsif ($execute) { }
798 0 5 unless $file =~ /$Module::ScanDeps::ScanFileRE/
805 5 5 unless ref $execute
817 0 518 unless open my $fh, $file
825 247 2199 if $pm eq "__END__"
827 224 1975 if ($pm eq "__POD__")
829 222 11339 if $line =~ /^=cut/
835 0 1977 if ($pm =~ /^Tk\b/)
836 0 0 if $file =~ /(?:^|$pathsep)Term${pathsep}ReadLine\.pm$/
837 0 0 if $file =~ /(?:^|$pathsep)Tcl${pathsep}Tk\W/
844 0 518 unless close $fh
852 247 105807 if $line =~ /^__(?:END|DATA)__$/
853 224 105583 if $line =~ /^=\w/
864 515 83234 if (/^package\s+(\w+)/)
870 86 83148 if (/^(?:use|require)\s+v?(\d[\d\._]*)/)
872 13 73 if ("version"->new($1) >= "version"->new("5.9.5"))
879 11 83137 if (my($pragma, $args) = /^use \s+ (autouse|if) \s+ (.+)/x)
892 5 6 if ($pragma eq 'autouse') { }
907 0 11 if $@ or not defined $module
914 4 83133 if (my($how, $libs) = /^(use \s+ lib \s+ | (?:unshift|push) \s+ \@INC \s+ ,) (.+)/x)
916 4 0 defined $Module::ScanDeps::Config{'archname'} ? :
917 4 0 defined $Module::ScanDeps::Config{'version'} ? :
919 0 4 unless defined $dir
921 4 0 if $how =~ /lib/
924 4 12 if -d $_
943 45 166191 if (my($loader, $loadee) = $chunk =~ /$LoaderRegexp{$loaders}/sx)
958 1 44 $prefix ? :
963 58 45 if length $_ and not /^q[qw]?$/
996 44 83096 if (my $mods = _check_loader($_, "asa base parent prefork POE encoding maybe only::matching Mojo::Base"))
1000 1 83095 if (my $mods = _check_loader($_, "Catalyst", "Catalyst::Plugin"))
1005 0 83095 if (/^use \s+ Class::Autouse \b \s* (.*)/sx or /^Class::Autouse \s* -> \s* autouse \s* (.*)/sx)
1009 0 0 if length $_
1013 1207 81888 if /^(?:use|no) \s+ ([\w:]+)/x
1015 628 81260 if (s/^(require|do) [\s(]+//x)
1016 562 66 if $1 eq "require" and /^([\w:]+)/
1021 358 80902 if (/(<[^>]*[^\$\w>][^>]*>)/)
1023 31 327 if $diamond =~ /[*?\[\]{}~\\]/
1026 0 81229 if /\b[Dd][Bb][Ii]:(\w+):/
1031 172 81057 if (my($args) = /\b(?:open|binmode)\b(.*)/)
1033 1 171 if $args =~ /:encoding\((.*?)\)/
1037 1 5 if $1 eq "encoding"
1039 4 168 if @mods
1040 4 168 if @mods
1042 2 81223 if (/\b(?:en|de)code\(\s*['"]?([-\w]+)/)
1046 0 81223 if ($SeenTk)
1055 0 0 if (/->\s*setPalette/g)
1067 0 81223 if s/^(?:require_module|use_module|use_package_optimistically) \s* \( \s*//x
1070 2 81221 if s/^(?:require_ok|use_ok) \s* \( \s*//x
1077 81221 1919 unless defined $module
1078 51 0 wantarray ? :
51 1868 if ref $module
1081 29 1839 if ($module =~ /^(['"]) (.*?) \1/x) { }
0 1839 elsif ($module =~ s/^qq? \s* (\W)//x) { }
1090 1 1867 if $module =~ /^(?:[\d\._]+|'.*[^']|".*[^"])$/
1092 37 1830 unless $module =~ /\./
1098 0 4 unless $] >= "5.008" and eval { do { require Encode; %Encode::ExtModule } }
1100 4 0 unless my $mod = eval { do { $Encode::ExtModule{Encode::find_encoding($enc)->name} } }
1108 0 2087 unless defined $module and defined $file
1116 0 2087 if ("File::Spec"->case_tolerant)
1118 0 0 if (lc $key eq lc $module)
1123 0 0 if (defined $used_by)
1124 0 0 if (lc $used_by eq lc $module) { }
1128 0 0 if (lc $key eq lc $used_by)
1143 2020 67 if (defined $used_by and $used_by ne $module)
1146 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"};})
1151 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"};})
1157 0 0 ref $_[0] ? :
1640 0 @_ && $_[0] =~ /^(?:modules|rv|used_by|warn_missing)$/ ? :
1168 76 1918 unless my $file = _find_in_inc($module)
1169 1 1917 if $skip->{$file}
1171 1514 403 if (exists $rv->{$module})
1182 387 16 if ((my $path = $module) =~ s/\.p[mh]$//i)
1185 45 135 if $_->{'name'} =~ m[^auto/$path/.*/]
1186 9 126 if $_->{'name'} =~ m[/(?:\.exists|\.packlist)$|\Q$Module::ScanDeps::Config{'lib_ext'}\E$]
1216 0 1994 unless defined $file
1219 1918 17606 if -f "$dir/$file"
1223 0 76 if -f $file
1238 13586 83 unless -d $dir
1245 147 549 unless -f $_
1246 0 549 if $pm_only and not /\.p[mh]$/i
1249 369 180 $pm_only ? :
1271 0 0 unless -d $dir
1273 0 0 unless opendir my $dh, $dir
1278 0 0 $pm_only ? :
1312 0 0 unless $module =~ /\.p[mh]$/i
1314 0 0 unless my $file = _find_in_inc($module)
1348 1 126 if ($cache{$val->{'key'}}) { }
1349 1 0 unless defined $val->{'used_by'}
1365 1 3 if $type eq "main"
1368 3 0 if (UNIVERSAL::isa($info->{$type}, "HASH"))
1376 1 2 if $type eq "module"
1388 0 0 if $Preload{$pm}
1417 10 5 $execute ? :
1509 0 15 unless open my $fh, "<", $file
1519 10 5 $execute ? :
10 5 $execute ? :
1523 0 0 $execute ? :
0 15 unless $rc == 0
1528 0 15 unless my $info = do $data_file
1577 76 657 if $name =~ /\.(?:ix|al|bs)$/i
1578 547 110 if $name =~ /\.p[mh]$/i
1579 48 62 if $name =~ /\.\Q$Module::ScanDeps::Config{'dlext'}\E$/i
1590 0 164 if ($rv->{$key} and _not_dup($key, $rv, $rv_sub)) { }
0 164 elsif ($rv->{$key}) { }
1625 0 0 if ('File::Spec'->case_tolerant) { }
1635 0 0 if $SeenRuntimeLoader{$module}++
1645 76 0 unless $warn
1646 0 0 unless $module =~ /\.p[ml]$/
1647 0 0 if not -f $module
1653 1933 56 unless my $preload = $Preload{$pm}
1654 1 55 if ($preload eq 'sub') { }
29 26 elsif (UNIVERSAL::isa($preload, 'CODE')) { }
1672 0 406 if $seen->{$pm}