Branch Coverage

blib/lib/CPAN.pm
Criterion Covered Total %
branch 67 400 16.7


line true false branch
12 22 0 if ("File::Spec"->can("rel2abs"))
14 198 0 unless ref $inc
17 22 0 if exists $SIG{'WINCH'}
187 0 1 if ($CPAN::Signal)
192 0 1 if ($CPAN::autoload_recursion > 1)
200 1 0 unless $CPAN::Config_loaded++
201 0 1 if (exists $export{$l}) { }
220 0 0 if (s/^\s*>//) { }
0 0 elsif (s/^\s*\|\s*//) { }
221 0 0 s/^>// ? :
223 0 0 unless length $_
224 0 0 unless defined $_
225 0 0 unless open STDOUT, ">$m$_"
232 0 0 unless open STDOUT, $pipe
241 0 0 unless $redir
246 0 0 if "$@"
260 0 0 unless defined $CPAN::Suppress_readline
261 0 0 unless $CPAN::Config_loaded++
269 0 0 unless ($CPAN::Suppress_readline)
271 0 0 if (not $CPAN::term or $CPAN::term->ReadLine eq "Term::ReadLine::Stub")
277 0 0 if ($CPAN::term->ReadLine eq 'Term::ReadLine::Gnu') { }
286 0 0 if (my $histfile = $CPAN::Config->{'histfile'})
287 0 0 unless ($CPAN::term->can("AddHistory"))
289 0 0 unless ($CPAN::META->has_inst("Term::ReadLine::Perl"))
298 0 0 if defined $_
309 0 0 if defined $_
0 0 'File::Spec'->can('tmpdir') ? :
314 0 0 if $CPAN::term
315 0 0 unless ($CPAN::Config->{'inhibit_startup_message'})
316 0 0 $CPAN::term->ReadLine ne 'Term::ReadLine::Stub' ? :
0 0 $CPAN::Suppress_readline ? :
331 0 0 if ($CPAN::Suppress_readline) { }
332 0 0 if ($CPAN::Echo_readline)
336 0 0 unless defined($_ = readline ARGV)
337 0 0 if ($CPAN::Echo_readline)
344 0 0 unless defined($_ = $CPAN::term->readline($prompt, $commandline))
346 0 0 if $continuation
348 0 0 if /^$/
350 0 0 if (/^(?:q(?:uit)?|bye|exit)\s*$/i) { }
0 0 elsif (s/\\$//s) { }
0 0 elsif (/^\!/) { }
0 0 elsif (/./) { }
363 0 0 unless $CPAN::Eval::import_done++
364 0 0 if $CPAN::DEBUG
366 0 0 if $@
372 0 0 if $@
373 0 0 unless @line
375 0 0 if $CPAN::DEBUG
385 0 0 if ($command_error)
387 0 0 if (ref $err and $err->isa('CPAN::Exception::blocked_urllist')) { }
392 0 0 if ($err =~ /\S/)
400 0 0 if ($command =~ /^( # classic commands make |test |install |clean # pragmas for classic commands |ff?orce |notest # compounds |report |smoke |upgrade )$/x)
419 0 0 if (my $err = $@)
420 0 0 unless (ref $err and $reported_error eq ref $err)
437 0 0 if ($try_detect_readline)
438 0 0 if ($CPAN::META->has_inst("Term::ReadLine::Gnu") or $CPAN::META->has_inst("Term::ReadLine::Perl"))
451 0 0 if ($CPAN::term and $CPAN::term->can("ornaments"))
453 0 0 if (defined $_) { }
454 0 0 if (not defined $last_term_ornaments or $_ != $last_term_ornaments)
469 0 0 unless $CPAN::META->{'readwrite'}{"CPAN::$class"}{$dm}{'incommandcolor'}
474 0 0 if ($CPAN::GOTOSHELL)
476 0 0 if $CPAN::term and $CPAN::term->can("GetHistory")
487 0 0 unless (@$cwd)
495 0 0 if (CPAN::chdir("$cwd->[0]")) { }
498 0 0 if (@$cwd > 1) { }
512 14 0 if ($Config::Config{'d_flock'} or $Config::Config{'d_fcntl_can_lock'}) { }
0 0 elsif (not $CPAN::Have_warned->{'d_flock'}++) { }
525 0 59 if ($yaml_module ne "YAML" and not $CPAN::META->has_inst($yaml_module))
533 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'}++)
552 7 0 unless -s $local_file
555 0 0 if ($CPAN::META->has_inst($yaml_module)) { }
563 0 0 $opt_loadblessed ? :
566 0 0 if ($code = UNIVERSAL::can($yaml_module, 'LoadFile')) { }
0 0 elsif ($code = UNIVERSAL::can($yaml_module, 'Load')) { }
568 0 0 if ($@)
574 0 0 if (open FH, $local_file) { }
578 0 0 if ($@)
600 0 0 if ($CPAN::META->has_inst($yaml_module)) { }
602 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')) { }
609 0 0 unless open FH, ">$local_file"
612 0 0 if ($@)
616 0 0 if (UNIVERSAL::isa($local_file, 'FileHandle')) { }
625 0 0 unless ($CPAN::META->has_inst("CPAN::SQLite"))
627 0 0 unless $CPAN::Have_warned->{'CPAN::SQLite'}++
637 505 8 if ($negative_cache->{'time'} and time < $negative_cache->{'time'} + 60) { }
644 0 8 if $ret
659 0 0 if (defined $dll)
660 0 0 -f $dll ? :
662 0 0 -f &find_perl() ? :
669 0 0 if ($other_fingerprint) { }
670 0 0 if (exists $other_fingerprint->{'stat($^X)'})
675 0 0 unless $other_fingerprint->{$key} eq $this_fingerprint->{$key}
684 0 0 if (not $INC{'CPAN/MyConfig.pm'})
690 0 0 if ($new =~ /^y/i) { }
702 0 0 unless $CPAN::Config_loaded++
703 0 0 if $CPAN::DEBUG
717 0 0 if (-f $lockfile and -M _ > 0)
718 0 0 unless my $fh = "FileHandle"->new($lockfile)
723 0 0 if (defined $otherpid and length $otherpid)
726 0 0 if (defined $otherhost and length $otherhost)
731 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') { }
741 0 0 if $$ == $otherpid
746 0 0 if (kill 0, $otherpid or $!{'EPERM'}) { }
0 0 elsif (-w $lockfile) { }
754 0 0 unless $ans =~ /^y/i
775 0 0 if ($ask_if_degraded_wanted)
780 0 0 if ($ans =~ /^y/i) { }
796 0 0 if (defined $otherpid)
808 0 0 if ($@)
813 0 0 if (-l $dotcpan)
815 0 0 unless defined $symlinkcpan
817 0 0 if ($@) { }
825 0 0 unless (-d $dotcpan)
830 0 0 if $seconderror
848 0 0 unless ($CPAN::RUN_DEGRADED or $self->{'LOCKFH'})
850 0 0 unless ($fh = "FileHandle"->new("+>>$lockfile"))
871 0 0 if ($sleep > 3)
894 0 0 if $CPAN::Signal
895 0 0 if $CPAN::Signal > 1
896 0 0 if $CPAN::Signal
923 0 0 if $CPAN::DEBUG
964 22 0 if ('File::Spec'->file_name_is_absolute($^X)) { }
975 0 0 if (defined $path and length $path and -d $path)
979 0 0 if ($^O eq 'VMS') { }
0 0 elsif (defined $exe and length $exe) { }
981 0 0 unless $perl =~ /$exe(;\d+)?$/i
984 0 0 unless $perl =~ /$exe$/i
991 0 0 if ("MM"->maybe_command($perl) and _perl_is_same($perl))
1003 0 143 unless $CPAN::Config_loaded++
1007 63 80 if $class eq "CPAN::Module"
1009 0 143 if (_sqlite_running()) { }
1030 187 66 if $CPAN::HAS_USABLE->{$mod}
1032 13 53 unless $has_inst
1045 0 8 unless ("CPAN::Version"->vge("CPAN::Meta"->VERSION, "2.11035"))
1056 0 7 if (defined $CPAN::Meta::Requirements::VERSION and "CPAN::Version"->vlt($CPAN::Meta::Requirements::VERSION, "2.120920"))
1062 0 7 unless ("CPAN::Version"->vge("CPAN::Meta::Requirements"->VERSION, "2.12092"))
1073 0 0 if (defined $CPAN::Reporter::VERSION and "CPAN::Version"->vlt($CPAN::Reporter::VERSION, "1.2011"))
1079 0 0 unless ("CPAN::Version"->vge("CPAN::Reporter"->VERSION, "1.2011"))
1095 0 0 unless ("CPAN::Version"->vge("URI::URL"->VERSION, "0.08"))
1106 0 0 if ($var and $var =~ /^http:/i)
1120 0 0 unless ("CPAN::Version"->vge("IO::Socket::SSL"->VERSION, "1.56"))
1131 0 0 unless ("CPAN::Version"->vge("Net::SSLeay"->VERSION, "1.49"))
1142 0 0 unless ("CPAN::Version"->vge("HTTP::Tiny"->VERSION, "0.005"))
1152 0 0 unless ("CPAN::Version"->vge("File::HomeDir"->VERSION, "0.52"))
1163 0 8 unless ("CPAN::Version"->vge("Archive::Tar"->VERSION, $demand))
1180 0 0 unless ("CPAN::Version"->vge("File::Temp"->VERSION, "0.16"))
1189 23 30 if ($usable->{$mod})
1191 0 23 if $INC[-1] eq "."
1195 0 23 unless defined $ret
1196 0 23 if ($@)
1207 0 0 if @_
1214 0 14 unless ($self->has_inst($module))
1222 0 489 unless defined $mod
1224 482 7 unless $CPAN::META->{'dontload_hash'}
1225 49 440 unless $CPAN::Config->{'dontload_hash'}
1226 489 0 unless $CPAN::Config->{'dontload_list'}
1227 9 480 if (defined $message and $message eq "no" or $dont{$mod})
1235 0 480 if $INC[-1] eq "."
1240 295 185 if ($INC{$file}) { }
54 131 elsif (eval { do { require $file } }) { }
0 131 elsif ($mod eq 'Net::FTP') { }
0 131 elsif ($mod eq 'Digest::SHA') { }
0 131 elsif ($mod eq 'Module::Signature') { }
1258 54 0 $v ? :
1260 0 54 if ($mod eq "CPAN::WAIT")
1270 0 0 unless $CPAN::Have_warned->{'Net::FTP'}++
1273 0 0 if ($CPAN::Have_warned->{'Digest::SHA'}++) { }
1287 0 0 if (not $check_sigs) { }
0 0 elsif (not $CPAN::Have_warned->{'Module::Signature'}++) { }
1292 0 0 if (eval { do { require Crypt::OpenPGP; 1 } } or defined $CPAN::Config->{'gpg'} and $CPAN::Config->{'gpg'} =~ /\S/)
1321 97 60 if exists $CPAN::META->{'readwrite'}{$class}{$id}
1345 22 22 if $subroutine eq "(eval)"
1348 0 22 if $ineval and not $CPAN::End
1349 22 0 unless defined $CPAN::META->{'LOCK'}
1350 0 0 unless -f $CPAN::META->{'LOCK'}
1357 0 0 if ($CPAN::CONFIG_DIRTY)
1370 0 0 if defined $term->Attribs->{'MaxHistorySize'}
1372 0 0 unless open $fh, "<$histfile"
1385 0 0 unless ($histfile = $CPAN::Config->{'histfile'})
1390 0 0 if ($CPAN::term) { }
1391 0 0 unless ($CPAN::term->can("GetHistory"))
1399 0 0 if @h > $histsize
1401 0 0 unless open $fh, ">$histfile"
1410 0 1 unless ($what)
1438 0 1 if ($foul) { }
1 0 elsif (-e $_) { }
1440 0 1 if ($foul) { }
1444 0 0 if ($d->{'build_dir'} and $d->{'build_dir'} eq $dbd)
1465 23 0 unless ($for)
1470 22 1 unless %{$self->{'is_tested'};}
1472 0 1 unless defined $env
1474 1 0 if defined $env and length $env
1479 0 1 unless @dirs
1481 1 0 if (@dirs < 12) { }
0 0 elsif (@dirs < 24) { }