Branch Coverage

blib/lib/CPAN/Access/AdHoc.pm
Criterion Covered Total %
branch 76 108 70.3


line true false branch
42 1 11 if %arg
82 6 17 unless $rslt->is_success
89 1 16 unless my $archive = 'CPAN::Access::AdHoc::Archive'->__handle_http_response($rslt)
101 0 2 if exists $$cache{'author_index'}
105 0 2 unless _got_archive($author_details)
109 1 1 unless my $fh = 'IO::File'->new(\$author_details, '<')
137 1 7 unless $distribution =~ m[ \A ( .* / ) ( [^/]* ) \z ]msx
141 0 7 if $file eq 'CHECKSUMS'
148 4 3 unless ($$cache{'checksums'}{$dir})
150 0 4 unless _got_archive($archive)
156 1 6 if $file eq ''
170 0 1 wantarray ? :
1 4 if exists $$cache{'module_index'}
177 2 1 if (my $packages_details = $self->fetch('modules/02packages.details.txt.gz')) { }
181 1 1 unless my $fh = 'IO::File'->new(\$packages_details, '<')
192 0 3 unless defined $ver
205 1 1 wantarray ? :
214 0 0 wantarray ? :
0 2 if exists $$cache{'registered_module_index'}
225 1 1 unless my $fh = 'IO::File'->new(\$packages_details, '<')
238 1 0 wantarray ? :
253 1 1 if $$cache{'indexed_distributions'}
273 20 20 if $class->can($name)
284 0 20 if $class->can($name)
294 66 104 if (@arg) { }
296 41 25 if not defined $value and 'config' ne $name
300 40 26 if not defined $value and $code = $self->can("__attr__${name}__default")
303 66 0 if $code = $self->can("__attr__${name}__validate")
306 63 0 if $code = $self->can("__attr__${name}__post_assignment")
330 0 12 if defined $config_path and -f $config_path
342 13 0 if (ref $value) { }
343 1 12 unless eval { do { $value->isa('Config::Tiny') } }
347 0 0 unless -f $value
381 0 15 unless 'CODE' eq ref $value
402 0 13 unless my $url = 'URI'->new($value)
407 1 12 unless $value->can('authority') and LWP::Protocol::implementor($scheme)
425 0 17 unless defined(my $path = $rslt->header('Content-Location'))
427 9 8 unless $path =~ m[ \A authors/id/ ( [^/] ) / ( \1 [^/] ) / \2 ]msx
429 4 4 if $path =~ m[ /CHECKSUMS \z ]msx
432 0 4 unless $cks_path =~ s[ \A authors/id/ ][]msx
434 4 0 unless my $cksum = $self->fetch_distribution_checksums($cks_path)
436 0 0 unless $$cksum{'sha256'}
439 0 0 unless $got eq $$cksum{'sha256'}
462 13 0 unless ref $value
465 0 13 unless 'ARRAY' eq ref $value
470 1 30 unless defined(my $class = $defaulter{$source})
487 0 5 if $@
496 6 0 if blessed $rtn and $rtn->isa('CPAN::Access::AdHoc::Archive')
518 0 9 unless my(@url_list) = $class->get_default
522 5 7 unless / \A file: /msx
528 2 7 unless defined $url
531 0 9 if $debug
553 2 12 unless / \S /msx
554 4 8 if (s/ \A \s+ //msx) { }