blib/lib/App/RecordStream/Aggregator/MapReduce/FieldSet.pm

filter: Statementstmt 96.7% 30 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 4 totaltotal 86.3% 38 / 44 CC 1 SCAR 1.1
CC
1
Cov
97%
map_fields
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/App/RecordStream/Aggregator/Last.pm ↑ Summary blib/lib/App/RecordStream/Aggregator/Sum.pm »
1 package App::RecordStream::Aggregator::MapReduce::FieldSet;
2  
3 9 our $VERSION = "4.0.23";
4  
5 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 9 ▶use App::RecordStream::Aggregator::MapReduce;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 ▶use App::RecordStream::DomainLanguage::Valuation::KeySpec;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 9 ▶use base 'App::RecordStream::Aggregator::MapReduce';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub new
14 {
15 5 ▶ my $class = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
16 5 my @fields = @_;
17  
18 5 return new_from_valuation($class, map { App::RecordStream::DomainLanguage::Valuation::KeySpec->new($_) } @fields);
19 }
20  
21 sub new_from_valuation
22 {
23 13 ▶ my $class = shift;
Subroutine new_from_valuation: called CC=1 SCAR=0.0
Pod undocumented
24 13 my @valuations = @_;
25  
26 13 my $this =
27 {
28 'valuations' => \@valuations,
29 };
30 13 bless $this, $class;
31  
32 13 return $this;
33 }
34  
35 sub map
36 {
37 85 ▶ my ($this, $record) = @_;
Subroutine map: called CC=1 SCAR=0.0
Pod undocumented
38  
39 85 return $this->map_fields(map { $_->evaluate_record($record) } @{$this->{'valuations'}});
40 }
41  
42 sub map_fields
43 {
44 0 ▶ die "FieldSet subclass does not implement map_fields\n";
Subroutine map_fields: not called CC=1 SCAR=6.9
Pod undocumented
45 }
46  
47 9 1;
« blib/lib/App/RecordStream/Aggregator/Last.pm ↑ Summary blib/lib/App/RecordStream/Aggregator/Sum.pm »