Branch Coverage

blib/lib/CPAN.pm
Criterion Covered Total %
branch 51 388 13.1


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'))
296 0 0 if defined $_
307 0 0 if defined $_
0 0 'File::Spec'->can('tmpdir') ? :
312 0 0 if $CPAN::term
313 0 0 unless ($CPAN::Config->{'inhibit_startup_message'})
314 0 0 $CPAN::term->ReadLine ne 'Term::ReadLine::Stub' ? :
0 0 $CPAN::Suppress_readline ? :
329 0 0 if ($CPAN::Suppress_readline) { }
330 0 0 if ($CPAN::Echo_readline)
334 0 0 unless defined($_ = readline ARGV)
335 0 0 if ($CPAN::Echo_readline)
342 0 0 unless defined($_ = $CPAN::term->readline($prompt, $commandline))
344 0 0 if $continuation
346 0 0 if /^$/
348 0 0 if (/^(?:q(?:uit)?|bye|exit)\s*$/i) { }
0 0 elsif (s/\\$//s) { }
0 0 elsif (/^\!/) { }
0 0 elsif (/./) { }
361 0 0 unless $CPAN::Eval::import_done++
362 0 0 if $CPAN::DEBUG
364 0 0 if $@
370 0 0 if $@
371 0 0 unless @line
373 0 0 if $CPAN::DEBUG
383 0 0 if ($command_error)
385 0 0 if (ref $err and $err->isa('CPAN::Exception::blocked_urllist')) { }
390 0 0 if ($err =~ /\S/)
398 0 0 if ($command =~ /^( # classic commands make |test |install |clean # pragmas for classic commands |ff?orce |notest # compounds |report |smoke |upgrade )$/x)
417 0 0 if (my $err = $@)
418 0 0 unless (ref $err and $reported_error eq ref $err)
435 0 0 if ($try_detect_readline)
436 0 0 if ($CPAN::META->has_inst('Term::ReadLine::Gnu') or $CPAN::META->has_inst('Term::ReadLine::Perl'))
449 0 0 if ($CPAN::term and $CPAN::term->can('ornaments'))
451 0 0 if (defined $_) { }
452 0 0 if (not defined $last_term_ornaments or $_ != $last_term_ornaments)
467 0 0 unless $CPAN::META->{'readwrite'}{"CPAN::$class"}{$dm}{'incommandcolor'}
472 0 0 if ($CPAN::GOTOSHELL)
474 0 0 if $CPAN::term and $CPAN::term->can('GetHistory')
485 0 0 unless (@$cwd)
493 0 0 if (CPAN::chdir("$cwd->[0]")) { }
496 0 0 if (@$cwd > 1) { }
510 0 0 if ($Config::Config{'d_flock'} or $Config::Config{'d_fcntl_can_lock'}) { }
0 0 elsif (not $CPAN::Have_warned->{'d_flock'}++) { }
523 0 3 if ($yaml_module ne 'YAML' and not $CPAN::META->has_inst($yaml_module))
531 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'}++)
550 0 0 unless -s $local_file
552 0 0 if ($CPAN::META->has_inst($yaml_module)) { }
561 0 0 if ($code = UNIVERSAL::can($yaml_module, 'LoadFile')) { }
0 0 elsif ($code = UNIVERSAL::can($yaml_module, 'Load')) { }
563 0 0 if ($@)
569 0 0 unless (open FH, $local_file)
576 0 0 if ($@)
594 0 0 if ($CPAN::META->has_inst($yaml_module)) { }
596 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')) { }
603 0 0 unless open FH, ">$local_file"
606 0 0 if ($@)
610 0 0 if (UNIVERSAL::isa($local_file, 'FileHandle')) { }
619 0 0 unless ($CPAN::META->has_inst('CPAN::SQLite'))
621 0 0 unless $CPAN::Have_warned->{'CPAN::SQLite'}++
631 129 1 if ($negative_cache->{'time'} and time < $negative_cache->{'time'} + 60) { }
638 0 1 if $ret
653 0 0 if (defined $dll)
654 0 0 -f $dll ? :
656 0 0 -f &find_perl() ? :
663 0 0 if ($other_fingerprint) { }
664 0 0 if (exists $other_fingerprint->{'stat($^X)'})
669 0 0 unless $other_fingerprint->{$key} eq $this_fingerprint->{$key}
678 0 0 if (not $INC{'CPAN/MyConfig.pm'})
684 0 0 if ($new =~ /^y/i) { }
696 0 0 unless $CPAN::Config_loaded++
697 0 0 if $CPAN::DEBUG
711 0 0 if (-f $lockfile and -M _ > 0)
712 0 0 unless my $fh = 'FileHandle'->new($lockfile)
717 0 0 if (defined $otherpid and length $otherpid)
720 0 0 if (defined $otherhost and length $otherhost)
725 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') { }
735 0 0 if $$ == $otherpid
740 0 0 if (kill 0, $otherpid or $!{'EPERM'}) { }
0 0 elsif (-w $lockfile) { }
748 0 0 unless $ans =~ /^y/i
769 0 0 if ($ask_if_degraded_wanted)
774 0 0 if ($ans =~ /^y/i) { }
790 0 0 if (defined $otherpid)
802 0 0 if ($@)
807 0 0 if (-l $dotcpan)
809 0 0 unless defined $symlinkcpan
811 0 0 if ($@) { }
819 0 0 unless (-d $dotcpan)
824 0 0 if $seconderror
842 0 0 unless ($CPAN::RUN_DEGRADED or $self->{'LOCKFH'})
844 0 0 unless ($fh = 'FileHandle'->new("+>>$lockfile"))
865 0 0 if ($sleep > 3)
888 0 0 if $CPAN::Signal
889 0 0 if $CPAN::Signal > 1
890 0 0 if $CPAN::Signal
917 0 0 if $CPAN::DEBUG
958 13 0 if ('File::Spec'->file_name_is_absolute($^X)) { }
969 0 0 if (defined $path and length $path and -d $path)
973 0 0 if ($^O eq 'VMS') { }
0 0 elsif (defined $exe and length $exe) { }
975 0 0 unless $perl =~ /$exe(;\d+)?$/i
978 0 0 unless $perl =~ /$exe$/i
985 0 0 if ('MM'->maybe_command($perl) and _perl_is_same($perl))
997 0 31 unless $CPAN::Config_loaded++
1001 10 21 if $class eq 'CPAN::Module'
1003 0 31 if (_sqlite_running()) { }
1024 109 6 if $CPAN::HAS_USABLE->{$mod}
1026 3 3 unless $has_inst
1036 0 1 unless ('CPAN::Version'->vge('CPAN::Meta'->VERSION, 2.11035))
1047 0 0 if (defined $CPAN::Meta::Requirements::VERSION and 'CPAN::Version'->vlt($CPAN::Meta::Requirements::VERSION, '2.120920'))
1053 0 0 unless ('CPAN::Version'->vge('CPAN::Meta::Requirements'->VERSION, 2.12092))
1069 0 0 unless ('CPAN::Version'->vge('URI::URL'->VERSION, 0.08))
1080 0 0 if ($var and $var =~ /^http:/i)
1094 0 0 unless ('CPAN::Version'->vge('HTTP::Tiny'->VERSION, 0.005))
1104 0 0 unless ('CPAN::Version'->vge('File::HomeDir'->VERSION, 0.52))
1115 0 1 unless ('CPAN::Version'->vge('Archive::Tar'->VERSION, $demand))
1132 0 0 unless ('CPAN::Version'->vge('File::Temp'->VERSION, 0.16))
1141 2 1 if ($usable->{$mod})
1143 0 2 if $INC[-1] eq '.'
1147 0 2 unless defined $ret
1148 0 2 if ($@)
1159 0 0 if @_
1166 0 8 unless ($self->has_inst($module))
1174 0 51 unless defined $mod
1176 44 7 unless $CPAN::META->{'dontload_hash'}
1177 51 0 unless $CPAN::Config->{'dontload_hash'}
1178 51 0 unless $CPAN::Config->{'dontload_list'}
1179 9 42 if (defined $message and $message eq 'no' or $dont{$mod})
1187 0 42 if $INC[-1] eq '.'
1192 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') { }
1210 7 0 $v ? :
1212 0 7 if ($mod eq 'CPAN::WAIT')
1222 0 0 unless $CPAN::Have_warned->{'Net::FTP'}++
1225 0 0 if ($CPAN::Have_warned->{'Digest::SHA'}++) { }
1239 0 0 if (not $check_sigs) { }
0 0 elsif (not $CPAN::Have_warned->{'Module::Signature'}++) { }
1244 0 0 if (eval { do { require Crypt::OpenPGP; 1 } } or defined $CPAN::Config->{'gpg'} and $CPAN::Config->{'gpg'} =~ /\S/)
1273 5 41 if exists $CPAN::META->{'readwrite'}{$class}{$id}
1297 13 13 if $subroutine eq '(eval)'
1300 0 13 if $ineval and not $CPAN::End
1301 13 0 unless defined $CPAN::META->{'LOCK'}
1302 0 0 unless -f $CPAN::META->{'LOCK'}
1309 0 0 if ($CPAN::CONFIG_DIRTY)
1322 0 0 if defined $term->Attribs->{'MaxHistorySize'}
1324 0 0 unless open $fh, "<$histfile"
1337 0 0 unless ($histfile = $CPAN::Config->{'histfile'})
1342 0 0 if ($CPAN::term) { }
1343 0 0 unless ($CPAN::term->can('GetHistory'))
1351 0 0 if @h > $histsize
1353 0 0 unless open $fh, ">$histfile"
1362 0 0 unless ($what)
1390 0 0 if ($foul) { }
0 0 elsif (-e $_) { }
1392 0 0 if ($foul) { }
1396 0 0 if ($d->{'build_dir'} and $d->{'build_dir'} eq $dbd)
1417 0 0 unless ($for)
1422 0 0 unless %{$self->{'is_tested'};}
1424 0 0 unless defined $env
1426 0 0 if defined $env and length $env
1431 0 0 unless @dirs
1433 0 0 if (@dirs < 12) { }
0 0 elsif (@dirs < 24) { }