blib/lib/Dallycot/AST/All.pm

filter: Statementstmt 70.9% 22 / 31 Branchbran 100% 4 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 6 / 10 Podpod 0.0% 0 / 4 totaltotal 59.2% 32 / 54 CC 4 SCAR 8.4
CC
4
Cov
68%
new
6.0
process_loop
2.0
to_rdf
2.0
CRAP 2.3
« blib/lib/Dallycot/AST/BuildRange.pm ↑ Summary blib/lib/Dallycot/AST/Unique.pm »
1 package Dallycot::AST::All;
2 29 our $AUTHORITY = 'cpan:JSMITH';
3  
4 # ABSTRACT: Return true iff all expressions evaluate true
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::LoopBase';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub new {
13 0 ▶ my ( $class, @exprs ) = @_;
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
14  
15 0 ▶ $class = ref $class || $class;
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
16 0 return bless \@exprs => $class;
17 }
18  
19 sub to_rdf {
20 0 ▶ my($self, $model) = @_;
Subroutine to_rdf: not called CC=1 SCAR=6.9
Pod undocumented
21  
22 #
23 # node -> expression_set -> [ ... ]
24 #
25 0 return $model -> apply(
26 $model -> meta_uri('loc:all-true'),
27 [ @$self ],
28 {}
29 );
30 }
31  
32 sub simplify {
33 0 ▶ my ($self) = @_;
Subroutine simplify: not called CC=1 SCAR=6.9
Pod undocumented
34  
35 0 return bless [ map { $_->simplify } @$self ] => __PACKAGE__;
36 }
37  
38 sub process_loop {
39 10 ▶ my ( $self, $engine, $d, @expressions ) = @_;
Subroutine process_loop: called CC=2 SCAR=6.9
Pod undocumented
40  
41 10 ▶ if ( !@expressions ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not @expressions) { } 3 7 10
42 3 $d->resolve( $engine->TRUE );
43 }
44 else {
45 $engine->execute( shift @expressions, ['Boolean'] )->done(
46 sub {
47 7 ▶ if ( $_[0]->value ) {
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if ($_[0]->value) { } 6 1 7
48 6 $self->process_loop( $engine, $d, @expressions );
49 }
50 else {
51 1 $d->resolve( $engine->FALSE );
52 }
53 },
54 sub {
55 0 ▶ $d->reject(@_);
Subroutine __ANON__: not called CC=1 SCAR=6.9
56 }
57 7 );
58 }
59  
60 10 return;
61 }
62  
63 29 1;
« blib/lib/Dallycot/AST/BuildRange.pm ↑ Summary blib/lib/Dallycot/AST/Unique.pm »