blib/lib/Dallycot/AST/ForwardWalk.pm

filter: Statementstmt 96.3% 26 / 27 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 92.5% 37 / 40 CC 3 SCAR 3.6
CC
3
Cov
94%
__ANON__
2.1
__ANON__
2.0
step
1.0
CRAP 1.4
« blib/lib/Dallycot/AST/BuildList.pm ↑ Summary blib/lib/Dallycot/AST/Product.pm »
1 package Dallycot::AST::ForwardWalk;
2 29 our $AUTHORITY = 'cpan:JSMITH';
3  
4 # ABSTRACT: Find the value associated with a property of a subject
5  
6 29 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 29 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 29 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 29 ▶use parent 'Dallycot::AST';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 29 ▶use Promises qw(deferred);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 sub step {
15 4 ▶ my ( $self, $engine, $root ) = @_;
Subroutine step: called CC=1 SCAR=0.0
Pod undocumented
16  
17 return $engine->execute( $self->[0] )->then(
18 sub {
19 4 ▶ my ($prop_name) = @_;
Subroutine __ANON__: called CC=2 SCAR=7.0
20 4 my $prop = $prop_name->value;
21  
22 4 ▶ return $root->type if $prop eq '@type';
Branch: 1 branch
BranchTrueFalseTotal
if $prop eq "\@type" 3 1 4
23  
24 return $root->fetch_property( $engine, $prop )->then(
25 sub {
26 1 ▶ my (@results) = @_;
Subroutine __ANON__: called CC=2 SCAR=7.6
27  
28 1 ▶ if ( @results != 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@results != 1) { } 0 1 1
29 0 return Dallycot::Value::Set->new(@results);
30 }
31 else {
32 1 return @results;
33 }
34 }
35 1 );
36 }
37 4 );
38 }
39  
40 29 1;
« blib/lib/Dallycot/AST/BuildList.pm ↑ Summary blib/lib/Dallycot/AST/Product.pm »