Branch Coverage

blib/lib/CPAN/Shell.pm
Criterion Covered Total %
branch 28 648 4.3


line true false branch
113 0 0 if ($CPAN::Signal)
118 0 0 if ($CPAN::Shell::autoload_recursion > 1)
124 0 0 if ($l =~ /^w/) { }
126 0 0 if ($CPAN::META->has_inst('CPAN::WAIT')) { }
149 0 0 if (defined $about) { }
151 0 0 if (exists $$CPAN::Shell::Help{$about}) { }
152 0 0 if (ref $$CPAN::Shell::Help{$about})
200 0 0 unless /=/
212 0 0 if ($s =~ m[[\*\?/]]) { }
213 0 0 if ($CPAN::META->has_inst('Text::Glob')) { }
214 0 0 if (my($au, $pathglob) = $s =~ m[(.*?)/(.*)]) { }
216 0 0 if $CPAN::DEBUG
234 0 0 unless (m[^[A-Z0-9\-]+(/|$)]i)
245 0 0 if ($a =~ m[(.*?)/(.*)]) { }
248 0 0 unless $author = 'CPAN::Shell'->expand_by_method('CPAN::Author', ['id'], $a2)
253 0 0 unless $author = 'CPAN::Shell'->expand_by_method('CPAN::Author', ['id'], $a)
258 0 0 if ($silent)
261 0 0 if ($alpha eq $last_alpha) { }
270 0 0 if ($author->can($pragma))
274 0 0 if $CPAN::DEBUG
280 0 0 if ($author->can($unpragma))
296 0 0 if $CPAN::DEBUG
297 0 0 if ($dh = 'DirHandle'->new($bdir))
300 0 0 if $entry =~ /^\./
301 0 0 unless $entry =~ /^\w+(\.pm)?(?!\n)\Z/
302 0 0 if (-d 'File::Spec'->catdir($bdir, $entry)) { }
305 0 0 unless $entry =~ s/\.pm(?!\n)\Z//
317 0 0 if $CPAN::DEBUG
330 0 0 if (m[(?:\w+/)*\w+\.pm$])
342 0 0 unless @args
355 0 0 @result == 0 ? :
0 0 @result == 1 ? :
371 0 0 if ($o_type eq 'conf') { }
0 0 elsif ($o_type eq 'debug') { }
373 0 0 if @o_what
374 0 0 if (not @o_what or $cfilter) { }
381 0 0 unless $k =~ /$qrfilter/
387 0 0 unless $k =~ /$qrfilter/
392 0 0 if ('CPAN::HandleConfig'->edit(@o_what)) { }
400 0 0 if defined $o_what[0] and $o_what[0] =~ /help/i
401 0 0 if (@o_what) { }
404 0 0 if ($what =~ s/^-// and exists $CPAN::DEBUG{$what})
408 0 0 if (exists $CPAN::DEBUG{$what}) { }
0 0 elsif ($what =~ /^\d/) { }
0 0 elsif (lc $what eq 'all') { }
421 0 0 unless lc $_ eq lc $what
425 0 0 unless $known
438 0 0 if ($CPAN::DEBUG) { }
443 0 0 if $v & $CPAN::DEBUG
462 0 0 if ($_[0] =~ /[Ss]ubroutine ([\w:]+) redefined/)
468 0 0 if ($subr =~ /\bshell\b/i)
490 0 0 unless my $attempts = $$last{'attempts'}
492 0 0 if (@$attempts) { }
494 0 0 if ($#$attempts > 0)
496 0 0 unless my $url = $$attempts[$i]{'url'}
503 0 0 unless $$last{'thesiteurl'}
508 0 0 ref $$last{'thesiteurl'} ? :
518 0 0 if $S{'ok'}{$url}{'dltime'} == 0
530 0 0 if ($S{'start'} and $S{'end'})
531 0 0 $S{'start'} ? :
532 0 0 $S{'end'} ? :
534 0 0 if ($$res{'ok'} and @{$$res{'ok'};})
540 0 0 if --$i <= 0
543 0 0 if ($$res{'no'} and @{$$res{'no'};})
548 0 0 if --$i <= 0
559 0 0 if $CPAN::DEBUG
560 0 0 if ($command =~ /^cpan$/i) { }
0 0 elsif ($command =~ /^index$/i) { }
562 0 0 if $CPAN::iCwd
565 0 0 unless exists $INC{$f}
571 0 0 unless $self->_reload_this($f)
576 0 0 if ($failed)
577 0 0 $failed == 1 ? :
593 0 0 if $CPAN::DEBUG
594 0 0 unless $INC{$f}
597 0 0 if $CPAN::DEBUG
601 0 0 if -f $file
604 0 0 if $CPAN::DEBUG
606 0 0 unless ($file and -f $file)
609 0 0 if (not 'CPAN'->has_inst('File::Basename')) { }
616 0 0 if $CPAN::DEBUG
617 0 0 unless (-f $file)
626 0 0 if ($must_reload) { }
627 0 0 unless my $fh = 'FileHandle'->new($file)
635 0 0 if $CPAN::DEBUG
640 0 0 if ($@)
654 0 0 if (my $configpm = $INC{'CPAN/MyConfig.pm'}) { }
676 0 0 if $file eq 'N/A'
677 0 0 if $file =~ /^Contact Author/
679 0 0 if $dist->isa_perl
680 0 0 unless $module->xs_file
718 0 0 unless ($CPAN::META->has_inst($req))
724 0 0 unless (-f $indexfile)
730 0 0 if ($arg =~ s[^/(.+)/$][$1])
735 0 0 unless $tag eq 'a'
738 0 0 unless $href =~ s[^\.\./authors/id/./../][]
739 0 0 if ($arg) { }
740 0 0 if ($qrarg) { }
741 0 0 if ($href =~ /$qrarg/)
745 0 0 if ($href =~ /\Q$arg\E/)
764 0 0 if (@{$stems{$_};} > 1) { }
766 0 0 Sort::Versions::versioncmp($a, $b) > 0 ? :
779 0 0 if (exists $$contains{$dist}) { }
0 0 elsif (1 == keys %$contains) { }
785 0 0 if ($module) { }
799 0 0 unless ($CPAN::META->has_inst('CPAN::DistnameInfo'))
802 0 0 unless my $d = 'CPAN::Shell'->expand('Distribution', $distribution)
804 0 0 unless my $build_dir = $$d{'build_dir'}
835 0 0 unless defined $v
846 0 0 unless (@xs)
852 0 0 unless (@xs)
858 0 0 $v eq 'undef' ? :
861 0 0 if (my $prereq_pm = $$d{'prereq_pm'})
868 0 0 if (-e "$build_dir/Build.PL" and not exists $req{'Module::Build'})
872 0 0 if $k eq 'perl'
874 0 0 defined $v && length $v && $v > 0 ? :
876 0 0 if $k =~ /^(Module::Build)$/
894 0 0 if (-e "$build_dir/Build.PL") { }
0 0 elsif (-e "$build_dir/Makefile.PL") { }
932 0 0 @xs ? :
936 0 0 if (my $exe_files = $d->_exe_files)
937 0 0 if (@$exe_files)
940 0 0 unless ('CPAN'->has_inst('File::Basename'))
964 0 0 unless open my $specout, '>', "perl-$dist.spec"
973 0 0 unless ($CPAN::META->has_inst('CPAN::Reporter'))
985 0 0 if @some
991 0 0 unless (-f $yaml)
997 0 0 unless ($id)
1002 0 0 unless ($do)
1006 0 0 unless ($$do{'build_dir'})
1010 0 0 unless ($$do{'build_dir'} eq $b)
1017 0 0 unless @some
1020 0 0 if $$_{'make_test'}
1021 0 0 unless @some
1030 0 0 $d->can('pretty_id') ? :
1047 0 0 if $CPAN::DEBUG
1048 0 0 unless $what and $what =~ /^[aru]$/
1051 0 0 unless @args
1058 0 0 if ($CPAN::DEBUG)
1064 0 0 if ($] < 5.008) { }
1070 0 0 unless $$b[0] <=> $$a[0]
1081 0 0 if ($CPAN::DEBUG)
1087 0 0 unless defined $file
1091 0 0 if $CPAN::DEBUG
1093 0 0 if $CPAN::Signal
1096 0 0 if ($inst_file) { }
1097 0 0 if ($what eq 'a') { }
0 0 elsif ($what eq 'r') { }
0 0 elsif ($what eq 'u') { }
1102 0 0 if ($have eq 'undef') { }
0 0 elsif ('CPAN::Version'->vcmp($have, 0) == 0) { }
1109 0 0 unless 'CPAN::Version'->vgt($latest, $have)
1117 0 0 if ($what eq 'a') { }
0 0 elsif ($what eq 'r') { }
0 0 elsif ($what eq 'u') { }
1126 0 0 if $next_MODULE
1127 0 0 if ($@)
1128 0 0 defined $have ? :
0 0 ref $have ? :
0 0 ref $latest ? :
1143 0 0 if $CPAN::Signal
1145 0 0 if ($what eq 'a') { }
0 0 elsif ($what eq 'r') { }
0 0 elsif ($what eq 'u') { }
1149 0 0 if $seen{$file}++
1152 0 0 if $seen{$file}++
1153 0 0 if $file =~ /^Contact/
1155 0 0 unless ($headerdone++)
1169 0 0 if ($CPAN::Shell::COLOR_REGISTERED and $CPAN::META->has_inst('Term::ANSIColor') and $module->description)
1188 0 0 unless (%need)
1189 0 0 if ($what eq 'u') { }
0 0 elsif ($what eq 'r') { }
1195 0 0 if ($what eq 'r')
1196 0 0 if ($version_zeroes)
1197 0 0 $version_zeroes > 1 ? :
1200 0 0 if ($$CPAN::Config{'show_zero_versions'}) { }
1210 0 0 if ($version_undefs)
1211 0 0 $version_undefs > 1 ? :
1214 0 0 if ($$CPAN::Config{'show_unparsable_versions'}) { }
1243 0 0 if ($only_id) { }
0 0 elsif ($CPAN::Index::HAVE_REANIMATED) { }
1252 0 0 if (@failed) { }
0 0 elsif (not $only_id && $silent) { }
1255 0 0 if ($debug) { }
1261 0 0 unless $$a[0] <=> $$b[0]
1288 0 0 unless exists $$d{$nosayer}
1289 0 0 unless defined $$d{$nosayer}
1291 0 0 UNIVERSAL::can($$d{$nosayer}, 'failed') ? :
0 0 unless UNIVERSAL::can($$d{$nosayer}, 'failed') ? $$d{$nosayer}->failed : $$d{$nosayer} =~ /^NO/
1295 0 0 UNIVERSAL::can($$d{$nosayer}, 'commandid') ? :
0 0 if $only_id and $only_id != (UNIVERSAL::can($$d{$nosayer}, 'commandid') ? $$d{$nosayer}->commandid : $CPAN::CurrentCommandId)
1305 0 0 unless $failed
1311 0 0 unless $$d{'mandatory'}
1314 0 0 UNIVERSAL::can($$d{$failed}, 'failed') ? :
1354 0 0 unless /VmSize:\s+(\d+)/
1366 0 0 unless substr($k, 0, 4) eq 'read'
1384 0 0 if ($$CPAN::META{'is_tested'}{$b}) { }
1397 0 0 unless $CPAN::Config_loaded++
1401 0 0 unless (-d $todir)
1415 0 0 unless my($fh) = 'FileHandle'->new(">$to")
1445 0 7 if $CPAN::DEBUG
1447 0 7 if ($s =~ m[(?:\w+/)*\w+\.pm$])
1452 0 7 if ($module_as_path) { }
0 7 elsif ($s =~ m[/] or substr($s, -1, 1) eq '.') { }
0 7 elsif ($s =~ /^Bundle::/) { }
1453 0 0 if ($module_as_path =~ /^Bundle::/) { }
1457 0 0 if $CPAN::META->exists('CPAN::Module', $module_as_path)
1471 0 7 if $CPAN::META->exists('CPAN::Module', $s)
1481 0 4 if $CPAN::DEBUG
1485 3 1 unless $class->can($meth)
1498 0 4 if ($arg =~ m[^/(.*)/$])
1506 0 0 defined $regex ? :
0 0 defined $command ? :
0 4 if $CPAN::DEBUG
1511 0 4 if (defined $regex) { }
0 4 elsif ($command) { }
1512 0 0 if (CPAN::_sqlite_running())
1519 0 0 unless ($obj and UNIVERSAL::can($obj, 'id') and $obj->id)
1522 0 0 if $CPAN::DEBUG
1531 0 0 if ($@) { }
0 0 elsif ($match) { }
1542 0 0 unless $CPAN::Shell::ADVANCED_QUERY
1555 0 0 unless my $lhs = $self->$method
1556 0 0 if ($matchcrit) { }
1557 0 0 if $lhs =~ /$matchcrit/
1559 0 0 if $lhs eq $criterion
1564 0 4 if ($class eq 'CPAN::Bundle') { }
1 3 elsif ($class eq 'CPAN::Distribution') { }
1571 4 0 if ($CPAN::META->exists($class, $xarg)) { }
0 0 elsif ($CPAN::META->exists($class, $arg)) { }
1582 0 4 if ($CPAN::DEBUG)
1589 0 4 wantarray ? :
1596 0 0 unless @args
1603 0 0 @result == 0 ? :
0 0 @result == 1 ? :
1615 0 0 if $installation_report_fh
1616 0 0 if ($CPAN::META->has_usable('File::Temp'))
1625 0 0 unless ($installation_report_fh)
1626 0 0 unless $previously_noticed++
1646 0 0 if ($colorize_output and $^O eq 'MSWin32' and not $CPAN::META->has_inst('Win32::Console::ANSI'))
1647 0 0 unless ($print_ornamented_have_warned++)
1654 0 165 if ($colorize_output and not $CPAN::META->has_inst('Term::ANSIColor'))
1655 0 0 unless ($print_ornamented_have_warned++)
1670 0 165 unless defined $what
1673 0 165 if ($CPAN::Be_Silent)
1679 0 165 if ($$CPAN::Config{'term_is_latin'})
1685 0 165 if ($self->colorize_output) { }
1686 0 0 if ($CPAN::DEBUG and $swhat =~ /^Debug\(/)
1691 0 0 if ($@)
1700 0 0 if $swhat =~ s/([\r\n]+)\z//
1727 0 0 unless $already_printed{$what}++
1733 2 5 unless $CPAN::Config_loaded++
1734 6 1 if (not $$CPAN::Config{$vname} or $$CPAN::Config{$vname} =~ /^v/)
1758 0 0 unless $already_warned{$what}++
1778 0 0 if ('CPAN::Shell'->colorize_output)
1784 0 0 if ('CPAN::Shell'->colorize_output)
1797 0 0 if length $l > $longest
1799 0 0 if $longest > 62
1801 0 0 if ($l =~ /^\s*$/)
1806 0 0 if (length $l < 66)
1817 0 0 if $ENV{'AUTOMATED_TESTING'} or not -t STDOUT
1819 0 0 if ('CPAN'->has_inst('Time::HiRes')) { }
1822 0 0 $sleep < 1 ? :
1828 0 0 if -t STDOUT
1846 0 0 unless $meth = shift @some
1851 0 0 if $CPAN::DEBUG
1875 0 0 if (ref $s) { }
0 0 elsif ($s =~ /[\$\@\%]/) { }
0 0 elsif ($s =~ m[^/]) { }
0 0 elsif ($meth eq 'ls') { }
1876 0 0 if $CPAN::DEBUG
1880 0 0 if (substr($s, -1, 1) eq '.') { }
1885 0 0 if (@obj = $self->expand($class, $s))
1889 0 0 if (@obj)
1890 0 0 if (1 == @obj) { }
1904 0 0 if $CPAN::DEBUG
1907 0 0 if (do { ref $obj }) { }
0 0 elsif ($CPAN::META->exists('CPAN::Author', uc $s)) { }
0 0 elsif ($s =~ /[\$\@\%]/ and $meth eq 'dump') { }
1909 0 0 if ($meth =~ /^($needs_recursion_protection)$/)
1912 0 0 if $CPAN::DEBUG
1914 0 0 if ($@)
1915 0 0 if (ref $@ and $@->isa('CPAN::Exception::RecursiveDependency')) { }
1931 0 0 if ($meth =~ /^(dump|ls|reports)$/) { }
1967 0 0 unless ($obj)
1979 0 0 if ($type eq 'CPAN::Distribution' or $type eq 'CPAN::Bundle') { }
0 0 elsif ($type eq 'CPAN::Module') { }
1984 0 0 if (my $d = $obj->distribution) { }
0 0 elsif ($optional) { }
2001 0 0 if $CPAN::DEBUG
2004 0 0 if ($$obj{'reqtype'}) { }
2005 0 0 if ($$obj{'reqtype'} eq 'b' and $reqtype =~ /^[rc]$/)
2007 0 0 UNIVERSAL::can($$obj{'install'}, 'failed') ? :
0 0 if (exists $$obj{'install'} and UNIVERSAL::can($$obj{'install'}, 'failed') ? $$obj{'install'}->failed : $$obj{'install'} =~ /^NO/)
2026 0 0 if ($pragma and $obj->can($pragma))
2032 0 0 if (UNIVERSAL::can($obj, 'called_for'))
2035 0 0 if $CPAN::DEBUG
2039 0 0 if ($meth =~ /^(report)$/) { }
0 0 elsif (not UNIVERSAL::can($obj, $meth)) { }
2044 0 0 if (do { $CPAN::META->has_inst('YAML::Syck') }) { }
0 0 elsif ($CPAN::META->has_inst('YAML')) { }
0 0 elsif ($CPAN::META->has_inst('Data::Dumper')) { }
2055 0 0 if $CPAN::DEBUG
2059 0 0 if ($meth eq 'make' and $$obj{'reqtype'} eq 'b')
2063 0 0 if ($obj->$upgraded_meth) { }
2065 0 0 if $CPAN::DEBUG
2067 0 0 if $CPAN::DEBUG
2074 0 0 if ($obj->can($unpragma))
2081 0 0 if ($$CPAN::Config{'halt_on_failure'} and $$obj{'mandatory'} and &CPAN::Distrostatus::something_has_just_failed() and $self->mandatory_dist_failed)
2092 0 0 if ($meth =~ /^($needs_recursion_protection)$/)
2102 0 0 if ($CPAN::META->has_inst('XML::LibXML')) { }
2105 0 0 unless ($CPAN::META->has_usable('LWP'))
2111 0 0 if ($@)
2115 0 0 unless ($resp->is_success)
2127 0 0 if ($url =~ /winnipeg/) { }
0 0 elsif ($url =~ /search.*uploads.rdf/) { }
2157 0 0 unless my $author = uc $1
2161 0 0 if ++$i >= 6
2162 0 0 if (my(@ret) = $self->globls("$distro*"))
2165 0 0 if (@ret)
2173 0 0 if $distro =~ /\*/
2176 0 0 if $finish_eitem
2191 0 0 if $distro =~ m[/Bundle-]
2199 0 0 if ($skip)