Pegex/Receiver.pm

filter: Statementstmt 92.3% 12 / 13 Branchbran 66.6% 4 / 6 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 66.6% 2 / 3 Podpod 50.0% 1 / 2 totaltotal 75.8% 22 / 29 CC 5 SCAR 14.2
CC
5
Cov
82%
flatten
5.2
rule
2.0
BEGIN
1.0
CRAP 4.1
« Pegex/Compiler.pm ↑ Summary Pegex.pm »
1 package Pegex::Receiver;
2 18 ▶use Pegex::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 18 has parser => (); # The parser object.
5  
6 0 ▶sub rule { $_[0]->{parser}{rule} }
Subroutine rule: not called CC=1 SCAR=6.9
Pod undocumented
7  
8 # Flatten a structure of nested arrays into a single array in place.
9 1 ▶sub flatten {
Subroutine flatten: called CC=5 SCAR=16.4
Pod documented
10 1 my ($self, $array, $times) = @_;
11 1 ▶ $times = -1
Branch: 1 branch
BranchTrueFalseTotal
unless defined $times 1 0 1
12 unless defined $times;
13 1 ▶ while ($times-- and grep {ref($_) eq 'ARRAY'} @$array) {
Branch: 1 branch
BranchTrueFalseTotal
if ($times-- and grep {ref $_ eq "ARRAY";} @$array) 2 1 3
Condition66%2/3
$times-- and grep {ref $_ eq "ARRAY";} @$array
!ll&&!rl&&r
012
MC/DC50%1/2
$times-- and grep {ref $_ eq "ARRAY";} @$array
$times-- grep {ref $_ eq "ARRAY";} @$array
Truth table66%2/3
A and B
A= $times--B= grep {ref $_ eq "ARRAY";} @$array
ABresult
0X0
100
111
14 @$array = map {
15 2 ▶ (ref($_) eq 'ARRAY') ? @$_ : $_
Branch: 1 branch
BranchTrueFalseTotal
ref $_ eq 'ARRAY' ? : 6 0 6
16 } @$array;
17 }
18 1 return $array;
19 }
20  
21 18 1;
« Pegex/Compiler.pm ↑ Summary Pegex.pm »