blib/lib/App/RecordStream/Aggregator/First.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 0.0% 0 / 3 totaltotal 86.8% 33 / 38 CC 2 SCAR 2.9
CC
2
Cov
96%
combine_field
2.0
long_usage
2.0
BEGIN
1.0
CRAP 1.3
« blib/lib/App/RecordStream/Aggregator/LastRecord.pm ↑ Summary blib/lib/App/RecordStream/Test/LastHelper.pm »
1 package App::RecordStream::Aggregator::First;
2  
3 7 our $VERSION = "4.0.23";
4  
5 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 ▶use App::RecordStream::Aggregator::InjectInto::Field;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use App::RecordStream::DomainLanguage::Registry;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 7 ▶use base qw(App::RecordStream::Aggregator::InjectInto::Field);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 #sub new -- passed through
14  
15 #sub new_from_valuation -- passed through
16  
17 sub combine_field
18 {
19 72 ▶ my $this = shift;
Subroutine combine_field: called CC=2 SCAR=6.9
Pod undocumented
20 72 my $cookie = shift;
21 72 my $value = shift;
22  
23 72 ▶ return defined($cookie) ? $cookie : $value;
Branch: 1 branch
BranchTrueFalseTotal
defined $cookie ? : 63 9 72
24 }
25  
26 sub short_usage
27 {
28 1 ▶ return "first value for a field";
Subroutine short_usage: called CC=1 SCAR=0.0
Pod undocumented
29 }
30  
31 sub long_usage
32 {
33 0 ▶ return <<EOF;
Subroutine long_usage: not called CC=1 SCAR=6.9
Pod undocumented
34 Usage: first,<field>
35 First value of specified field.
36 EOF
37 }
38  
39 7 App::RecordStream::Aggregator->register_implementation('first', __PACKAGE__);
40  
41 7 App::RecordStream::DomainLanguage::Registry::register_vfn(__PACKAGE__, 'new_from_valuation', 'first', 'VALUATION');
42  
43 7 1;
« blib/lib/App/RecordStream/Aggregator/LastRecord.pm ↑ Summary blib/lib/App/RecordStream/Test/LastHelper.pm »