blib/lib/App/RecordStream/Clumper/Key.pm

filter: Statementstmt 100% 48 / 48 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 12 / 12 Podpod 0.0% 0 / 7 totaltotal 89.8% 62 / 69 CC 2 SCAR 1.4
CC
2
Cov
100%
evaluate_record
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/App/RecordStream/Aggregator/Records.pm ↑ Summary blib/lib/App/RecordStream/Aggregator/UniqArray.pm »
1 package App::RecordStream::Clumper::Key;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use App::RecordStream::Clumper::Key::WrappedCallback;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use App::RecordStream::Clumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use base 'App::RecordStream::Clumper';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub new
12 7 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
13 7 my $class = shift;
14 7 my $field = shift;
15  
16 7 return new_from_valuation($class, $field, App::RecordStream::DomainLanguage::Valuation::KeySpec->new($field));
17 }
18  
19 sub new_from_valuation
20 20 ▶{
Subroutine new_from_valuation: called CC=1 SCAR=0.0
Pod undocumented
21 20 my $class = shift;
22 20 my $name = shift;
23 20 my $valuation = shift;
24  
25 20 my $this =
26 {
27 'name' => $name,
28 'valuation' => $valuation,
29 };
30 20 bless $this, $class;
31  
32 20 return $this;
33 }
34  
35 sub evaluate_record
36 161 ▶{
Subroutine evaluate_record: called CC=2 SCAR=6.9
Pod undocumented
37 161 my $this = shift;
38 161 my $record = shift;
39  
40 161 my $v = $this->{'valuation'}->evaluate_record($record);
41 161 ▶ if(!defined($v))
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $v) 2 159 161
42 {
43 2 $v = "";
44 }
45  
46 161 return $v;
47 }
48  
49 sub clumper_begin
50 31 ▶{
Subroutine clumper_begin: called CC=1 SCAR=0.0
Pod undocumented
51 31 my $this = shift;
52 31 my $bucket = shift;
53  
54 31 return [$bucket, $this->key_clumper_begin()];
55 }
56  
57 sub clumper_push_record
58 161 ▶{
Subroutine clumper_push_record: called CC=1 SCAR=0.0
Pod undocumented
59 161 my $this = shift;
60 161 my $cookie = shift;
61 161 my $record = shift;
62 161 my $next = shift;
63  
64 161 my $name = $this->{'name'};
65 161 my $value = $this->evaluate_record($record);
66  
67 161 my $wrapped_next = App::RecordStream::Clumper::Key::WrappedCallback->new($next, $cookie->[0], $name, $value);
68  
69 161 $this->key_clumper_push_record($cookie->[1], $value, $record, $wrapped_next);
70 }
71  
72 sub clumper_end
73 31 ▶{
Subroutine clumper_end: called CC=1 SCAR=0.0
Pod undocumented
74 31 my $this = shift;
75 31 my $cookie = shift;
76 31 my $next = shift;
77  
78 31 my $wrapped_next = App::RecordStream::Clumper::Key::WrappedCallback->new($next, undef);
79  
80 31 $this->key_clumper_end($cookie->[1], $wrapped_next);
81 }
82  
83  
84 sub argct
85 2 ▶{
Subroutine argct: called CC=1 SCAR=0.0
Pod undocumented
86 2 return 1;
87 }
88  
89 6 1;
« blib/lib/App/RecordStream/Aggregator/Records.pm ↑ Summary blib/lib/App/RecordStream/Aggregator/UniqArray.pm »