Branch Coverage

blib/lib/CPAN/FTP.pm
Criterion Covered Total %
branch 54 404 13.3


line true false branch
26 0 0 if exists &Errno::EAGAIN and $! == &Errno::EAGAIN
27 0 0 if ++$cnt > 100000
38 0 0 if defined $ftpstats_size and $ftpstats_size <= 0
39 0 0 $fh ? :
43 0 0 if $^O eq 'MSWin32'
52 0 0 if ($sleep > 3)
59 0 0 if ($sleep <= 6) { }
67 0 0 if ($@)
68 0 0 if (ref $@) { }
69 0 0 if (ref $@ eq 'CPAN::Exception::yaml_not_installed') { }
0 0 elsif (ref $@ eq 'CPAN::Exception::yaml_process_error') { }
80 0 0 unless rename $file, $to
93 6 0 if ('CPAN'->has_inst('Time::HiRes')) { }
115 0 3 if $CPAN::DEBUG
116 0 3 if ($CPAN::META->has_inst($yaml_module))
123 0 0 if $sdebug
125 0 0 if $fh and defined fileno $fh
127 0 0 if $sdebug
128 0 0 if $sdebug
133 0 0 unless defined $ftpstats_size
136 0 0 unless $fullstats->{'history'}
145 0 0 if $sdebug
146 0 0 if $sdebug
147 0 0 if $sdebug
151 0 0 if ($sdebug)
160 0 0 if $^O eq 'MSWin32' or $^O eq 'os2'
161 0 0 if -e $sfile
162 0 0 unless rename "$sfile.$$", $sfile
174 0 0 unless (@stat)
180 0 0 unless chmod $stat[2], $dest
183 0 0 if $@
186 0 0 unless (chown $stat[4], $stat[5], $dest)
194 0 0 if $@
202 0 3 if ($file =~ s[/CHECKSUMS(.gz)?$][])
206 0 0 if $last->{'end'} - time > 3600
207 0 0 unless $last->{'file'}
208 0 0 unless $file eq dirname($last->{'file'})
212 0 3 if ($CPAN::Config->{'randomize_urllist'} and rand 1 < $CPAN::Config->{'randomize_urllist'}) { }
226 0 3 if $CPAN::DEBUG
229 0 3 unless (ref $CPAN::Config->{'urllist'} eq 'ARRAY')
233 3 0 if defined $_
234 0 3 if $with_defaults
236 0 3 if $CPAN::DEBUG
237 0 3 if (UNIVERSAL::can($u, 'text')) { }
238 0 0 unless substr($u->{'TEXT'}, -1) eq '/'
240 3 0 unless substr($u, -1) eq '/'
250 0 0 if $CPAN::DEBUG
255 0 0 unless ($ftp)
259 0 0 unless defined $ftp
260 0 0 if $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG
262 0 0 unless ($ftp->login('anonymous', $Config::Config{'cf_email'}))
267 0 0 unless ($ftp->cwd($dir))
273 0 0 if $CPAN::DEBUG
274 0 0 unless ($ftp->get($file, $target))
315 0 3 unless defined $aslocal
317 0 3 if ($CPAN::DEBUG)
322 0 3 if ($^O eq 'MacOS')
326 0 0 if (length $name > 31)
346 0 0 if (-f $aslocal and -r _ and not $force & 1)
348 0 0 if ($size = -s $aslocal) { }
349 0 0 if $CPAN::DEBUG
353 0 0 unless unlink $aslocal
359 0 3 if (-f $aslocal)
366 0 3 if ($CPAN::META->has_usable('LWP::UserAgent'))
367 0 0 unless ($CPAN::FTP::Ua)
370 0 0 if ($@) { }
371 0 0 if $CPAN::DEBUG
376 0 0 if $var = $CPAN::Config->{'ftp_proxy'} || $ENV{'ftp_proxy'}
378 0 0 if $var = $CPAN::Config->{'http_proxy'} || $ENV{'http_proxy'}
380 0 0 if $var = $CPAN::Config->{'no_proxy'} || $ENV{'no_proxy'}
385 0 9 if $CPAN::Config->{$prx}
393 3 0 if ($force & 2) { }
398 0 0 unless (substr($ccurllist->[$b], 0, 4) eq 'file') <=> (substr($ccurllist->[$a], 0, 4) eq 'file')
411 0 3 if $CPAN::DEBUG
423 2 1 if ($CPAN::FTP::Themethod) { }
429 0 3 if $^O eq 'MacOS'
433 0 3 exists $CPAN::Config->{'ftp_passive'} ? :
437 0 3 if not defined $CPAN::FTP::connect_to_internet_ok and defined $_
442 0 3 unless $scheme and 'file' eq $scheme
445 0 3 if ($defaultsites) { }
446 0 0 unless (defined $CPAN::FTP::connect_to_internet_ok)
456 0 0 if ($answer =~ /^y/i) { }
462 0 0 if ($CPAN::FTP::connect_to_internet_ok) { }
473 3 0 $level =~ /dleasy/ ? :
477 0 3 if $CPAN::DEBUG
479 0 3 if (my $recommend = $self->_recommend_url_for($file, \@urllist))
483 0 3 if $CPAN::DEBUG
485 3 0 if ($ret) { }
486 0 3 if $CPAN::DEBUG
487 0 3 if ($ret eq $aslocal_tempfile) { }
3 0 elsif (-f $ret and $scheme eq 'file') { }
490 0 0 unless rename $aslocal_tempfile, $aslocal
503 0 3 if $CPAN::DEBUG
507 0 0 if $CPAN::Signal
510 3 0 if ($ret)
513 0 3 if $CPAN::DEBUG
515 0 3 if $CPAN::DEBUG
516 3 0 if ($ret)
520 0 0 unless ($CPAN::Signal)
523 0 0 if (@{$CPAN::Config->{'urllist'};}) { }
536 0 0 if ($maybe_restore)
548 0 0 unless -w $aslocal_dir
559 3 0 if $scheme
580 0 3 if $CPAN::DEBUG
581 3 0 if ($url =~ /^file:/)
583 3 0 if ($CPAN::META->has_inst('URI::URL')) { }
596 0 0 if not -f $l and $l =~ m[^/\w:]
599 0 3 if $CPAN::DEBUG
600 0 3 if (-f $l and -r _)
607 3 0 if ($l =~ /(.+)\.gz$/) { }
0 0 elsif (-f $l and -r _) { }
0 0 elsif (-f "$l.gz") { }
609 3 0 if (-f $ungz and -r _) { }
0 0 elsif (-f $l and -r _) { }
615 0 0 if (-f $aslocal and -s _) { }
0 0 elsif (not -s $aslocal) { }
0 0 elsif (-f $l) { }
623 0 0 if $@
637 0 0 if $CPAN::DEBUG
639 0 0 if (-f $aslocal) { }
644 0 0 if $@
651 0 0 if $CPAN::DEBUG
652 0 0 if ($CPAN::META->has_usable('LWP')) { }
0 0 elsif ($url =~ /^http:/i and $CPAN::META->has_usable('HTTP::Tiny')) { }
654 0 0 unless ($CPAN::FTP::Ua)
657 0 0 if ($@)
662 0 0 if ($res->is_success) { }
0 0 elsif (not $url =~ /\.gz(?!\n)\Z/) { }
673 0 0 if ($res->is_success)
674 0 0 if (eval { do { 'CPAN::Tarzip'->new("$aslocal.gz")->gunzip($aslocal) } })
695 0 0 !($url =~ /\.gz(?!\n)\Z/) ? :
698 0 0 if ($res and $res->{'success'}) { }
0 0 elsif ($res and $res->{'status'} ne '599') { }
0 0 elsif ($res and $res->{'status'} eq '599') { }
730 0 0 if $CPAN::Signal
731 0 0 if ($url =~ m[^ftp://(.*?)/(.*)/(.*)])
733 0 0 if $CPAN::DEBUG
735 0 0 if ($CPAN::META->has_usable('Net::FTP')) { }
738 0 0 if $CPAN::DEBUG
740 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, $getfile, $aslocal))
744 0 0 unless ($aslocal =~ /\.gz(?!\n)\Z/)
747 0 0 if ('CPAN::FTP'->ftp_get($host, $dir, "$getfile.gz", $gz) and eval { do { 'CPAN::Tarzip'->new($gz)->gunzip($aslocal) } })
759 0 0 if $CPAN::DEBUG
762 0 0 if (UNIVERSAL::can($ro_url, 'text') and $ro_url->{'FROM'} eq 'USER')
770 0 0 if $ret
772 0 0 if $CPAN::Signal
799 0 0 if ($url =~ m[^([^:]+)://(.*?)/(.*)/(.*)]) { }
805 0 0 if $proto eq 'file'
811 0 0 if $CPAN::DEBUG
818 0 0 unless defined $funkyftp
819 0 0 if $funkyftp =~ /^\s*$/
824 0 0 if ($f eq 'lynx') { }
0 0 elsif ($f eq 'ncftp') { }
0 0 elsif ($f eq 'wget') { }
0 0 elsif ($f eq 'curl') { }
0 0 elsif ($f eq 'ncftpget') { }
827 0 0 unless $url =~ m[\Aftp://]
834 0 0 if ($proxy_vars->{'http_proxy'})
838 0 0 unless $url =~ m[\Aftp://]
851 0 0 if $CPAN::DEBUG
853 0 0 if ($f eq 'lynx')
855 0 0 if (-s $aslocal) { }
857 0 0 unless open FH, $aslocal
860 0 0 if ($content =~ /^<.*([45]|Error [45])/is) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#876">876</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($wstatus == 0) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#877">877</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-s $aslocal) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#885">885</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> -f $aslocal ? : </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#893">893</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::Signal </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#896">896</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless $any_attempt </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#897">897</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($some_dl_success) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#910">910</a> </td> <td class="c3"> 2 </td> <td class="c0"> 0 </td> <td class="s"> if ($http_proxy) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#915">915</a> </td> <td class="c3"> 2 </td> <td class="c0"> 0 </td> <td class="s"> if ($host) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#917">917</a> </td> <td class="c3"> 1 </td> <td class="c3"> 1 </td> <td class="s"> if ($host =~ /\Q$domain\E$/) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#925">925</a> </td> <td class="c3"> 1 </td> <td class="c3"> 1 </td> <td class="s"> if ($want_proxy) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#942">942</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless @$host_seq </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#947">947</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless ($ftpbin and length $ftpbin and 'MM'->maybe_command($ftpbin)) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#968">968</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::DEBUG </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#969">969</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless ($url =~ m[^ftp://(.*?)/(.*)/(.*)]) </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#979">979</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> $CPAN::DEBUG{'FTP'} & $CPAN::DEBUG ? : </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#992">992</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (not $netrcfile) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif ($netrc->hasdefault or $netrc->contains($host)) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#993">993</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::DEBUG </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#995">995</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::DEBUG </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#998">998</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($netrc->protected) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1001">1001</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($netrc->contains($host)) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1021">1021</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($mtime > $timestamp) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1028">1028</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::Signal </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1059">1059</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($mtime > $timestamp) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1066">1066</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $CPAN::Signal </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1076">1076</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> unless $fh->open("|$command") </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1081">1081</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if $wstatus </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1098">1098</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if ($blocks) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1105">1105</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-f _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-d _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-c _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-b _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-p _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#"></a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> elsif (-S _) { } </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1121">1121</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if -u _ </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1122">1122</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if -g _ </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1123">1123</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if -k _ </td> </tr> <a name=""> </a> <tr> <td class="h"> <a href="blib-lib-CPAN-FTP-pm.html#1132">1132</a> </td> <td class="c0"> 0 </td> <td class="c0"> 0 </td> <td class="s"> if (-M _ > 182.625) { } </td> </tr> </table> </body> </html>