Branch Coverage

blib/lib/CPAN/Access/AdHoc.pm
Criterion Covered Total %
branch 76 110 69.0


line true false branch
42 1 11 if %arg
85 7 17 unless $rslt->is_success
92 1 16 unless my $archive = 'CPAN::Access::AdHoc::Archive'->__handle_http_response($rslt)
104 0 2 if exists $$cache{'author_index'}
108 0 2 unless _got_archive($author_details)
112 1 1 unless my $fh = 'IO::File'->new(\$author_details, '<')
142 2 7 unless $distribution =~ m[ / ]msx
144 0 9 unless $distribution =~ m[ \A ( .* / ) ( [^/]* ) \z ]msx
148 0 9 if $file eq 'CHECKSUMS'
155 5 4 unless ($$cache{'checksums'}{$dir})
157 0 4 unless _got_archive($archive)
163 2 6 if $file eq ''
177 0 1 wantarray ? :
1 4 if exists $$cache{'module_index'}
184 2 1 if (my $packages_details = $self->fetch('modules/02packages.details.txt.gz')) { }
188 1 1 unless my $fh = 'IO::File'->new(\$packages_details, '<')
199 0 3 unless defined $ver
212 1 1 wantarray ? :
221 0 0 wantarray ? :
0 2 if exists $$cache{'registered_module_index'}
232 1 1 unless my $fh = 'IO::File'->new(\$packages_details, '<')
245 1 0 wantarray ? :
260 0 1 if $$cache{'indexed_distributions'}
280 20 20 if $class->can($name)
291 0 20 if $class->can($name)
301 66 107 if (@arg) { }
303 41 25 if not defined $value and 'config' ne $name
307 40 26 if not defined $value and $code = $self->can("__attr__${name}__default")
310 66 0 if $code = $self->can("__attr__${name}__validate")
313 63 0 if $code = $self->can("__attr__${name}__post_assignment")
337 0 12 if defined $config_path and -f $config_path
349 13 0 if (ref $value) { }
350 1 12 unless eval { do { $value->isa('Config::Tiny') } }
354 0 0 unless -f $value
388 0 15 unless 'CODE' eq ref $value
409 0 13 unless my $url = 'URI'->new($value)
414 1 12 unless $value->can('authority') and LWP::Protocol::implementor($scheme)
432 0 17 unless defined(my $path = $rslt->header('Content-Location'))
434 9 8 unless $path =~ m[ \A authors/id/ ( [^/] ) / ( \1 [^/] ) / \2 ]msx
436 4 4 if $path =~ m[ /CHECKSUMS \z ]msx
439 0 4 unless $cks_path =~ s[ \A authors/id/ ][]msx
441 4 0 unless my $cksum = $self->fetch_distribution_checksums($cks_path)
443 0 0 unless $$cksum{'sha256'}
446 0 0 unless $got eq $$cksum{'sha256'}
469 13 0 unless ref $value
472 0 13 unless 'ARRAY' eq ref $value
477 1 30 unless defined(my $class = $defaulter{$source})
494 0 5 if $@
503 6 0 if blessed $rtn and $rtn->isa('CPAN::Access::AdHoc::Archive')
525 0 9 unless my(@url_list) = $class->get_default
529 5 7 unless / \A file: /msx
535 2 7 unless defined $url
538 0 9 if $debug
560 2 12 unless / \S /msx
561 4 8 if (s/ \A \s+ //msx) { }