Condition Coverage

lib/Net/API/CPAN.pm
Criterion Covered Total %
condition 3 495 0.6


and 2 conditions

line l !l condition
1957 0 0 $self->_is_array($opts->{'versions'}) and scalar @{$opts->{'versions'};}

and 3 conditions

line !l l&&!r l&&r condition
86 0 2 0 exists $self->{'ua'} and $self->_is_a($self->{'ua'}, "HTTP::Promise")
104 0 0 0 exists $opts->{'author'} and length($opts->{'author'} // "")
116 0 0 0 exists $opts->{'distribution'} and length($opts->{'distribution'} // "")
0 0 0 exists $opts->{'module'} and length($opts->{'module'} // "")
166 0 0 0 scalar @_ == 1 and $self->_is_array($_[0])
0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
0 0 0 scalar @_ == 1 and !ref($_[0]) || ref $_[0] && overload::Method($_[0], '""')
279 0 0 0 defined $ref and ref $ref eq "HASH"
0 0 0 defined $ref and ref $ref eq "HASH" and exists $ref->{'hits'}
0 0 0 defined $ref and ref $ref eq "HASH" and exists $ref->{'hits'} and ref $ref->{'hits'} eq "HASH"
0 0 0 defined $ref and ref $ref eq "HASH" and exists $ref->{'hits'} and ref $ref->{'hits'} eq "HASH" and exists $ref->{'hits'}{'hits'}
0 0 0 defined $ref and ref $ref eq "HASH" and exists $ref->{'hits'} and ref $ref->{'hits'} eq "HASH" and exists $ref->{'hits'}{'hits'} and ref $ref->{'hits'}{'hits'} eq "ARRAY"
291 0 0 0 ref $this eq "HASH" and exists $this->{'fields'}
0 0 0 ref $this eq "HASH" and exists $this->{'fields'} and ref $this->{'fields'} eq "HASH"
319 0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'release'} and defined $opts->{'release'}
329 0 0 0 $self->_is_array($opts->{'author'}) and $self->_is_array($opts->{'release'})
418 0 0 0 exists $self->{'_cached_clientinfo'} and defined $self->{'_cached_clientinfo'}
453 0 0 0 defined $info->{$stage}{$prop} and length $info->{$stage}{$prop}
0 0 0 defined $info->{$stage}{$prop} and length $info->{$stage}{$prop} and lc substr($info->{$stage}{$prop}, 0, 4) eq "http"
469 0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
531 0 0 0 exists $opts->{'file1'} and exists $opts->{'file2'}
0 0 0 exists $opts->{'author1'} and exists $opts->{'release1'}
0 0 0 exists $opts->{'author1'} and exists $opts->{'release1'} and exists $opts->{'release2'}
599 0 0 0 scalar @_ == 1 and !ref($_[0]) || ref $_[0] && overload::Method($_[0], '""')
0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
676 0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
719 0 0 0 ref $ref eq "HASH" and exists $ref->{'favorites'}
0 0 0 ref $ref eq "HASH" and exists $ref->{'favorites'} and ref $ref->{'favorites'} eq "HASH"
740 0 0 0 ref $ref eq "HASH" and exists $ref->{'users'}
0 0 0 ref $ref eq "HASH" and exists $ref->{'users'} and ref $ref->{'users'} eq "ARRAY"
767 0 0 0 ref $ref eq "HASH" and exists $ref->{'leaderboard'}
0 0 0 ref $ref eq "HASH" and exists $ref->{'leaderboard'} and ref $ref->{'leaderboard'} eq "ARRAY"
859 0 0 0 exists $opts->{'method'} and lc $opts->{'method'} ne "post"
0 0 0 exists $opts->{'method'} and lc $opts->{'method'} ne "post" and lc $opts->{'method'} ne "put"
902 0 0 0 ref $query and overload::Method($query, "\"\"")
943 0 0 0 defined $payload and defined $headers
0 0 0 defined $payload and defined $headers and not scalar grep(/^Content[_-]Type$/i, @$headers)
1056 0 0 0 exists $opts->{'list_preprocess'} && ref $opts->{'list_preprocess'} eq 'CODE'
0 0 0 exists $opts->{'list_postprocess'} && ref $opts->{'list_postprocess'} eq 'CODE'
0 0 0 exists $opts->{'args'} && ref $opts->{'args'} eq 'HASH'
1097 0 0 0 exists $data->{'error'} and defined $data->{'error'}
1100 0 0 0 ref $data->{'error'} eq "HASH" and exists $data->{'error'}{'message'}
1137 0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
1156 0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'} and exists $opts->{'dir'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'} and exists $opts->{'path'}
1187 0 0 0 ref $ref eq "HASH" and exists $ref->{'dir'}
0 0 0 ref $ref eq "HASH" and exists $ref->{'dir'} and ref $ref->{'dir'} eq "ARRAY"
1194 0 0 0 defined $this and ref $this eq "HASH"
1283 0 0 0 $type eq "module" and exists $opts->{'module'}
0 0 0 $type eq "file" and exists $opts->{'distribution'}
0 0 0 $type eq "documentation" and exists $opts->{'module'}
1333 0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
1352 0 0 0 exists $opts->{'module'} and length($opts->{'module'} // "")
1388 0 0 0 exists $ref->{$t} and ref $ref->{$t} eq "HASH"
0 0 0 exists $ref->{$t} and ref $ref->{$t} eq "HASH" and exists $ref->{$t}{'_source'}
0 0 0 exists $ref->{$t} and ref $ref->{$t} eq "HASH" and exists $ref->{$t}{'_source'} and ref $ref->{$t}{'_source'} eq "HASH"
1437 0 0 0 ref $ref eq "HASH" and exists $ref->{'hits'}
0 0 0 ref $ref eq "HASH" and exists $ref->{'hits'} and ref $ref->{'hits'} eq "HASH"
0 0 0 ref $ref eq "HASH" and exists $ref->{'hits'} and ref $ref->{'hits'} eq "HASH" and exists $ref->{'hits'}{'hits'}
0 0 0 ref $ref eq "HASH" and exists $ref->{'hits'} and ref $ref->{'hits'} eq "HASH" and exists $ref->{'hits'}{'hits'} and ref $ref->{'hits'}{'hits'} eq "ARRAY"
1446 0 0 0 defined $this and ref $this eq "HASH"
0 0 0 defined $this and ref $this eq "HASH" and exists $this->{'_source'}
0 0 0 defined $this and ref $this eq "HASH" and exists $this->{'_source'} and ref $this->{'_source'} eq "HASH"
0 0 0 defined $this and ref $this eq "HASH" and exists $this->{'_source'} and ref $this->{'_source'} eq "HASH" and exists $this->{'_source'}{'version'}
0 0 0 defined $this and ref $this eq "HASH" and exists $this->{'_source'} and ref $this->{'_source'} eq "HASH" and exists $this->{'_source'}{'version'} and defined $this->{'_source'}{'version'}
0 0 0 defined $this and ref $this eq "HASH" and exists $this->{'_source'} and ref $this->{'_source'} eq "HASH" and exists $this->{'_source'}{'version'} and defined $this->{'_source'}{'version'} and $this->{'_source'}{'version'} eq "undef"
1461 0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
0 0 0 scalar @_ == 1 and !ref($_[0]) || ref $_[0] && overload::Method($_[0], '""')
1511 0 0 0 ref $ref eq "HASH" and not exists $ref->{'modules'}
1545 0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
1637 0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'} and exists $opts->{'path'}
1711 0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
1787 0 0 0 scalar @_ == 1 and $self->_is_a($_[0], "Net::API::CPAN::Filter")
1807 0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'} and exists $opts->{'contributors'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'} and exists $opts->{'files'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'} and exists $opts->{'modules'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'} and exists $opts->{'interesting_files'} || exists $opts->{'interesting'}
0 0 0 exists $opts->{'author'} and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and exists $opts->{'latest'}
0 0 0 exists $opts->{'distribution'} and exists $opts->{'latest'}
0 0 0 exists $opts->{'distribution'} and exists $opts->{'versions'}
1903 0 0 0 exists $ref->{'release'} and defined $ref->{'release'}
0 0 0 exists $ref->{'release'} and defined $ref->{'release'} and ref $ref->{'release'} eq "HASH"
1935 0 0 0 exists $ref->{'release'} and defined $ref->{'release'}
0 0 0 exists $ref->{'release'} and defined $ref->{'release'} and ref $ref->{'release'} eq "HASH"
1951 0 0 0 exists $opts->{'plain'} and not $self->_is_empty($opts->{'plain'})
1957 0 0 0 defined $opts->{'versions'} and length "$opts->{'versions'}"
1997 0 0 0 defined $ref and ref $ref eq "HASH"
0 0 0 defined $ref and ref $ref eq "HASH" and exists $ref->{'releases'}
0 0 0 defined $ref and ref $ref eq "HASH" and exists $ref->{'releases'} and defined $ref->{'releases'}
0 0 0 defined $ref and ref $ref eq "HASH" and exists $ref->{'releases'} and defined $ref->{'releases'} and ref $ref->{'releases'} eq "ARRAY"
2058 0 0 0 exists $opts->{'distribution'} and length($opts->{'distribution'} // "")
0 0 0 exists $opts->{'module'} and length($opts->{'module'} // "")
2123 0 0 0 exists $opts->{'author'} and length($opts->{'author'} // "")
0 0 0 exists $opts->{'author'} and length($opts->{'author'} // "") and exists $opts->{'release'}
0 0 0 exists $opts->{'author'} and length($opts->{'author'} // "") and exists $opts->{'release'} and length($opts->{'release'} // "")
0 0 0 exists $opts->{'author'} and length($opts->{'author'} // "") and exists $opts->{'release'} and length($opts->{'release'} // "") and exists $opts->{'path'}
0 0 0 exists $opts->{'author'} and length($opts->{'author'} // "") and exists $opts->{'release'} and length($opts->{'release'} // "") and exists $opts->{'path'} and length($opts->{'path'} // "")
0 0 0 exists $opts->{'module'} and length($opts->{'module'} // "")
2173 0 0 0 exists $opts->{'range'} and not $self->_is_empty($opts->{'range'})
0 0 0 exists $opts->{'range'} and not $self->_is_empty($opts->{'range'}) and $opts->{'range'} =~ /^\w+$/
2179 0 0 0 exists $opts->{'size'} and not $self->_is_empty($opts->{'size'})
0 0 0 exists $opts->{'size'} and not $self->_is_empty($opts->{'size'}) and $opts->{'size'} =~ /^\d+$/
2194 0 0 0 exists $ref->{'counts'} and defined $ref->{'counts'}
0 0 0 exists $ref->{'counts'} and defined $ref->{'counts'} and ref $ref->{'counts'} eq "HASH"
2252 0 0 0 exists $opts->{'fields'} and length($opts->{'fields'} // "")
2258 0 0 0 ref $fields and $self->_is_scalar($fields)
0 0 0 ref $fields and $self->_is_scalar($fields) and $self->_can_overload($fields, "\"\"")
2262 0 0 0 ref $_ and $self->_is_scalar($_)
0 0 0 ref $_ and $self->_is_scalar($_) and $self->_can_overload($_, "\"\"")

or 2 conditions

line l !l condition
88 2 0 'HTTP::Promise'->new(%$UA_OPTS, 'debug', $self->debug) || (return $self->pass_error('HTTP::Promise'->error))
104 0 0 $opts->{'author'} // ""
116 0 0 $opts->{'distribution'} // ""
0 0 $opts->{'module'} // ""
180 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
277 0 0 shift @_ || die("No autcomplete data was provided to preprocess.\n")
612 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
657 0 0 shift @_ || (return $self->error('No module provided to retrieve its download URL.'))
680 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
806 0 0 shift @_ || (return $self->error('No object type was provided.'))
810 0 0 $opts->{'class'} || $self->_object_type_to_class($type) || (return $self->pass_error)
820 0 0 $req->uri || (return $self->error('No URI set in request object provided.'))
821 0 0 $req->method || (return $self->error('No HTTP method set in request object provided.'))
826 0 0 $opts->{'endpoint'} || (return $self->error('No endpoint was provided.'))
827 0 0 $opts->{'method'} // "get"
831 0 0 $self->ua || (return $self->error('The User Agent object is gone!'))
875 0 0 $cache_file->load('binmode', ':raw') || (return $self->pass_error($cache_file->error))
877 0 0 'HTTP::Promise::Response'->new(200, 'OK', ['Connection', 'close', 'Server', 'local_cache', 'Content_Type', 'application/json; charset=utf-8', 'Cache_Control', 'private', 'Accept_Ranges', 'bytes', 'Date', 'HTTP::Promise'->httpize_datetime($cache_file->last_modified->clone), 'X_Cache', 'MISS, MISS', 'X_Cache_Hits', '0, 0'], $data) || (return $self->pass_error('HTTP::Promise::Response'->error))
930 0 0 $ua->request($req) || (return $self->pass_error($ua->error))
935 0 0 $ua->get($uri, defined $headers ? @$headers : (), defined $query ? ('Query', $query) : ()) || (return $self->pass_error($ua->error))
949 0 0 $ua->post($uri, defined $headers ? @$headers : (), defined $payload ? ('Content', $payload) : ()) || (return $self->pass_error($ua->error))
1016 0 0 length $data // 0
1023 0 0 $result // "undef"
1141 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
1277 0 0 $opts->{'type'} || (return $self->error('No history type was provided.'))
1278 0 0 $opts->{'path'} || (return $self->error('No path was provided.'))
1337 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
1352 0 0 $opts->{'module'} // ""
1374 0 0 $opts->{'join'} // ""
1420 0 0 'Net::API::CPAN::Filter'->new(%$opts, 'debug', $self->debug) || (return $self->pass_error('Net::API::CPAN::Filter'->error))
1465 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
1549 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
1715 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
1791 0 0 $filter->as_json('encoding', 'utf8') || (return $self->pass_error($filter->error))
1962 0 0 $query //= {}
1967 0 0 $query //= {}
2058 0 0 $opts->{'distribution'} // ""
0 0 $opts->{'module'} // ""
2099 0 0 delete $opts->{'type'} || (return $self->error('No API endpoint search type was provided.'))
2104 0 0 $self->new_filter($opts) || (return $self->pass_error)
2123 0 0 $opts->{'author'} // ""
0 0 $opts->{'release'} // ""
0 0 $opts->{'path'} // ""
0 0 $opts->{'module'} // ""
2183 0 0 $query //= {}
2231 1 0 shift @_ || (return $self->error('No object type was provided to derive its module name'))
2252 0 0 $opts->{'fields'} // ""

or 3 conditions

line l !l&&r !l&&!r condition
166 0 0 0 !ref($_[0]) || ref $_[0] && overload::Method($_[0], '""')
557 0 0 0 $opts->{'author2'} //= $opts->{'author1'}
599 0 0 0 !ref($_[0]) || ref $_[0] && overload::Method($_[0], '""')
695 0 0 0 exists $opts->{'aggregate'} or exists $opts->{'agg'}
711 0 0 0 $opts->{'aggregate'} // $opts->{'agg'}
902 0 0 0 ref $query eq "HASH" or $self->_is_array($query)
0 0 0 not ref $query or ref $query and overload::Method($query, "\"\"")
969 0 0 0 $resp->is_success or $resp->is_redirect
1385 0 0 0 not defined $ref or ref $ref ne "HASH"
1461 0 0 0 !ref($_[0]) || ref $_[0] && overload::Method($_[0], '""')
1511 0 0 0 ref $ref ne "HASH" or ref $ref eq "HASH" and not exists $ref->{'modules'}
1807 0 0 0 exists $opts->{'interesting_files'} || exists $opts->{'interesting'}
1957 0 0 0 $self->_is_array($opts->{'versions'}) and scalar @{$opts->{'versions'};} or defined $opts->{'versions'} and length "$opts->{'versions'}"
2258 0 0 0 not ref $fields or ref $fields and $self->_is_scalar($fields) and $self->_can_overload($fields, "\"\"")
2262 0 0 0 not ref $_ or ref $_ and $self->_is_scalar($_) and $self->_can_overload($_, "\"\"")