JSONY/Receiver.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 10 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 7 totaltotal 84.0% 37 / 44 CC 6 SCAR 9.4
CC
6
Cov
100%
got_bare
5.0
got_list
2.0
BEGIN
1.0
CRAP 2.6
↑ Summary JSONY.pm »
1 ###############################################################################
2 # The receiver class can reshape the data at any given rule match.
3 ###############################################################################
4 package JSONY::Receiver;
5 6 ▶use base 'Pegex::Tree';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 ▶use boolean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 32 ▶sub got_top_seq_entry { $_[1][0][0] }
Subroutine got_top_seq_entry: called CC=1 SCAR=0.0
Pod undocumented
9 3 ▶sub got_top_map { $_[0]->got_map([$_[1]]) }
Subroutine got_top_map: called CC=1 SCAR=0.0
Pod undocumented
10 26 ▶sub got_seq { $_[1]->[0] }
Subroutine got_seq: called CC=1 SCAR=0.0
Pod undocumented
11 33 ▶sub got_map { +{ map {($_->[0], $_->[1])} @{$_[1]->[0]} } }
Subroutine got_map: called CC=1 SCAR=0.0
Pod undocumented
12 79 ▶sub got_string {"$_[1]"}
Subroutine got_string: called CC=1 SCAR=0.0
Pod undocumented
13 sub got_bare {
14 159 ▶ (undef, $_) = @_;
Subroutine got_bare: called CC=5 SCAR=16.1
Pod undocumented
15 159 ▶ /^true$/ ? true :
Branch: 4 branches
BranchTrueFalseTotal
/^true$/ ? : 4 155 159
/^false$/ ? : 2 153 155
/^null$/ ? : 2 151 153
/^( -? (?: 0 | [1-9] [0-9]* ) (?: \. [0-9]* )? (?: [eE] [\-\+]? [0-9]+ )? )$/x ? : 27 124 151
16 /^false$/ ? false :
17 /^null$/ ? undef :
18 /^(
19 -?
20 (?: 0 | [1-9] [0-9]* )
21 (?: \. [0-9]* )?
22 (?: [eE] [\-\+]? [0-9]+ )?
23 )$/x ? ($_ + 0) :
24 "$_"
25 }
26 sub got_list {
27 39 ▶ (undef, $_) = @_;
Subroutine got_list: called CC=2 SCAR=6.9
Pod undocumented
28 39 ▶ @$_ == 1 ? $_->[0] : $_;
Branch: 1 branch
BranchTrueFalseTotal
@$_ == 1 ? : 26 13 39
29 }
30  
31 6 1;
↑ Summary JSONY.pm »