Condition Coverage

lib/Net/API/CPAN/List.pm
Criterion Covered Total %
condition 51 256 19.9


and 2 conditions

line l !l condition
360 0 1 not $self->type and scalar @$new_items

and 3 conditions

line !l l&&!r l&&r condition
65 0 1 0 exists $self->{'api'} and $self->_is_a($self->{'api'}, "Net::API::CPAN")
124 0 0 1 $total and $total > $size
0 0 1 $total and $total > $size and $total - ($offset + 1) > 0
126 0 0 1 $total and $total > $size
0 0 1 $total and $total > $size and $total - ($offset + 1) > 0
134 7 1 0 @_ == 1 and not defined $_[0]
165 0 0 10 exists $hash->{'_source'} and ref $hash->{'_source'} eq "HASH"
174 0 0 8 $self->{'items'} and $self->_is_a($self->{'items'}, "Module::Generic::Array")
245 1 0 0 $container and $container eq "hits"
1 0 0 $container and $container eq "hits" and exists $data->{$container}
0 0 0 $container and $container eq "hits" and exists $data->{$container} and ref $data->{$container} eq "HASH"
0 0 0 $container and $container eq "hits" and exists $data->{$container} and ref $data->{$container} eq "HASH" and exists $data->{$container}{'hits'}
0 0 0 $container and $container eq "hits" and exists $data->{$container} and ref $data->{$container} eq "HASH" and exists $data->{$container}{'hits'} and ref $data->{$container}{'hits'} eq "ARRAY"
0 0 1 not defined $container and exists $data->{'hits'}
0 0 1 not defined $container and exists $data->{'hits'} and ref $data->{'hits'} eq "HASH"
0 0 1 not defined $container and exists $data->{'hits'} and ref $data->{'hits'} eq "HASH" and exists $data->{'hits'}{'hits'}
0 0 1 not defined $container and exists $data->{'hits'} and ref $data->{'hits'} eq "HASH" and exists $data->{'hits'}{'hits'} and ref $data->{'hits'}{'hits'} eq "ARRAY"
264 0 0 1 exists $data->{'hits'} && defined $data->{'hits'}
0 0 1 exists $data->{'hits'}{'hits'} && defined $data->{'hits'}{'hits'}
284 0 0 1 exists $data->{'hits'}{'total'} and defined $data->{'hits'}{'total'}
0 0 1 exists $data->{'hits'}{'total'} and defined $data->{'hits'}{'total'} and CORE::length $data->{'hits'}{'total'}
308 0 0 0 defined $data->{$prop} and ref $data->{$prop} eq "ARRAY"
343 0 0 0 exists $data->{'total'} and CORE::length($data->{'total'} // "")
360 0 0 1 not $self->type and scalar @$new_items and ref $new_items->[0] eq "HASH"
0 0 1 not $self->type and scalar @$new_items and ref $new_items->[0] eq "HASH" and exists $new_items->[0]{'_type'}
0 0 1 not $self->type and scalar @$new_items and ref $new_items->[0] eq "HASH" and exists $new_items->[0]{'_type'} and CORE::length($new_items->[0]{'_type'} // "")
369 1 0 0 not $new_items->is_empty || $old_items->is_empty and ref $new_items->first eq "HASH"
1 0 0 not $new_items->is_empty || $old_items->is_empty and ref $new_items->first eq "HASH" and ref $old_items->first eq "HASH"
392 0 0 0 defined $new_serial and defined $old_serial
0 0 0 defined $new_serial and defined $old_serial and $new_serial eq $old_serial
425 0 0 1 exists $data->{'timed_out'} and defined $data->{'timed_out'}
0 0 1 exists $data->{'timed_out'} and defined $data->{'timed_out'} and CORE::length $data->{'timed_out'}
436 0 0 1 exists $data->{'took'} and defined $data->{'took'}
0 0 1 exists $data->{'took'} and defined $data->{'took'} and CORE::length $data->{'took'}
481 0 0 0 $self->{'_pos'} > $data->size and $self->has_more
495 0 0 0 defined $size and not $size
506 0 0 0 scalar keys %$query and exists $query->{'page'} || exists $query->{'from'} || exists $query->{'size'}
623 0 0 0 $self->{'_pos'} <= 0 and $page > 1
637 0 0 0 defined $size and not $size
647 0 0 0 scalar keys %$query and CORE::length($query->{'q'} // "")
752 0 0 0 not $data->is_empty and $self->_is_object($data->[0])
759 0 0 0 defined $this_object and $this_object->defined
760 0 0 0 defined $obj_name and $obj_name->defined

or 2 conditions

line l !l condition
68 1 0 'Net::API::CPAN'->new('debug', $self->debug) || (return $self->pass_error('Net::API::CPAN'->error))
97 0 0 $self->{'_pos'} || 0
114 1 0 $self->total // 0
121 0 1 $self->size // 10
122 1 0 $self->offset // 0
149 10 0 $opts->{'type'} || $hash->{'_type'} || $def_type || (return $self->error("No object type was specified nor any could be found in the hash reference at offset $i"))
154 1 0 $self->_object_type_to_class($type) || (return $self->error(qq[Could not find corresponding class for ojbect type "$type".]))
168 10 0 $class->new(%$hash, 'api', $api) || (return $self->pass_error($class->error))
188 0 0 $opts->{'request'} || (return $self->error('No HTTP request was provided to load data.'))
189 0 0 $self->api || (return $self->error('No Net::API::CPAN obejct is currently set. This should not happen.'))
191 0 0 $self->type || (return $self->error('No object type set for this list.'))
197 0 0 $filter->as_json || (return $self->pass_error($filter->error))
210 0 0 $api->fetch($type, {'request', $req, 'class', sub {
219 1 0 CORE::shift @_ || (return $self->error('No data was provided to load.'))
225 0 1 $container // "undef"
335 0 0 ref $data->{$container} // "string"
343 0 0 $data->{'total'} // ""
360 1 0 $new_items->[0]{'_type'} // ""
483 0 0 $self->request || (return $self->error('No initial HTTP request was provided to load data.'))
488 0 0 $self->page // 1
497 0 0 $self->size // 10
515 0 0 $size //= 10
516 0 0 $self->size_prop // "size"
519 0 0 $self->page_type || 'from'
520 0 0 $page // "undef"
0 0 $size // "undef"
0 0 $page_type // "undef"
562 3 0 $self->page // 1
569 3 0 $self->page_size || 10
570 2 1 $self->pos // 0
622 0 0 $self->page // 1
625 0 0 $self->request || (return $self->error('No initial HTTP request was provided to load data.'))
639 0 0 $self->size // 10
647 0 0 $query->{'q'} // ""
652 0 0 $size //= 10
653 0 0 $self->size_prop // "size"
656 0 0 $self->page_type || 'from'
693 0 0 CORE::shift @_ || (return $self->error('Nothing was provided to add to the list of object.'))
738 0 0 CORE::shift @_ || (return $self->error('Nothing was provided to add to the list of object.'))
747 0 0 CORE::shift @_ || (return $self->error('No data was provided to check.'))

or 3 conditions

line l !l&&r !l&&!r condition
102 0 0 0 $what eq "object" or $what eq "hash"
121 0 1 0 $size //= $self->size // 10
245 0 1 0 $container and $container eq "hits" and exists $data->{$container} and ref $data->{$container} eq "HASH" and exists $data->{$container}{'hits'} and ref $data->{$container}{'hits'} eq "ARRAY" or not defined $container and exists $data->{'hits'} and ref $data->{'hits'} eq "HASH" and exists $data->{'hits'}{'hits'} and ref $data->{'hits'}{'hits'} eq "ARRAY"
264 0 0 1 not exists $data->{'hits'} && defined $data->{'hits'} or ref $data->{'hits'} ne "HASH"
0 0 1 not exists $data->{'hits'}{'hits'} && defined $data->{'hits'}{'hits'} or ref $data->{'hits'}{'hits'} ne "ARRAY"
351 1 0 0 $self->{'_raw_items'} // $self->new_array
369 0 1 0 $new_items->is_empty || $old_items->is_empty
412 1 0 0 $total // $self->items->length
506 0 0 0 exists $query->{'page'} || exists $query->{'from'} || exists $query->{'size'}
523 0 0 0 $size // $self->page_size
550 0 0 0 $what eq "object" or $what eq "hash"
569 0 3 0 $size ||= $self->page_size || 10
592 0 0 0 $what eq "object" or $what eq "hash"
681 0 0 0 $what eq "object" or $what eq "hash"
711 0 0 0 $what eq "object" or $what eq "hash"