Collection/SelectItems.pm

filter: Statementstmt 60.0% 9 / 15 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 100% 2 / 2 totaltotal 50.0% 12 / 24 CC 3 SCAR 16.1
CC
3
Cov
47%
has_matching_item
6.0
select_first
6.0
BEGIN
1.0
CRAP 5.0
« Collection/FindItem/Iterator.pm ↑ Summary Collection/FindItem.pm »
1 package Role::TinyCommons::Collection::SelectItems;
2  
3 1 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
6 1 our $DATE = '2024-01-16'; # DATE
7 1 our $DIST = 'Role-TinyCommons-Collection'; # DIST
8 1 our $VERSION = '0.010'; # VERSION
9  
10 ### required methods
11  
12 1 requires 'select_items';
13  
14 ### provided methods
15  
16 0 ▶sub has_matching_item {
Subroutine has_matching_item: not called CC=2 SCAR=17.9
Pod documented
17 0 my ($self, %args) = @_;
18 0 my @results = $self->select_items(result_limit => 1, %args);
19 0 ▶ @results ? 1:0;
Branch: 1 branch
BranchTrueFalseTotal
@results ? : 0 0 0
20 }
21  
22 0 ▶sub select_first {
Subroutine select_first: not called CC=2 SCAR=17.9
Pod documented
23 0 my ($self, %args) = @_;
24 0 my @results = $self->select_items(result_limit => 1, %args);
25 0 ▶ @results ? $results[0] : undef;
Branch: 1 branch
BranchTrueFalseTotal
@results ? : 0 0 0
26 }
27  
28 1 1;
29 # ABSTRACT: The search_items() interface
30  
31 __END__
« Collection/FindItem/Iterator.pm ↑ Summary Collection/FindItem.pm »