Branch Coverage

blib/lib/MetaCPAN/Client.pm
Criterion Covered Total %
branch 31 58 53.4


line true false branch
131 0 2 unless is_hashref($args)
168 0 0 if $size eq "today"
178 0 0 if $size =~ /^[0-9]+$/
194 0 2 unless (eval { do { $res = $self->fetch(sprintf('%s/_count', $index)); 1 } })
213 0 0 if ($params and not is_hashref($params))
217 0 0 if (exists $params->{'fields'} and not is_arrayref($params->{'fields'}))
232 3 1 if (defined $version_or_range)
237 2 13 if (index($version_or_range, $range) != -1)
243 1 2 unless $is_using_range
248 1 3 if (defined $dev)
252 3 1 if scalar @extra
267 0 0 unless (eval { do { $res = $self->fetch('/search/autocomplete?q=' . uri_escape_utf8($q)); 1 } })
287 0 0 unless (eval { do { $res = $self->fetch('/search/autocomplete/suggest?q=' . uri_escape_utf8($q)); 1 } })
300 3 40 unless scalar @_ == 2 or scalar @_ == 3 and !defined($_[2]) || is_hashref($_[2])
313 1 45 unless is_hashref($response)
316 4 41 if $index eq "download_url"
319 1 0 if ($index eq "cve" and is_hashref($response) and is_arrayref($response->{'cve'}))
330 46 0 unless $params
333 0 0 unless $fields
335 0 0 if (is_arrayref($fields)) { }
0 0 elsif (not ref $fields) { }
336 0 0 if grep {ref $_;} @$fields
355 1 13 unless is_hashref($args)
358 1 12 unless not defined $params or is_hashref($params)
363 1 11 unless grep {$_ eq $index;} @supported_searches
380 8 42 if is_hashref($arg)
383 41 1 if defined $arg and not is_ref($arg)
412 0 1 unless (eval { do { $res = $self->fetch("/reverse_dependencies/dist/$dist", {"size", 5000, "query", {"bool", {"must", [{"term", {"status", "latest"}}, {"term", {"authorized", &JSON()->true}}]}}}); 1 } })
441 0 0 unless (eval { do { $res = $self->fetch("/release/_search", {"from", 0, "query", {"match_all", {}}, @args, "sort", [{"date", {"order", "desc"}}]}); 1 } })