Branch Coverage

blib/lib/CPAN.pm
Criterion Covered Total %
branch 51 400 12.7


line true false branch
12 13 0 if ("File::Spec"->can("rel2abs"))
14 148 0 unless ref $inc
17 13 0 if exists $SIG{'WINCH'}
188 0 1 if ($CPAN::Signal)
193 0 1 if ($CPAN::autoload_recursion > 1)
201 1 0 unless $CPAN::Config_loaded++
202 0 1 if (exists $export{$l}) { }
221 0 0 if (s/^\s*>//) { }
0 0 elsif (s/^\s*\|\s*//) { }
222 0 0 s/^>// ? :
224 0 0 unless length $_
225 0 0 unless defined $_
226 0 0 unless open STDOUT, ">$m$_"
233 0 0 unless open STDOUT, $pipe
242 0 0 unless $redir
247 0 0 if "$@"
261 0 0 unless defined $CPAN::Suppress_readline
262 0 0 unless $CPAN::Config_loaded++
270 0 0 unless ($CPAN::Suppress_readline)
272 0 0 if (not $CPAN::term or $CPAN::term->ReadLine eq "Term::ReadLine::Stub")
278 0 0 if ($CPAN::term->ReadLine eq 'Term::ReadLine::Gnu') { }
287 0 0 if (my $histfile = $CPAN::Config->{'histfile'})
288 0 0 unless ($CPAN::term->can("AddHistory"))
290 0 0 unless ($CPAN::META->has_inst("Term::ReadLine::Perl"))
299 0 0 if defined $_
310 0 0 if defined $_
0 0 'File::Spec'->can('tmpdir') ? :
315 0 0 if $CPAN::term
316 0 0 unless ($CPAN::Config->{'inhibit_startup_message'})
317 0 0 $CPAN::term->ReadLine ne 'Term::ReadLine::Stub' ? :
0 0 $CPAN::Suppress_readline ? :
332 0 0 if ($CPAN::Suppress_readline) { }
333 0 0 if ($CPAN::Echo_readline)
337 0 0 unless defined($_ = readline ARGV)
338 0 0 if ($CPAN::Echo_readline)
345 0 0 unless defined($_ = $CPAN::term->readline($prompt, $commandline))
347 0 0 if $continuation
349 0 0 if /^$/
351 0 0 if (/^(?:q(?:uit)?|bye|exit)\s*$/i) { }
0 0 elsif (s/\\$//s) { }
0 0 elsif (/^\!/) { }
0 0 elsif (/./) { }
364 0 0 unless $CPAN::Eval::import_done++
365 0 0 if $CPAN::DEBUG
367 0 0 if $@
373 0 0 if $@
374 0 0 unless @line
376 0 0 if $CPAN::DEBUG
386 0 0 if ($command_error)
388 0 0 if (ref $err and $err->isa('CPAN::Exception::blocked_urllist')) { }
393 0 0 if ($err =~ /\S/)
401 0 0 if ($command =~ /^( # classic commands make |test |install |clean # pragmas for classic commands |ff?orce |notest # compounds |report |smoke |upgrade )$/x)
420 0 0 if (my $err = $@)
421 0 0 unless (ref $err and $reported_error eq ref $err)
438 0 0 if ($try_detect_readline)
439 0 0 if ($CPAN::META->has_inst("Term::ReadLine::Gnu") or $CPAN::META->has_inst("Term::ReadLine::Perl"))
452 0 0 if ($CPAN::term and $CPAN::term->can("ornaments"))
454 0 0 if (defined $_) { }
455 0 0 if (not defined $last_term_ornaments or $_ != $last_term_ornaments)
470 0 0 unless $CPAN::META->{'readwrite'}{"CPAN::$class"}{$dm}{'incommandcolor'}
475 0 0 if ($CPAN::GOTOSHELL)
477 0 0 if $CPAN::term and $CPAN::term->can("GetHistory")
488 0 0 unless (@$cwd)
496 0 0 if (CPAN::chdir("$cwd->[0]")) { }
499 0 0 if (@$cwd > 1) { }
513 0 0 if ($Config::Config{'d_flock'} or $Config::Config{'d_fcntl_can_lock'}) { }
0 0 elsif (not $CPAN::Have_warned->{'d_flock'}++) { }
526 0 3 if ($yaml_module ne "YAML" and not $CPAN::META->has_inst($yaml_module))
534 0 0 if ($yaml_module eq "YAML" and $CPAN::META->has_inst($yaml_module) and $YAML::VERSION < "0.6" and not $CPAN::Have_warned->{'YAML'}++)
553 0 0 unless -s $local_file
556 0 0 if ($CPAN::META->has_inst($yaml_module)) { }
564 0 0 $opt_loadblessed ? :
567 0 0 if ($code = UNIVERSAL::can($yaml_module, 'LoadFile')) { }
0 0 elsif ($code = UNIVERSAL::can($yaml_module, 'Load')) { }
569 0 0 if ($@)
575 0 0 if (open FH, $local_file) { }
579 0 0 if ($@)
601 0 0 if ($CPAN::META->has_inst($yaml_module)) { }
603 0 0 if (UNIVERSAL::isa($local_file, 'FileHandle')) { }
0 0 elsif ($code = UNIVERSAL::can($yaml_module, 'DumpFile')) { }
0 0 elsif ($code = UNIVERSAL::can($yaml_module, 'Dump')) { }
610 0 0 unless open FH, ">$local_file"
613 0 0 if ($@)
617 0 0 if (UNIVERSAL::isa($local_file, 'FileHandle')) { }
626 0 0 unless ($CPAN::META->has_inst("CPAN::SQLite"))
628 0 0 unless $CPAN::Have_warned->{'CPAN::SQLite'}++
638 129 1 if ($negative_cache->{'time'} and time < $negative_cache->{'time'} + 60) { }
645 0 1 if $ret
660 0 0 if (defined $dll)
661 0 0 -f $dll ? :
663 0 0 -f &find_perl() ? :
670 0 0 if ($other_fingerprint) { }
671 0 0 if (exists $other_fingerprint->{'stat($^X)'})
676 0 0 unless $other_fingerprint->{$key} eq $this_fingerprint->{$key}
685 0 0 if (not $INC{'CPAN/MyConfig.pm'})
691 0 0 if ($new =~ /^y/i) { }
703 0 0 unless $CPAN::Config_loaded++
704 0 0 if $CPAN::DEBUG
718 0 0 if (-f $lockfile and -M _ > 0)
719 0 0 unless my $fh = "FileHandle"->new($lockfile)
724 0 0 if (defined $otherpid and length $otherpid)
727 0 0 if (defined $otherhost and length $otherhost)
732 0 0 if (defined $otherhost and defined $thishost and $otherhost ne '' and $thishost ne '' and $otherhost ne $thishost) { }
0 0 elsif ($CPAN::RUN_DEGRADED) { }
0 0 elsif (defined $otherpid and $otherpid) { }
0 0 elsif ($^O eq 'MSWin32') { }
742 0 0 if $$ == $otherpid
747 0 0 if (kill 0, $otherpid or $!{'EPERM'}) { }
0 0 elsif (-w $lockfile) { }
755 0 0 unless $ans =~ /^y/i
776 0 0 if ($ask_if_degraded_wanted)
781 0 0 if ($ans =~ /^y/i) { }
797 0 0 if (defined $otherpid)
809 0 0 if ($@)
814 0 0 if (-l $dotcpan)
816 0 0 unless defined $symlinkcpan
818 0 0 if ($@) { }
826 0 0 unless (-d $dotcpan)
831 0 0 if $seconderror
849 0 0 unless ($CPAN::RUN_DEGRADED or $self->{'LOCKFH'})
851 0 0 unless ($fh = "FileHandle"->new("+>>$lockfile"))
872 0 0 if ($sleep > 3)
895 0 0 if $CPAN::Signal
896 0 0 if $CPAN::Signal > 1
897 0 0 if $CPAN::Signal
924 0 0 if $CPAN::DEBUG
965 13 0 if ('File::Spec'->file_name_is_absolute($^X)) { }
976 0 0 if (defined $path and length $path and -d $path)
980 0 0 if ($^O eq 'VMS') { }
0 0 elsif (defined $exe and length $exe) { }
982 0 0 unless $perl =~ /$exe(;\d+)?$/i
985 0 0 unless $perl =~ /$exe$/i
992 0 0 if ("MM"->maybe_command($perl) and _perl_is_same($perl))
1004 0 31 unless $CPAN::Config_loaded++
1008 10 21 if $class eq "CPAN::Module"
1010 0 31 if (_sqlite_running()) { }
1031 109 6 if $CPAN::HAS_USABLE->{$mod}
1033 3 3 unless $has_inst
1046 0 1 unless ("CPAN::Version"->vge("CPAN::Meta"->VERSION, "2.11035"))
1057 0 0 if (defined $CPAN::Meta::Requirements::VERSION and "CPAN::Version"->vlt($CPAN::Meta::Requirements::VERSION, "2.120920"))
1063 0 0 unless ("CPAN::Version"->vge("CPAN::Meta::Requirements"->VERSION, "2.12092"))
1074 0 0 if (defined $CPAN::Reporter::VERSION and "CPAN::Version"->vlt($CPAN::Reporter::VERSION, "1.2011"))
1080 0 0 unless ("CPAN::Version"->vge("CPAN::Reporter"->VERSION, "1.2011"))
1096 0 0 unless ("CPAN::Version"->vge("URI::URL"->VERSION, "0.08"))
1107 0 0 if ($var and $var =~ /^http:/i)
1121 0 0 unless ("CPAN::Version"->vge("IO::Socket::SSL"->VERSION, "1.56"))
1132 0 0 unless ("CPAN::Version"->vge("Net::SSLeay"->VERSION, "1.49"))
1143 0 0 unless ("CPAN::Version"->vge("HTTP::Tiny"->VERSION, "0.005"))
1153 0 0 unless ("CPAN::Version"->vge("File::HomeDir"->VERSION, "0.52"))
1164 0 1 unless ("CPAN::Version"->vge("Archive::Tar"->VERSION, $demand))
1181 0 0 unless ("CPAN::Version"->vge("File::Temp"->VERSION, "0.16"))
1190 2 1 if ($usable->{$mod})
1192 0 2 if $INC[-1] eq "."
1196 0 2 unless defined $ret
1197 0 2 if ($@)
1208 0 0 if @_
1215 0 8 unless ($self->has_inst($module))
1223 0 51 unless defined $mod
1225 44 7 unless $CPAN::META->{'dontload_hash'}
1226 51 0 unless $CPAN::Config->{'dontload_hash'}
1227 51 0 unless $CPAN::Config->{'dontload_list'}
1228 9 42 if (defined $message and $message eq "no" or $dont{$mod})
1236 0 42 if $INC[-1] eq "."
1241 25 17 if ($INC{$file}) { }
7 10 elsif (eval { do { require $file } }) { }
0 10 elsif ($mod eq 'Net::FTP') { }
0 10 elsif ($mod eq 'Digest::SHA') { }
0 10 elsif ($mod eq 'Module::Signature') { }
1259 7 0 $v ? :
1261 0 7 if ($mod eq "CPAN::WAIT")
1271 0 0 unless $CPAN::Have_warned->{'Net::FTP'}++
1274 0 0 if ($CPAN::Have_warned->{'Digest::SHA'}++) { }
1288 0 0 if (not $check_sigs) { }
0 0 elsif (not $CPAN::Have_warned->{'Module::Signature'}++) { }
1293 0 0 if (eval { do { require Crypt::OpenPGP; 1 } } or defined $CPAN::Config->{'gpg'} and $CPAN::Config->{'gpg'} =~ /\S/)
1322 5 41 if exists $CPAN::META->{'readwrite'}{$class}{$id}
1346 13 13 if $subroutine eq "(eval)"
1349 0 13 if $ineval and not $CPAN::End
1350 13 0 unless defined $CPAN::META->{'LOCK'}
1351 0 0 unless -f $CPAN::META->{'LOCK'}
1358 0 0 if ($CPAN::CONFIG_DIRTY)
1371 0 0 if defined $term->Attribs->{'MaxHistorySize'}
1373 0 0 unless open $fh, "<$histfile"
1386 0 0 unless ($histfile = $CPAN::Config->{'histfile'})
1391 0 0 if ($CPAN::term) { }
1392 0 0 unless ($CPAN::term->can("GetHistory"))
1400 0 0 if @h > $histsize
1402 0 0 unless open $fh, ">$histfile"
1411 0 0 unless ($what)
1439 0 0 if ($foul) { }
0 0 elsif (-e $_) { }
1441 0 0 if ($foul) { }
1445 0 0 if ($d->{'build_dir'} and $d->{'build_dir'} eq $dbd)
1466 0 0 unless ($for)
1471 0 0 unless %{$self->{'is_tested'};}
1473 0 0 unless defined $env
1475 0 0 if defined $env and length $env
1480 0 0 unless @dirs
1482 0 0 if (@dirs < 12) { }
0 0 elsif (@dirs < 24) { }