Branch Coverage

blib/lib/CPAN/Mini.pm
Criterion Covered Total %
branch 54 174 31.0


line true false branch
166 0 0 unless ref $self
168 0 0 unless ($$self{'offline'})
175 0 0 unless -w $local
181 0 0 unless $$self{'force'} or $$self{'changes_made'}
194 0 0 unless $$self{'skip_cleanup'}
204 0 0 unless my(@keys) = keys %{$$self{'recent'};}
207 0 0 unless open my $recent_fh, '>', $recent
210 0 0 unless print {$recent_fh;} "$file\n"
213 0 0 unless close $recent_fh
228 0 0 unless my $gz = &Compress::Zlib::gzopen($details, 'rb')
234 0 0 if ($inheader)
235 0 0 if (/\S/) { }
238 0 0 if ($header eq 'File' and $value eq '02packages.details.txt' || $value eq '02packages.details.txt.gz')
250 0 0 unless $file_ok
254 0 0 if $self->_filter_module({'module', $module, 'version', $version, 'path', $path})
287 0 9 unless defined $$self{'dirmode'}
291 0 9 unless $$self{'local'}
293 0 9 if substr($$self{'local'}, 0, 1) eq '~'
296 0 9 if -e $$self{'local'} and not -d $$self{'local'}
300 0 9 unless (-e $$self{'local'})
310 0 9 unless -w $$self{'local'}
312 0 9 unless $$self{'remote'}
314 9 0 if substr($$self{'remote'}, -1) ne '/'
317 0 9 unless defined $version
319 0 9 $$self{'no_conn_cache'} ? :
0 9 $$self{'timeout'} ? :
326 0 9 unless ($$self{'offline'})
333 0 0 unless eval { do { $self->__lwp->head($test_uri)->is_success } }
395 0 0 unless defined $dir_mode
396 0 0 unless defined $trace
402 0 0 unless -d $needed
444 0 0 eval { do { $path->isa('URI') } } ? :
449 0 0 $$arg{'to_scratch'} ? :
456 0 0 if ($skip_if_present and -f $local_file) { }
0 0 elsif (($$self{'mirrored'}{$local_file} || 0) < 2) { }
474 0 0 if ($res->is_success) { }
0 0 elsif ($res->code != 304) { }
475 0 0 if $$arg{'update_times'}
489 0 0 if ($path =~ m[^authors/id])
493 0 0 if ($path ne $checksum_path)
519 6 39 unless $filter
521 11 28 if (ref $filter eq 'ARRAY')
523 7 18 if $self->__do_filter($_, $file)
528 6 22 if (ref $filter eq 'CODE') { }
539 6 13 if ($$self{'skip_perl'})
540 3 3 if $$args{'path'} =~ m[/(?:emb|syb|bio)?perl-\d]i
541 2 1 if $$args{'path'} =~ m[/(?:parrot|ponie)-\d]i
542 0 1 if $$args{'path'} =~ m[/(?:kurila)-\d]i
543 0 1 if $$args{'path'} =~ m[/\bperl-?5\.004]i
544 0 1 if $$args{'path'} =~ m[/\bperl_mlb\.zip]i
547 8 6 if $self->__do_filter($$self{'path_filters'}, $$args{'path'})
548 0 6 if $self->__do_filter($$self{'module_filters'}, $$args{'module'})
566 0 0 if $$self{'exact_mirror'}
569 0 0 if $file eq 'File::Spec'->catfile($$self{'local'}, 'RECENT')
571 0 0 substr(File::Basename::basename($file), 0, 1) eq '.' ? :
606 0 0 if ($$self{'ignore_source_control'} and exists $Source_control_files{$basename})
614 0 0 unless -f $file and not $$self{'mirrored'}{$file}
615 0 0 if $self->file_allowed($file)
634 0 0 unless (unlink $file)
660 7 0 if ref $_[0]
668 0 0 $$arg{'no_nl'} ? :
672 0 0 if $_[0]->log_level eq 'fatal'
677 0 0 unless $_[0]->log_level =~ /\A(?:info|debug)\z/
688 0 0 unless $_[0]->log_level eq 'debug'
708 0 18 unless defined $homedir
731 7 2 unless defined $config_file
735 0 2 if ($$options{'log_level'} || 'info') =~ /\A(?:warn|fatal)\z/
738 0 2 if substr($config_file, 0, 1) eq '~'
741 0 2 unless -e $config_file
743 0 2 unless open my $config_fh, '<', $config_file
754 0 2 if /\A\s*\Z/ms
756 2 0 if (/\A(\w+):\s*(\S.*?)\s*\Z/ms)
759 0 2 if ($is_multivalue{$key}) { }
776 6 0 unless @{$config{$_};}
800 1 15 if (defined eval { do { $$options{'config_file'} } }) { }
3 12 elsif (defined $ENV{'CPAN_MINI_CONFIG'}) { }
10 2 elsif (defined $class->__homedir_configfile) { }
1 1 elsif (defined $class->__default_configfile) { }
814 8 8 defined $config_file && -e $config_file ? :
838 0 0 unless $class->can($method)
843 0 0 if not $quiet and $orig_remote
863 0 0 unless eval { do { require CPAN; 1 } }
867 0 0 unless exists $$CPAN::Config{'urllist'}
870 0 0 unless ref $$CPAN::Config{'urllist'} eq 'ARRAY' and $$CPAN::Config{'urllist'}[0]
890 0 0 unless eval { do { require CPANPLUS::Backend } }
895 0 0 unless $hosts
898 0 0 unless ref $hosts eq 'ARRAY' and $$hosts[0]