TPath/Test/Node/Attribute.pm

filter: Statementstmt 66.6% 12 / 18 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 40.0% 2 / 5 Podpod 0.0% 0 / 2 totaltotal 43.7% 14 / 32 CC 3 SCAR 13.9
CC
3
Cov
52%
passes
6.0
__ANON__
6.0
to_string
2.0
CRAP 4.0
« TPath/Numifiable.pm ↑ Summary TPath/Function.pm »
1 package TPath::Test::Node::Attribute;
2 5 $TPath::Test::Node::Attribute::VERSION = '1.007';
3 # ABSTRACT: L<TPath::Test::Node> implementing attributes; e.g., C<//@foo>
4  
5 5 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 5 with 'TPath::Test::Node';
10  
11  
12 5 has a => ( is => 'ro', isa => 'TPath::Attribute', required => 1 );
13  
14 5 has _cr => ( is => 'rw', isa => 'CodeRef' );
15  
16 # required by TPath::Test::Node
17 0 ▶sub passes {
Subroutine passes: not called CC=2 SCAR=17.9
Pod undocumented
18  
19 # my ( $self, $ctx ) = @_;
20 return (
21 0 ▶ $_[0]->_cr // do {
Condition0%0/3
$_[0]->_cr // do { my $a = $_[0]->a; my $apply = $a->can("apply"); $_[0]->_cr(sub { &$apply($a, $_[0]) ? 1 : undef; } ) }
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[0]->_cr // do { my $a = $_[0]->a; my $apply = $a->can("apply"); $_[0]->_cr(sub { &$apply($a, $_[0]) ? 1 : undef; } ) }
$_[0]->_cr do { my $a = $_[0]->a; my $apply = $a->can("apply"); $_[0]->_cr(sub { &$apply($a, $_[0]) ? 1 : undef; } ) }
Truth table0%0/3
A // B
A= $_[0]->_crB= do { my $a = $_[0]->a; my $apply = $a->can("apply"); $_[0]->_cr(sub { &$apply($a, $_[0]) ? 1 : undef; } ) }
ABresult
1X1
011
000
22 0 my $a = $_[0]->a;
23 0 my $apply = $a->can('apply');
24 0 ▶ $_[0]->_cr( sub { $apply->( $a, $_[0] ) ? 1 : undef } );
Subroutine __ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
&$apply($a, $_[0]) ? : 0 0 0
25 }
26 )->( $_[1] );
27 }
28  
29 0 ▶sub to_string { $_[0]->a->to_string }
Subroutine to_string: not called CC=1 SCAR=6.9
Pod undocumented
30  
31 5 __PACKAGE__->meta->make_immutable;
32  
33 5 1;
34  
35 __END__
« TPath/Numifiable.pm ↑ Summary TPath/Function.pm »