Expr/Placeholder.pm

filter: Statementstmt 88.8% 16 / 18 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 3 totaltotal 75.8% 22 / 29 CC 2 SCAR 3.7
CC
2
Cov
85%
__ANON__
2.1
stringify
2.0
codify
1.0
CRAP 1.4
« Expr/BinOp.pm ↑ Summary Expr/Bound.pm »
1 package Acme::Lambda::Expr::Placeholder;
2  
3 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 extends qw(Acme::Lambda::Expr::Term);
7  
8 4 has idx => (
9 is => 'ro',
10 isa => 'Int',
11  
12 required => 1,
13 );
14  
15 108 ▶sub deparse{
Subroutine deparse: called CC=1 SCAR=0.0
Pod undocumented
16 108 my $self = shift;
17 108 return sprintf '$_[%d]', $self->idx;
18 }
19 0 ▶sub stringify{
Subroutine stringify: not called CC=1 SCAR=6.9
Pod undocumented
20 0 my $self = shift;
21 0 return sprintf 'placeholder(%d)', $self->idx;
22 }
23  
24 179 ▶sub codify{
Subroutine codify: called CC=1 SCAR=0.0
Pod undocumented
25 179 my $self = shift;
26  
27 179 my $idx = $self->idx;
28  
29 179 ▶ return sub {
Subroutine __ANON__: called CC=2 SCAR=7.2
30 179 ▶ Carp::confess('Not enough arguments for lambda') if @_ <= $idx;
Branch: 1 branch
BranchTrueFalseTotal
if @_ <= $idx 0 179 179
31 179 return $_[$idx];
32 179 };
33 }
34  
35  
36 4 __PACKAGE__->meta->make_immutable;
« Expr/BinOp.pm ↑ Summary Expr/Bound.pm »