Branch Coverage

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


line true false branch
132 0 2 unless is_hashref($args)
143 0 1 unless is_hashref($args)
180 0 0 if $size eq "today"
190 0 0 if $size =~ /^[0-9]+$/
207 0 0 if $params and not is_hashref($params)
210 0 0 if ($params->{'fields'} and not is_arrayref($params->{'fields'}))
225 3 1 if (defined $version_or_range)
230 2 13 if (index($version_or_range, $range) != -1)
236 1 2 unless $is_using_range
241 1 3 if (defined $dev)
245 3 1 if scalar @extra
260 0 0 unless (eval { do { $res = $self->fetch('/search/autocomplete?q=' . uri_escape_utf8($q)); 1 } })
280 0 0 unless (eval { do { $res = $self->fetch('/search/autocomplete/suggest?q=' . uri_escape_utf8($q)); 1 } })
293 3 40 unless scalar @_ == 2 or scalar @_ == 3 and !defined($_[2]) || is_hashref($_[2])
306 1 45 unless is_hashref($response)
309 4 41 if $type eq "download_url"
312 1 0 if ($type eq "cve" and is_hashref($response) and is_arrayref($response->{'cve'}))
323 46 0 unless $params
326 0 0 unless $fields
328 0 0 if (is_arrayref($fields)) { }
0 0 elsif (not ref $fields) { }
329 0 0 if grep {ref $_;} @$fields
348 1 13 unless is_hashref($args)
351 1 12 unless not defined $params or is_hashref($params)
356 1 11 unless grep {$_ eq $type;} @supported_searches
373 8 42 if is_hashref($arg)
376 41 1 if defined $arg and not is_ref($arg)
405 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 } })
434 0 0 unless (eval { do { $res = $self->fetch("/release/_search", {"from", 0, "query", {"match_all", {}}, @args, "sort", [{"date", {"order", "desc"}}]}); 1 } })