Purple.pm

filter: Statementstmt 63.4% 347 / 547 Branchbran 57.9% 51 / 88 Conditioncond 45.0% 27 / 60 MC/DCmcdc 25.0% 9 / 36 Subroutinesub 75.0% 39 / 52 Podpod n/a totaltotal 60.4% 473 / 783 CC 72 SCAR 30.9
CC
72
Cov
61%
import
90.3
_set_class_role_attrs
8.0
_parse_role_attrs
7.0
CRAP 22.0
↑ Summary Purple/G.pm »
1 package MooX::Purple;
2  
3 12 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 our $VERSION = '0.20';
7 12 ▶use Keyword::Declare;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 12 our ($PREFIX, %MACROS);
9  
10 14 ▶sub import {
Subroutine import: called CC=26 SCAR=45.0
11 14 my ($class, %args) = @_;
12 14 ▶ $PREFIX = $args{-prefix} unless $PREFIX;
Branch: 1 branch
BranchTrueFalseTotal
unless $MooX::Purple::PREFIX 12 2 14
13 12 ▶ keytype GATTRS is m{
Subroutine BEGIN: called CC=1 SCAR=0.0
14 (?:
15 allow (?&PerlNWS)
16 (?:(?!qw)(?&PerlQualifiedIdentifier)|
17 (?&PerlList))
18 |
19 with (?&PerlNWS)
20 (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)|
21 (?&PerlList))
22 |
23 is (?&PerlNWS)
24 (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)|
25 (?&PerlList))
26 |
27 use (?&PerlNWS)
28 (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)|
29 (?&PerlList)))
30 )?+
31 14 }xms;
32 12 ▶ keytype SATTRS is m{
Subroutine BEGIN: called CC=1 SCAR=0.0
33 (?:
34 allow (?&PerlNWS)
35 (?:(?!qw)(?&PerlQualifiedIdentifier)|
36 (?&PerlList))
37 |
38 )?+
39 14 }xms;
40 12 ▶ keytype PATTRS is m{
Subroutine BEGIN: called CC=1 SCAR=0.0
41 (?:
42 describe (?&PerlNWS)
43 (?:(?&PerlString))
44 )?+
45 14 }xms;
46 0 ▶ keyword role (QualIdent $class, GATTRS @roles, Block $block) {
Subroutine __ANON__: called CC=3 SCAR=14.3
Subroutine __ANON__: not called CC=3 SCAR=14.3
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
47 0 _handle_role($class, $block, @roles)
48 0 }
49 0 ▶ keyword role (PrefixUnaryOperator $pre, QualIdent $class, GATTRS @roles, Block $block) {
Subroutine __ANON__: called CC=4 SCAR=17.7
Subroutine __ANON__: not called CC=4 SCAR=17.7
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
50 0 $class = $PREFIX . '::' . $class if $pre;
51 0 _handle_role($class, $block, @roles)
52 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 12 7 19
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 0 0 0
Condition50%3/6
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
3412
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
000
MC/DC100%2/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
MC/DC0%0/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
Truth table100%3/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
53 0 ▶ keyword class (QualIdent $class, GATTRS @roles, Block $block) {
Subroutine __ANON__: called CC=3 SCAR=14.1
Subroutine __ANON__: not called CC=3 SCAR=14.1
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
54 0 _handle_class($class, $block, @roles);
55 0 }
56 0 ▶ keyword class (PrefixUnaryOperator $pre, QualIdent $class, GATTRS @roles, Block $block) {
Subroutine __ANON__: called CC=4 SCAR=17.4
Subroutine __ANON__: not called CC=4 SCAR=17.4
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
57 0 $class = $PREFIX . '::' . $class if $pre;
58 0 _handle_class($class, $block, @roles);
59 0 ▶ }
Branch: 4 branches
BranchTrueFalseTotal
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 0 9 9
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 0 0 0
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 25 12 37
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 0 0 0
Condition33%4/12
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
900
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
000
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
3925
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
000
MC/DC0%0/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
MC/DC0%0/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
MC/DC100%2/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
MC/DC0%0/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
Truth table33%1/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
Truth table100%3/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
60 0 ▶ keyword class (PrefixUnaryOperator $pre, QualIdent $class, Block $block) {
Subroutine __ANON__: not called CC=2 SCAR=10.0
Subroutine __ANON__: not called CC=2 SCAR=10.0
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
61 0 $class = $PREFIX . '::' . $class if $pre;
62 0 _handle_class($class, $block);
63 14 }
64 0 ▶ keyword macro (Ident $macro, Block $block) {
Subroutine __ANON__: called CC=1 SCAR=1.6
Subroutine __ANON__: not called CC=1 SCAR=1.6
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
65 0 return _handle_macro($macro, $block);
66 0 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 10 6 16
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g) 0 0 0
Condition50%3/6
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
1510
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
000
MC/DC100%2/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
MC/DC0%0/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
Truth table100%3/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | with (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | is (?&PerlNWS) (?:(?!qw)(?&PerlPrefixUnaryOperator)*(?&PerlQualifiedIdentifier)| (?&PerlList)) | use (?&PerlNWS) (?:(?&PerlQualifiedIdentifier)\s*(?&PerlList)|(?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList))) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
67 0 ▶ keyword private (Ident $method, SATTRS @roles, Block $block) {
Subroutine __ANON__: called CC=3 SCAR=13.5
Subroutine __ANON__: not called CC=3 SCAR=13.5
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
68 0 return _handle_private($method, $block, @roles);
69 0 }
70 0 ▶ keyword public (Ident $method, Block $block, PATTRS @pod) {
Subroutine __ANON__: called CC=3 SCAR=13.3
Subroutine __ANON__: not called CC=3 SCAR=13.3
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
71 0 return _handle_public($method, $block, @pod);
72 0 }
73 0 ▶ keyword start (Ident $method, Block $block) {
Subroutine __ANON__: called CC=1 SCAR=1.0
Subroutine __ANON__: not called CC=1 SCAR=1.0
Branch: 5 branches
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
if $pre 0 0 0
if $pre 0 0 0
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g) 12 6 18
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g) 0 0 0
Condition37%3/8
(caller 0)[3] // ""
l!l
140
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
0612
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
000
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
MC/DC50%1/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
MC/DC0%0/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
Truth table66%2/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: allow (?&PerlNWS) (?:(?!qw)(?&PerlQualifiedIdentifier)| (?&PerlList)) | )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
74 0 return _handle_when('-', $method, $block);
75 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=0.5
76 0 ▶ keyword during (Ident $method, Block $block) {
Subroutine BEGIN: called CC=1 SCAR=0.7
Subroutine __ANON__: called CC=1 SCAR=0.8
Subroutine __ANON__: not called CC=1 SCAR=0.8
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
77 0 return _handle_when('~', $method, $block);
78 0 }
79 0 ▶ keyword trigger (Ident $method, Block $block) {
Subroutine __ANON__: called CC=1 SCAR=0.9
Subroutine __ANON__: not called CC=1 SCAR=0.9
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
80 0 ▶ return _handle_when('=', $method, $block);
Branch: 2 branches
BranchTrueFalseTotal
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g) 4 29 33
if ($arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g) 0 0 0
Condition50%3/6
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
2724
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
!ll&&!rl&&r
000
MC/DC100%2/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
MC/DC0%0/2
$arg =~ /\S/ and $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
$arg =~ /\S/ $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
Truth table100%3/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $arg =~ /\S/B= $arg =~ /(?:(?&PerlOWS)(?:(?xms: (?: describe (?&PerlNWS) (?:(?&PerlString)) )?+ )))$PPR::GRAMMAR/g
ABresult
0X0
100
111
81 0 }
82 0 ▶ keyword end (Ident $method, Block $block) {
Subroutine __ANON__: called CC=1 SCAR=0.6
Subroutine __ANON__: not called CC=1 SCAR=0.6
Branch: 1 branch
BranchTrueFalseTotal
if (((caller 0)[3] // "") =~ /\b(?:un)?import\Z/) 14 0 14
Condition50%1/2
(caller 0)[3] // ""
l!l
140
MC/DC0%0/1
(caller 0)[3] // ""
(caller 0)[3]
Truth table50%1/2
A
A= (caller 0)[3]
Aresult
11
00
83 0 ▶ return _handle_when('+', $method, $block);
Subroutine BEGIN: called CC=1 SCAR=0.6
84 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=0.8
85 0 }
86 0  
87 0 ▶sub _handle_macro {
Subroutine BEGIN: called CC=1 SCAR=1.1
Subroutine _handle_macro: called CC=1 SCAR=0.5
88 0 ▶ my ($macro, $block) = @_;
Branch: 2 branches
BranchTrueFalseTotal
if $pre 9 0 9
if $pre 0 0 0
89 0 $block =~ s/^\n*\{\n*\s*|;\n*\t*\}\n*$//g;
90 0 ▶ $MACROS{$macro} = $block;
Subroutine BEGIN: called CC=1 SCAR=0.3
Subroutine BEGIN: called CC=1 SCAR=0.3
91 0 ▶ return '';
Subroutine BEGIN: called CC=1 SCAR=0.2
92 0 }
93 12 ▶ 
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
94 0 ▶sub _handle_public {
Subroutine BEGIN: called CC=1 SCAR=0.6
Subroutine _handle_public: called CC=1 SCAR=0.2
95 0 ▶ my ($method, $block) = @_;
Branch: 2 branches
BranchTrueFalseTotal
if $pre 6 0 6
if $pre 0 0 0
96 0 my $mac = join '|', keys %MACROS;
97 12 $block =~ s/&($mac)/$MACROS{$1}/g;
98 14 ▶ $block =~ s/(^{)|(}$)//g;
Subroutine BEGIN: called CC=1 SCAR=0.0
99 12 return "sub $method {
100 my (\$self) = shift;
101 $block
102 }";
103 }
104  
105 6 ▶sub _handle_private {
Subroutine _handle_private: called CC=2 SCAR=7.0
106 6 my ($method, $block, @roles) = @_;
107 6 my %attrs = _parse_role_attrs(@roles);
108 6 ▶ my $allowed = $attrs{allow} ? sprintf 'qw(%s)', join ' ', @{$attrs{allow}} : 'qw//';
Branch: 1 branch
BranchTrueFalseTotal
$attrs{'allow'} ? : 6 0 6
109 6 my $mac = join '|', keys %MACROS;
110 6 $block =~ s/&($mac)/$MACROS{$1}/g;
111 6 $block =~ s/(^{)|(}$)//g;
112 6 return "sub $method {
113 my (\$self) = shift;
114 my \$caller = caller();
115 my \@allowed = $allowed;
116 unless (\$caller eq __PACKAGE__ || grep { \$_ eq \$caller } \@allowed) {
117 die \"cannot call private method $method from \$caller\";
118 }
119 $block
120 }";
121 }
122  
123 4 ▶sub _handle_when {
Subroutine _handle_when: called CC=3 SCAR=11.0
124 4 my ($pre, $method, $block) = @_;
125 4 my %map = (
126 '-' => 'before',
127 '+' => 'after',
128 '~' => 'around',
129 '=' => 'around'
130 );
131 4 $block =~ s/(^{)|(}$)//g;
132 4 ▶ if ($pre eq '~') {
Branch: 2 branches
BranchTrueFalseTotal
if ($pre eq '~') { } 1 3 4
elsif ($pre eq '=') { } 1 2 3
133 1 $block = "{
134 my (\$orig, \$self) = (shift, shift);
135 $block;
136 }";
137 } elsif ($pre eq '=') {
138 1 $block = "{
139 my (\$orig, \$self) = (shift, shift);
140 my \$out = \$self->\$orig(\@_);
141 $block;
142 }";
143 } else {
144 2 $block = "{
145 my (\$self) = (shift);
146 $block;
147 }"
148 }
149 4 return "$map{$pre} $method => sub $block;";
150 }
151  
152 18 ▶sub _handle_class {
Subroutine _handle_class: called CC=1 SCAR=0.0
153 18 my ($class, $block, @roles) = @_;
154 18 my ($body, %attrs) = _set_class_role_attrs($block, _parse_role_attrs(@roles));
155 18 my $out = qq|{
156 package $class;
157 use Moo;
158 use MooX::LazierAttributes;
159 use MooX::ValidateSubs;
160 use Data::LnArray qw/arr/;
161 $attrs{is}
162 $attrs{with}
163 $attrs{use}
164 $body
165 1;
166 }|;
167 18 return $out;
168 }
169  
170 16 ▶sub _handle_role {
Subroutine _handle_role: called CC=1 SCAR=0.0
171 16 my ($class, $block, @roles) = @_;
172 16 my ($body, %attrs) = _set_class_role_attrs($block, _parse_role_attrs(@roles));
173 16 return qq|{
174 package $class;
175 use Moo::Role;
176 use MooX::LazierAttributes;
177 use MooX::ValidateSubs;
178 use Data::LnArray qw/arr/;
179 $attrs{with}
180 $attrs{use}
181 $body
182 1;
183 }|;
184 }
185  
186 40 ▶sub _parse_role_attrs {
Subroutine _parse_role_attrs: called CC=7 SCAR=19.5
187 40 my @roles = @_;
188 40 my %attrs;
189 40 my $i = 0;
190 40 for (@roles) {
191 59 ▶ if ($_ =~ m/\s*use\s*((?!qw)(?&PerlQualifiedIdentifier))\s*((?&PerlList)) $PPR::GRAMMAR/xms) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_ =~ /\s*use\s*((?!qw)(?&PerlQualifiedIdentifier))\s*((?&PerlList)) $PPR::GRAMMAR/msx) 2 57 59
192 2 $attrs{use}{sprintf "%s %s", $1, $2}++;
193 2 next;
194 }
195 57 $_ =~ m/(with|allow|is|use)(.*)/i;
196 57 my @list = eval($2); # || $2
197 57 ▶ push @list, $2 unless @list;
Branch: 1 branch
BranchTrueFalseTotal
unless @list 17 40 57
198 57 for (@list) {
199 73 $attrs{$1}{$_} = $i++;
200 }
201 }
202 40 for my $o (qw/with allow is use/) {
203 160 ▶ $attrs{$o} = [sort { $attrs{$o}{$a} <=> $attrs{$o}{$b} } keys %{$attrs{$o}}] if $attrs{$o};
Branch: 1 branch
BranchTrueFalseTotal
if $attrs{$o} 32 128 160
204 }
205 40 return %attrs;
206 }
207  
208 34 ▶sub _set_class_role_attrs {
Subroutine _set_class_role_attrs: called CC=8 SCAR=20.8
209 34 my ($body, %attrs, %args) = @_;
210 34 ▶ if ($attrs{allow}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($attrs{"allow"}) 6 28 34
211 6 my $allow = join ' ', @{$attrs{allow}};
212 6 $body =~ s{private\s*(\p{XIDS}\p{XIDC}*)}{private $1 allow qw/$allow/}g;
213 }
214 34 ▶ $attrs{is} = $attrs{is} ? sprintf "extends qw/%s/;\n", join(' ', map { my $l = $_; $l =~ s/^\s*\+/$PREFIX\:\:/; $l; } @{$attrs{is}}) : '';
Branch: 1 branch
BranchTrueFalseTotal
$attrs{'is'} ? : 7 27 34
215 34 my $last;
216 $attrs{with} = $attrs{with}
217 ? sprintf "with qw/%s/;\n", join(' ', map {
218 20 my $l = $_;
219 20 $l =~ s/^\s*\+/$PREFIX\:\:/;
220 20 ▶ unless($l =~ s/^\s*\-/$last\:\:/) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($l =~ s/^\s*\-/${last}::/) 12 8 20
221 12 $last = $l;
222 }
223 20 ▶ if ($l =~ s/^\s*\~//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($l =~ s/^\s*\~//) 2 18 20
224 2 ▶ $last = $PREFIX ? ($PREFIX . '::' . $l) : $l;
Branch: 1 branch
BranchTrueFalseTotal
$MooX::Purple::PREFIX ? : 2 0 2
225 2 $l = '';
226 }
227 20 $l;
228 34 ▶ } @{$attrs{with}})
Branch: 1 branch
BranchTrueFalseTotal
$attrs{'with'} ? : 11 23 34
229 : '';
230 34 ▶ $attrs{use} = $attrs{use} ? join('', map { sprintf("use %s;\n", $_) } @{$attrs{use}}) : '';
Branch: 1 branch
BranchTrueFalseTotal
$attrs{'use'} ? : 2 32 34
231 34 $body =~ s/(^{)|(}$)//g;
232 34 return $body, %attrs;
233 }
234  
235 12 1;
236  
237 __END__
↑ Summary Purple/G.pm »