blib/lib/JQ/Lite/Evaluator.pm

filter: Statementstmt 100% 16 / 16 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 2 totaltotal 74.1% 23 / 31 CC 5 SCAR 10.7
CC
5
Cov
83%
evaluate
4.3
new
2.0
BEGIN
1.0
CRAP 2.9
« blib/lib/JQ/Lite/Builtin/Aggregate.pm ↑ Summary blib/lib/JQ/Lite.pm »
1 package JQ::Lite::Evaluator;
2  
3 182 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 182 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1039 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod undocumented
7 1039 my ($class, %opts) = @_;
8 1039 ▶ die 'runtime is required' unless $opts{runtime};
Branch: 1 branch
BranchTrueFalseTotal
unless $opts{"runtime"} 0 1039 1039
9 1039 return bless { runtime => $opts{runtime} }, $class;
10 }
11  
12 1039 ▶sub evaluate {
Subroutine evaluate: called CC=4 SCAR=14.6
Pod undocumented
13 1039 my ($self, $ast, @inputs) = @_;
14 1039 ▶ die 'expected Pipeline AST' unless $ast && $ast->type eq 'Pipeline';
Branch: 1 branch
BranchTrueFalseTotal
unless $ast and $ast->type eq "Pipeline" 0 1039 1039
Condition33%1/3
$ast and $ast->type eq "Pipeline"
!ll&&!rl&&r
001039
MC/DC0%0/2
$ast and $ast->type eq "Pipeline"
$ast $ast->type eq "Pipeline"
Truth table33%1/3
A and B
A= $astB= $ast->type eq "Pipeline"
ABresult
0X0
100
111
15  
16 1039 my @results = @inputs;
17 1039 for my $filter ($ast->filters) {
18 1528 @results = $self->{runtime}->evaluate_filter($filter, \@results);
19 }
20  
21 973 return @results;
22 }
23  
24 182 1;
« blib/lib/JQ/Lite/Builtin/Aggregate.pm ↑ Summary blib/lib/JQ/Lite.pm »